Old 1st October 2015, 17:55   #1
mginster
Junior Member
 
Join Date: Oct 2015
Posts: 1
ExecWait does not work

I am attempting to get NSIS to pass back the exit code, but in order to do so I need it to wait for the app to finish. To validate it does not work I have done the following.


With the two items below, a batch and an nsi, I compile it to an exe. The exe runs and immediately returns control to cmd prompt...yet the spawned testing.bat stays up and to perform the timeout 30. I need NSI to actually ExecWait till that process is done and it does not do this.

Any ideas on how to even fake it out?




Testing.bat:

timeout 30

exit /B 2


Testing.nsi:


OutFile "Testing.exe"

InstallDir C:\Testing

SilentInstall silent

Section

SetOutPath C:\Testing

SetOverWrite on

File Testing.bat

SetOverWrite off

ExecWait Testing.bat

SectionEnd
mginster is offline   Reply With Quote
Old 1st October 2015, 18:33   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
I think you are mixing two different issues here.

1) Executing a NSIS installer (or any other GUI application) from cmd.exe will not cause cmd.exe to wait, cmd.exe only waits for batch-files and console applications. Use "start /wait myapp.exe" if you need cmd.exe to wait.

2) Your call to ExecWait is missing the second parameter if you actually need the exit code of the child process.

IntOp $PostCount $PostCount + 1
Anders 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