Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 20th January 2003, 07:54   #1
JaqDraco
Junior Member
 
Join Date: Oct 2001
Posts: 13
exec command questions

Hi

i want to run a programm minimized.
exec seems not to support this. At th moment i have to create a batch file using the "start" command. This also is capable of setting process priority. Is there any way doing this with native nsis commands?
JaqDraco is offline   Reply With Quote
Old 20th January 2003, 10:39   #2
virtlink
Major Dude
 
virtlink's Avatar
 
Join Date: Sep 2002
Location: At [4C69:6E6B]
Posts: 561
Use this:
PHP Code:
ExecShell "open" "***91;exename***93;" "***91;parameters***93;" SW_SHOWMINIMIZED 
Where [exename] is the name of your .exe file and [parameters] are the parameters for it. If it doesn't work with "open", try something else (I'm not sure if "open" also works with executables).

Here you can find the syntax.

"I'll quote you when you say something memorable."
- Claudia Pelsmaeker
virtlink is offline   Reply With Quote
Old 20th January 2003, 11:32   #3
JaqDraco
Junior Member
 
Join Date: Oct 2001
Posts: 13
I've tested execshell with "open" but the programm didn't start
JaqDraco is offline   Reply With Quote
Old 20th January 2003, 11:41   #4
virtlink
Major Dude
 
virtlink's Avatar
 
Join Date: Sep 2002
Location: At [4C69:6E6B]
Posts: 561
Try an empty zero-length string "". Everywhere I look, it says that in order to run a program, you must use an empty string. I can't test it right now.

"I'll quote you when you say something memorable."
- Claudia Pelsmaeker
virtlink is offline   Reply With Quote
Old 20th January 2003, 11:46   #5
JaqDraco
Junior Member
 
Join Date: Oct 2001
Posts: 13
This don't work either. Unfortunately ".exe" doesn't appear in the extension association in the explorer settings. Therefore i think it can only be "executed". But then there should be a way to change the status Maximized, normal or minimized like in shortcuts
JaqDraco is offline   Reply With Quote
Old 20th January 2003, 11:53   #6
virtlink
Major Dude
 
virtlink's Avatar
 
Join Date: Sep 2002
Location: At [4C69:6E6B]
Posts: 561
I know. I didn't find it there eighter. But in Visual Basic, there is a very similar API command called ShellExecute. That does virtually the same and works the same.

I found some more information about this function here, and it states that you can use the "open" action for documents, files and executables.

Please post your code here, or at least the error you get, and where. Do you get the error when compiling the script, or when you run the script, or doesn't the exe start at all, without any messages?

"I'll quote you when you say something memorable."
- Claudia Pelsmaeker
virtlink is offline   Reply With Quote
Old 20th January 2003, 12:09   #7
JaqDraco
Junior Member
 
Join Date: Oct 2001
Posts: 13
mmh I didn't checked the state of errors yet but i can say that the script compiles without error but it seems that the exe wasn't executed but i will use the iferrors for testing purposes but i check for his later
JaqDraco is offline   Reply With Quote
Old 22nd January 2003, 07:49   #8
JaqDraco
Junior Member
 
Join Date: Oct 2001
Posts: 13
i've checked again on another XP maschine the following

ExecShell "" "[exename]" SW_SHOWMINIMIZED

The Programm was started but not minimized
JaqDraco is offline   Reply With Quote
Old 22nd January 2003, 09:38   #9
virtlink
Major Dude
 
virtlink's Avatar
 
Join Date: Sep 2002
Location: At [4C69:6E6B]
Posts: 561
I think you should ask KiCHiK, for example, by PM-ing him: Click here!.

"I'll quote you when you say something memorable."
- Claudia Pelsmaeker
virtlink is offline   Reply With Quote
Old 22nd January 2003, 13:17   #10
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
Does it work without SW_SHOWMINIMIZED?
Are you using a full path (F:\bla\bla\prog.exe instead of prog.exe)?

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 22nd January 2003, 13:20   #11
JaqDraco
Junior Member
 
Join Date: Oct 2001
Posts: 13
i'm using

ExecShell "" "$EXEDIR\exename" SW_SHOWMINIMIZED

and as i said the program starts but not minimized
JaqDraco is offline   Reply With Quote
Old 22nd January 2003, 13:37   #12
rainwater
Senior Member
 
Join Date: Aug 2000
Posts: 396
Send a message via ICQ to rainwater
Quote:
Originally posted by JaqDraco
i'm using

ExecShell "" "$EXEDIR\exename" SW_SHOWMINIMIZED

and as i said the program starts but not minimized
ExecShell "open" "$EXEDIR\exename" "" SW_SHOWMINIMIZED

You didn't pass the empty paramater string in that example.
rainwater is offline   Reply With Quote
Old 22nd January 2003, 13:45   #13
JaqDraco
Junior Member
 
Join Date: Oct 2001
Posts: 13
Quote:
Originally posted by rainwater

You didn't pass the empty paramater string in that example.
is it necessary? Because the Compiler doesn't complains about the removal of the empty parameter string but i can check that later
JaqDraco is offline   Reply With Quote
Old 22nd January 2003, 13:58   #14
virtlink
Major Dude
 
virtlink's Avatar
 
Join Date: Sep 2002
Location: At [4C69:6E6B]
Posts: 561
The compiler cannot guess that SW_SHOWMINIMIZED is the fourth parameter when you type it as being the third.

"I'll quote you when you say something memorable."
- Claudia Pelsmaeker
virtlink is offline   Reply With Quote
Old 22nd January 2003, 14:08   #15
JaqDraco
Junior Member
 
Join Date: Oct 2001
Posts: 13
this works:

ExecShell "" "$EXEDIR\exename.exe" "" SW_SHOWMINIMIZED

but the docs don't say that empty parameter is necessary to use the state

nevertheless is was my fault

sorry guys
JaqDraco is offline   Reply With Quote
Old 22nd January 2003, 16:56   #16
virtlink
Major Dude
 
virtlink's Avatar
 
Join Date: Sep 2002
Location: At [4C69:6E6B]
Posts: 561
That's because the writers of the docs are experienced C++, NSIS, Java, VB programmer's that forget things that are very normal and common for them, like knowing that you always have to fill in a parameter even when it's not used.

I deal with it all the time myself. I help people with Windows computer problems via the phone or e-mail and forget that very basic things like knowing how to open the context menu of a file or browsing for a folder are not known with those users.

"I'll quote you when you say something memorable."
- Claudia Pelsmaeker
virtlink is offline   Reply With Quote
Old 22nd January 2003, 17:25   #17
rainwater
Senior Member
 
Join Date: Aug 2000
Posts: 396
Send a message via ICQ to rainwater
I don't know how to describe it any better. When the 5th parameter is required, obviously you can't pass it as the 4th parameter.
rainwater 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