- NSIS Discussion
- ExecWait don't wait ? Can't lunch 2.exe :(
Archive: ExecWait don't wait ? Can't lunch 2.exe :(
DraGula0
1st April 2008 14:15 UTC
ExecWait don't wait ? Can't lunch 2.exe :(
Hello,
I am a newbie in NSIS, and I acknowledge that I do not understand my error.
Especially how my script is really simple!!
I will try to explain me with my English of 3 year old child.
It is broken up into 3 files NSI. (Thus 3.exe)
> The first (1.nsi), allows to uninstall an application, write a key of register (to launch the 2nd .exe): Function well!
> The second (2.nsi) start on Windows logon. An installation is carried out (functions well!) and with the end (3.nsi), the achievable last would have started. But it is not the case!
PS: If ever I launch my 3rd file .exe (3.nsi) the functions included in script functions well. I do not include/understand why it cannot be launched by my second script…
I hope to be sufficiently clear…
Here my 3 small script in attached file.
1.nsi
2.nsi
3.nsi
Thank for your help !!!
AaronLS
1st April 2008 18:04 UTC
Where in your script did you create BEW.exe?
In 2.nsi you have this:
Section "Global-package"
SetOutPath "$TEMP"
#Install BE + Récupération data
ExecWait '"$TEMP\BEW.exe" /q /cfg:"last.eac" /t /l:us' $0
DetailPrint "Erreurs $0"
ExecWait '"$TEMP\test.exe"'
SectionEnd
Where does BEW.exe come from? Don't you need to extract it first? :
Section "Global-package"
SetOutPath "$TEMP"
File "Installers\BEW.exe"
#Install BE + Récupération data
ExecWait '"$TEMP\BEW.exe" /q /cfg:"last.eac" /t /l:us' $0
DetailPrint "Erreurs $0"
ExecWait '"$TEMP\test.exe"'
SectionEnd
Or better yet, to avoid filename conflicts and problems due to locked files, I use GetTempFileName like this:
Section "Global-package"
SetOutPath "$TEMP"
Var /GLOBAL _1_BewExe
GetTempFileName $_1_BewExe
File /oname=$_1_BewExe "Installers\BEW.exe"
#Install BE + Récupération data
ExecWait '"$_1_BewExe" /q /cfg:"last.eac" /t /l:us' $0
DetailPrint "Erreurs $0"
ExecWait '"$TEMP\test.exe"'
SectionEnd
DraGula0
3rd April 2008 10:02 UTC
Thank for your feedback,
In fact, BEW.exe is an external executable.
2.nsi is launch by 1.nsi -> Theses actions is functional
But 3.nsi (test.exe) don’t start automatically. If I launch manually test.exe, actions are successful.
I don’t understand why my “2.nsi†can’t start this executable (ExecWait '"$TEMP\test.exe"')
Strange, no ? :p
ttworc
3rd April 2008 15:08 UTC
Re: ExecWait don't wait ? Can't lunch 2.exe :(
Originally posted by DraGula0
Hello,
I am a newbie in NSIS, and I acknowledge that I do not understand my error.
Especially how my script is really simple!!
I will try to explain me with my English of 3 year old child.
It is broken up into 3 files NSI. (Thus 3.exe)
> The first (1.nsi), allows to uninstall an application, write a key of register (to launch the 2nd .exe): Function well!
> The second (2.nsi) start on Windows logon. An installation is carried out (functions well!) and with the end (3.nsi), the achievable last would have started. But it is not the case!
PS: If ever I launch my 3rd file .exe (3.nsi) the functions included in script functions well. I do not include/understand why it cannot be launched by my second script…
I hope to be sufficiently clear…
Here my 3 small script in attached file.
1.nsi
2.nsi
3.nsi
Thank for your help !!!
i wrote a this header that would allow build multiple script in one... you can exec any single section by command line. the parameter refer to section name.
this needed "NSISArray" to complie
AaronLS
3rd April 2008 15:18 UTC
In fact, BEW.exe is an external executable.
I understand it's external. My point is, are you sure it even exists in $TEMP at runtime. Because $TEMP is a variable, I wouldn't just assume that it is C:\Windows\Temp. $TEMP might be Docs&Settings\Local Data\Temp or something like that.
This is why I feel strongly that if you want to be absolutely sure BEW.exe or test.exe exists at runtime in the expected location, then you should just use the File isntruction to extract them as I did in my example. Or at the very least use FileExists to verify it exists before trying to run.
You could do this for testing:
!include "LogicLib.nsh"
${If} ${FileExists} "$TEMP\test.exe"
MessageBox MB_OK "test.exe found"
${Else}
MessageBox MB_OK "test.exe NOT found"
${EndIf}
If you get the second message, then the file doesn't even exist at that path, which would be why ExecWait fails.
DraGula0
4th April 2008 16:58 UTC
Hi !
AaronLS, I've add your code for testing :
Result : test.exe found
Good ! But test.exe is not executed :weird:
DraGula0
4th April 2008 17:17 UTC
ttworc > I will try your script soon, thank for your help :-)
AaronLS
4th April 2008 18:43 UTC
If you don't have any luck with that, here's one other diagnostic, checking to see if NSIS detected an error. Use ClearErrors just before to ensure flag is cleared, and then check errors right after:
Section "Global-package"
SetOutPath "$TEMP"
#Install BE + Récupération data
ExecWait '"$TEMP\BEW.exe" /q /cfg:"last.eac" /t /l:us' $0
DetailPrint "Erreurs $0"
ClearErrors
ExecWait '"$TEMP\test.exe"'
${If} ${Errors}
DetailPrint "Error executing test.exe"
${EndIf}
SectionEnd
DraGula0
7th April 2008 09:08 UTC
AaronLS,
Yes, I'm not lucky...
I have add your modification in "2.nsi".
There is no message on screen, and no executing of test.exe.
And... If I launch test.exe manually, result is good.
I'm desperate !
DraGula0
16th April 2008 12:10 UTC
No id ? :-(
kichik
16th April 2008 23:10 UTC
If test.exe is silent, how can you be sure it really isn't executed? It looks like test.exe is trying to copy over some additional files into what BEW.exe creates. If ExecWait doesn't really wait for BEW.exe because it's a special installer, the directory where test.exe should write its files doesn't exist and so it fails.
BTW, you can use $SYSDIR instead of C:\Windows\system32 and C:\WinNT\system32.