Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 20th November 2007, 21:45   #1
Fightin_Foo
Junior Member
 
Join Date: Nov 2007
Location: Ohio
Posts: 49
Send a message via AIM to Fightin_Foo
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
Fightin_Foo is offline   Reply With Quote
Old 20th November 2007, 21:50   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
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
kichik is offline   Reply With Quote
Old 23rd November 2007, 21:03   #3
Fightin_Foo
Junior Member
 
Join Date: Nov 2007
Location: Ohio
Posts: 49
Send a message via AIM to Fightin_Foo
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?
Fightin_Foo is offline   Reply With Quote
Old 23rd November 2007, 21:16   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
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
kichik is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump