gordengram
18th December 2012 13:17 UTC
NSIS ExecWait dosen't wait when installing the setup file via chrome browser
When downloading the .exe installation file (NSIS installation) and opening it via chrome in order to execute it the ExecWait dosen't work.
I'm running a batch file which kill browsers processes inside of the installation, because I opened the exe file via the chrome (Download Manager) the ExecWait think that the execute has ended and therefore dosen't wait for the next ExecWait calls that coming after the line which call to execute the batch file. It think that chrome was the parent process so it quitting the installation.
Is there a way to let the ExecWait know that although I killed the chrome browser (or any other browsers) process to continue the installation? and waiting for only the .exe files that I execute via the NSIS script?
P.S - When installing the .exe file out of the browser (download manager) it works fine.
gordengram
18th December 2012 16:16 UTC
Edit (i have included codes):
EDIT (I HAVE INCLUDED CODES):
NSIS code:
#-----------------------------------
# define the name of the installer
outfile "setup.exe"
Name "Example"
installDir $LOCALAPPDATA\Test
# default section
section
setOutPath $INSTDIR
File install.exe
File test.exe
ExecWait $INSTDIR\install.exe
Delete $INSTDIR\install.exe
ExecWait $INSTDIR\test.exe
Delete $INSTDIR\test.exe
sectionEnd
#-----------------
and inside of the install.exe (its a .bat file the I compile to an .exe file) this code:
@echo off
taskkill /F /IM chrome.exe /T
If you download the setup.exe via chrome and executing it from the bottom bar (download manager) it will execute install.exe (closing chrome.exe) but will skip this lines:
Delete $INSTDIR\install.exe
ExecWait $INSTDIR\test.exe
Delete $INSTDIR\test.exe
Anders
18th December 2012 19:03 UTC
ExecWait always waits for the child process it started but it does not wait for grandchildren...
Brummelchen
22nd December 2012 08:14 UTC
you should use the nsprocess plugin or nsis to kill or obey tasks.