Archive: ExecWait crashes on Vista


ExecWait crashes on Vista
Hi Guys,

I'm looking for some advice on traking a crash problem on Vista only.

Section4
ExecWait '"t:\batch\cgdcompile-02.cmd"'
SectionEnd

My installer has 5 sections and it crashes consistantly on the 4th section when I run all the sections. If just run the forth section it runs fine.

All I can think is that something I am doing in an earlier section is having an adverse effect on the Exec command. These is over 1000 lines in the script, so I am relucant to post it and I'm sure you won't want to read that lot :)

When execwait is run the installer crashes and a CMD.EXE (without a window)is left as a process?

I have tried exec, execwait, nsExec::ExecToLog etc.


I can only think that XP is handling any memory issues better than Vista? Does anyone have any ideas as what could cause this situation or what I should be looking for?

Any tips greatfully recieved.

Thanks


I don't know if Exec/ExecWait was ever intended to call Batch files. I think it's for executables (.exe) in first case! Same applies to nsExec. This might be the cause of the problem, but I'm not sure. Just speculation...

What if you do it like this:

ExecWait '"$SYSTEM\cmd.exe" "$INSTDIR\Batchfile.cmd"'

Thanks for the quick reply.

I haven't tried that today, but I did have a similar issue a couple of months ago and it didn't help.

I'll give it another go anyway, but hope to hear from anyone else.


You should use:

ReadEnvStr $R0 COMSPEC
nsExec::Exec `"$R0" /C "$INSTDIR\file.bat"`
Pop $R0

Also is it completely necessary to use a batch file? Most if not all of what can be done in a batch can be done in NSIS code removing the dependency on command prompt.

Stu


This particular installer is used for automated testing which clears the installed product and installs a new clean version. It then starts a couple of batch files to copy additional test files and start the application many times with different script files.

The reason I wish to call a batch file is that it can be changed by follow workers who are not familiar with NSIS and wish to add additional tests or parts to the batch file without recompiling the installer.

This method has has worked well for several years on XP until Vista came along and started playing up. The crashing is not consistent and can vary from PC to PC. We run tests overnight on 8 XP machines which never fail and 2 Vista machines which are giving me a headache.

The batch file can also be used for tempoary changes commands like if %COMPUTERNAME%==FRED ..... which gives everyone a degree of flexability.


You could also try:

ReadEnvStr $R0 COMSPEC
ExecWait `"$R0" /C "$INSTDIR\file.bat"` $R0

or possibly:

ExecShell open $INSTDIR\file.bat

Just some tips: Use nsExec::ExecToLog if you like the batch output in the install log window. Use the above nsExec code but with /K not /C to keep the batch window open after execution.

Stu