Old 4th March 2011, 23:42   #1
skr64
Junior Member
 
Join Date: Mar 2011
Posts: 4
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
Attached Files
File Type: nsi Installer_Script.nsi (2.6 KB, 193 views)
skr64 is offline   Reply With Quote
Old 5th March 2011, 00:44   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
ExecWait '"C:\nsis\AdobeAIRInstaller.exe" -silent -eulaAccepted' this is a path on your local system, change it to $instdir\AdobeAIRInstaller.exe

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 5th March 2011, 08:36   #3
skr64
Junior Member
 
Join Date: Mar 2011
Posts: 4
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
Attached Files
File Type: nsi Installer_Script.nsi (2.6 KB, 176 views)
skr64 is offline   Reply With Quote
Old 5th March 2011, 12:06   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
That is specific to the application. Ask the author/developer.

Stu
Afrow UK is offline   Reply With Quote
Old 5th March 2011, 12:31   #5
skr64
Junior Member
 
Join Date: Mar 2011
Posts: 4
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
skr64 is offline   Reply With Quote
Old 5th March 2011, 12:50   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 5th March 2011, 15:39   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
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)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 5th March 2011, 15:50   #8
skr64
Junior Member
 
Join Date: Mar 2011
Posts: 4
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
skr64 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump