I'm hoping someone can help me with the following.
I have a NSIS script that silently copies a load of files to a temp folder (C:\Users\username\AppData\Local\Temp) then runs one of the files (an executable) from this location. A button within this exe is then supposed to launch another exe from the same folder however for some reason this doesn't work and instead exits the program and all the files from the temp folder get removed.
The script reads as follows:
Strangely, if I manually run the same exe from the temp folder NSIS writes to so that there are two copies of it running consecutively then click the button that;s supposed to call the other exe it opens as expected!?Name "Myapp"
Outfile "Myapp.exe"
InstallDir "$pluginsdir"
Function .onInit
SetSilent silent
FunctionEnd
Section ""
InitPluginsDir
SetOutPath "$pluginsdir"
File /r "C:\tocopy\*"
ExecWait '"$pluginsdir\start.exe"'
SetOutPath $exedir
SectionEnd
Clicking the cancel button on the first exe closes it and deletes all the files from the temp directory which I believe is normal behaviour when using the $pluginsdir. Ideally I don't want it deleting all the files until the second exe has run, the user closes out of this then both exes and all other related files can be removed.
What obvious thing am I missing here? 🙂
Thank you