Skip to content
⌘ NSIS Forum Archive

ExecWait does not work

2 posts

mginster#

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
Anders#
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.