Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 13th January 2005, 08:58   #1
vbgunz
Senior Member
 
Join Date: Jun 2003
Posts: 284
Send a message via AIM to vbgunz
How do you ReadINIStr & nsExec::ExecToLog one line with a few parameters?

I've tried doing the following which should really be easy but which is proving to be so frustrating. I've tried so many combinations of the following, it got me sick

I am trying to read an ini value then feed it into a cmd fired by nsExec::ExecToLog. I've tried so many different combinations, I am tired The pasted code below is what I feel should be dead on the money.
code:

ReadEnvStr $0 COMSPEC
ReadINIStr $1 $INSTDIR\madman.ini "field 1" state
nsExec::ExecToLog '$0 /C $\"$INSTDIR\psychopath.exe$\" -r $\"$INSTDIR\hysteria.log$\" /$1 /$1'

When I say I've tried so many things I mean it. Look at the above code... I've tried without exaggeration maybe forty or more different combinations. I finally got tired

I just don't see whats going wrong... *sigh*. I'll try to remember a long list of errors and make this quick. Either (A) NSIS wont read it upon install OR (B) It will log the DOS splash screen (MS COPYRIGHT,etc) and nothing else OR (C) It will tell me C:\Program is not a program, etc OR (D) I can only get the first of the code to work
code:

nsExec::ExecToLog '$0 /C $\"$INSTDIR\psychopath.exe$\"



The entire line of code above (-minus NSIS format) direct into the cmdline works perfect without hiccup. Yet I must be getting the format horribly wrong. Can someone please help shine some light on my problem?

Thank you for your time!
vbgunz is offline   Reply With Quote
Old 13th January 2005, 09:11   #2
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
ReadINIStr $1 "$INSTDIR\madman.ini" "field 1" "state"

INSTDIR includes blank spaces, this is why c:\program is not a program.
MessageBox also helps to debug (after every statement )
Are you really sure you need this cmd line beginning?
"E:\WINNT\system32\cmd.exe /C ..."
nsExec works without this.
Takhir is offline   Reply With Quote
Old 13th January 2005, 13:45   #3
vbgunz
Senior Member
 
Join Date: Jun 2003
Posts: 284
Send a message via AIM to vbgunz
Thank you for pointing that out. I am not sure why I've been using comspec but remember faintly it being because it was supposed to be a sure fire way to find the cmd

After 3 hours of sleep and my baby waking me up, I checked this thread, got back to work on it and got it to work. I removed code like you suggested and all seems well.

Thank you for your help and time Takhir!
vbgunz 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