skr64
4th March 2011 23:42 UTC
execwait error code 2
Hi,
I try to install an Adobe AIR application with a native installer.
The installation works fine if I install it in a custom folder like c:\test, but if I try to install it under c:\program files I get the error code 2 from execwait.
I have admin rights on the machine.
I tried in on Win XP and WIN 7 professional, both with admin privileges.
Could you please give me an advice how find the root cause of this problem?
Find the script as attachment.
Thanks in advance!
Stefan
Anders
5th March 2011 00:44 UTC
ExecWait '"C:\nsis\AdobeAIRInstaller.exe" -silent -eulaAccepted' this is a path on your local system, change it to $instdir\AdobeAIRInstaller.exe
skr64
5th March 2011 08:36 UTC
Ok, I changed it to $instdir, but the error comes from this line:
ExecWait '"$INSTDIR\MyAIRApplication.exe" -silent -eulaAccepted -location "$INSTDIR" -desktopShortcut -programMenu' $0
I updated the script.
The error only occurs when I try to install it in the Program Files folder.
What means error code 2?
Thanks a lot!
Stefan
Afrow UK
5th March 2011 12:06 UTC
That is specific to the application. Ask the author/developer.
Stu
skr64
5th March 2011 12:31 UTC
Thanks for your reply!
The problem is that I'm the developer of the application myself. The application is an Adobe AIR application, packaged as a native installer.
When I run the Adobe AIR native installer the application gets installed without any problem.
But if I use the script I get this error code 2 from execwait.
Could it be that there are old registry entries that causes the error?
Do you know about any way how I can find out what the error causes?
As I said the Adobe AIR installer installs my application without any problem.
But I need this script because I need to do the check for the AIR runtime etc.
My client wants a package that does everything itself.
Thanks a lot!
Stefan
Afrow UK
5th March 2011 12:50 UTC
Try setting a suitable working directory first with SetOutPath. The problem could be caused by anything. You should be asking them (Adobe or whoever) what exit code 2 means.
Stu
Anders
5th March 2011 15:39 UTC
Or you could try running Process Monitor and see if you can spot the problem, 2 is the windows error code for file not found (But it could also have a totally different meaning in their app)
skr64
5th March 2011 15:50 UTC
I found the issue! The error code 2 is the exit code from the Adobe AIR native installer.
Exit code 2: Usage error (incorrect arguments)
After changing:
ExecWait '"$INSTDIR\MyAIRApplication.exe" -silent -eulaAccepted -location "$INSTDIR" -desktopShortcut -programMenu' $0
to:
ExecWait '"$INSTDIR\MyAIRApplication.exe" -silent -eulaAccepted -desktopShortcut -programMenu' $0
it worked perfectly fine.
So the problem seems to be that the Adobe AIR native installer complains about the -location argument if this is set to the progam files folder. When the -location argument is set to any other folder then it works perfectly fine.
So, now I check the $instdir and I have two different execwait statements, one for the program files folder (without -location argument, because the it installs automatically to this folder) and one for any other folder (with the -location argument).
Thanks a lot for your help! Your advice helped me to narrow down the problem.
Kind regards!
Stefan