paulcookie
13th July 2005 10:46 UTC
execWait problem
I have searched through the help and forums but to no avail! My problem is getting a .bat file to run using execwait. I write the bat file during the install and it appears correctly in the install routine, it also works if I double click on it.
The install says it is running it but it never does. I have tried ExecWait '"$INSTDIR\PDMIntegrator\PDMi_build_mm.bat"'
and even tried
ExecWait "c:\temp\PDMi_build_mm.bat"
the file is alway there, it just never executes. I have used a message box to confirm the path but I just cannot seem to see what is wrong.
Help!
Afrow UK
13th July 2005 12:12 UTC
Tried nsExec::Exec?
Edit: Also make sure you set the working folder correctly before running the batch file using SetOutPath.
You shouldn't really need to use a batch though - everything that can be done through a batch file can be done through NSIS script too.
-Stu
paulcookie
13th July 2005 13:02 UTC
Thanks for the reply, I had tried nsExec as well, which make me think something must be fundamentally wrong. My code is:-
CreateDirectory "$INSTDIR\PDMIntegrator"
SetOutPath "$INSTDIR\PDMIntegrator"
call writeBuildBatchFile
; ExecWait '"$INSTDIR\PDMIntegrator\PDMi_build_mm.bat"'
; ExecWait "PDMi_build_mm.bat"
nsExec::Exec '"PDMi_build_mm.bat"'
As you can see I have 3 options, none of which work. I appreciate the comments about the batch file, it is slightly unusual in that it is running a custom routine that already exists on the target system. Are there any install logs I can view?
I have also tried using the IfFileExists command before running my execWait, and it tells me the file is there.
I downloaded nsi yesterday if that helps. My batch file is below, I don't know whether the syntax is wrong in this?
echo hello > c:\temp\test.txt
rem PDMi_build_mm.bat verion 13.20
cd /d "C:\Program Files\CoCreate\OneSpace Manager 2005\clntwin"
call mmbuild.bat
Takhir
13th July 2005 13:23 UTC
This works on my comp (XP Pro SP2), see attachment.
nsExec or my execDos would be better, of course.
SetOutPath creates folder if it not exists yet.
I used File command instead of dynamic file creation ;)
paulcookie
13th July 2005 14:52 UTC
Thanks!
Takhir, Thanks very much for the example scripts, they helped me focus on what was the problem. I have not used execWait before and spent all my time looking for a problem with the syntax of the command, which you proved to be correct.
It turns out my routine to write the batch file did not have a fileClose statement!
Once again many thanks, the quality and speed of your response was excellent!