Not valid Windows Win32 application error

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
JMS_PT
Posts: 73
Last visit: Mon Sep 24, 2018 10:26 am

Not valid Windows Win32 application error

Post by JMS_PT »

Hi,
I`m using PrimalScript Version 7.3.103 x64 in Windows 10 x64.
When I convert vbscript to executable, if I try to run that executable in windows server 2003, I get the error
"C:\windows\MyScriptTest.exe is not a valid Win32 application."
then I close the message window and in the command line console I see a message = "Access Denied".

I already tried to use 32 bit only instead of native, but I get the same error.

I ran this executable with Admin Permissions.

In the package settings I have The script engine option "SAPIEN Script Host (Command Line)" selected with Native Target.

Is this a .NET 4 issue? since Windows 2003 does not have .NET 4 how can I solve this? Can I download a older version of the Primal Script that allows this?
Attachments
3.png
3.png (4.82 KiB) Viewed 7211 times
2.png
2.png (8.49 KiB) Viewed 7211 times
1.png
1.png (59.59 KiB) Viewed 7211 times
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Not valid Windows Win32 application error

Post by Alexander Riedel »

If you use the 'native' option, the starter executable is built against the .NET 4.5 framework. In order to use this mechanism you will need to install that.
If you package the VBScript with the 32 Bit option and the SAPIEN Script Host, there is no dependency on a .NET runtime. The executable uses the Visual Studio runtime.
Since Server 2003 is equivalent to Windows XP, this may no longer be supported.
But ultimately, it depends on your server configuration.
You executable file may be locked, your server may not allow running things form the root directory, your server may be configured to not run files that are not signed etc.
An older version of PrimalScript has ultimately less options and will not alleviate any issues on the machine.
I would suggest to build this for the native platforms you need it for and see that it works on these machines.
You can use this http://www.dependencywalker.com/ to see what your exeutable needs and what is not there.

Please note that this tool does not work for .NET assemblies in the same manner.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
JMS_PT
Posts: 73
Last visit: Mon Sep 24, 2018 10:26 am

Re: Not valid Windows Win32 application error

Post by JMS_PT »

Ok, I`ll check that , regarding to Native Mode, when I run the in systems that don`t have the correct .NET version, I get a Window Error warning to install the minimum .NET version. If I`m logged to the machine I can click the OK button of that Window Error, but if I use a remote session or a script that "calls" that executable, I end up with a remote command line waiting for someone to hit the OK button of that Windows message. Is it possible to redirect or ignore those Windows Errors when starting the executable?
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Not valid Windows Win32 application error

Post by Alexander Riedel »

No. Microsoft decided to make the system display a message box. Nothing you or I can do about that.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 6 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.