|
|
#1 |
|
Junior Member
|
Creating files with batch scripts
Hello everybody,
I was having so many troubles reading the exit codes from my batch scripts that I decided to go a different way. I changed the scripts so they now make a dummy text file (using echo and redirect ">") if they ran successfully and don't make the file if they had an error. In the installer / uninstaller I want to just test for the presence of the file. The scripts will create the files fine when I run them from the command line but don't create the file when I call them from the installer. Anybody have any thoughts about why this is happening? Or suggestions to get the files written. I am not an expert in either batch or NSIS so there could be any number of things wrong. Thanks |
|
|
|
|
|
#2 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
Because you must use the command line processor - cmd.exe or command.com. It's the only process that parses input/output redirection. When normally creating processes on Windows with CreateProcess, those won't work and will be considered part of the arguments.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#3 |
|
Junior Member
|
I changed the scripts from .bat to .cmd to ensure they were run with cmd.exe, and I am using ExecWait to call the scripts so I think I am avoiding the CreateProcess problems that occur with !execute and !system. Is there something else that I am missing?
|
|
|
|
|
|
#4 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
!execute and !system are compile time commands. They won't cause the script to run on the user's system.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|