Old 4th March 2009, 22:41   #1
vendorgsm
Junior Member
 
Join Date: Mar 2009
Location: Romania
Posts: 3
Question How to run 2 .exe files same time?

Hello,

I want is to create an NSIS script to run 2 exe files both same time.

I want to run the both exe files silent (SilentInstall silent) and to add an icon to it. The location of the files should be "EXEDIR".

The first exe run other process then exit so the ExecWait seems not help this case. Also don't need ExeTimeout because don't want any exe process closed after some time.

Thank you for any help.
vendorgsm is offline   Reply With Quote
Old 4th March 2009, 23:09   #2
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
You should be able to just use the Exec command.

Running them silent might be an issue depending how the EXE you want to run is configured. (If it was built with NSIS, then you have some amount of control; otherwise, you're stuck with whatever the developer gave you.)

If you are running console apps, you can use the ExecCmd or ExecDos plugin with the asynchronous option set.
Comperio is offline   Reply With Quote
Old 5th March 2009, 00:16   #3
vendorgsm
Junior Member
 
Join Date: Mar 2009
Location: Romania
Posts: 3
Hi,

I just created the next script and seems that run ok but don't know if will work also with Vista (I use XP). Please confirm if this is the right way and all is in order:


Name "FileName"
OutFile "OutFile.exe"
Icon "icon.ico"

SilentInstall silent
SetCompressor /SOLID LZMA
CRCCheck On

Section

nsExec::Exec '"$EXEDIR\file1.exe"'
nsExec::Exec '"$EXEDIR\file2.exe"'

SectionEnd
vendorgsm is offline   Reply With Quote
Old 5th March 2009, 14:30   #4
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
I'm not sure just nsExec will work to run simultaneously (which is what you originally asked, correct?)

And there's nothing unique about actually running an app under Vista. Where you might have problems there is with folder and registry re-direction and permission issues (both usually a direct result of UAC.)

If you're looking for Vista-related problems/solutions, just search the forum for 'Vista' and you'll see quite a bit of info.
Comperio is offline   Reply With Quote
Old 6th March 2009, 13:13   #5
vendorgsm
Junior Member
 
Join Date: Mar 2009
Location: Romania
Posts: 3
Hello,

The script below run fine on Windows XP and also on Vista (tested with Vista Business) but when I try it on Vista Business installed on an HTC Shift which is only 800 MHz processor with 1GB RAM, I found that there is a problem because only one process running and the second remain residen on memory or not run.

I think that I should find a way to add a pause in order to have the second EXE running at few seconds after the first one was started.

I think that ExeTimeout will kill the started process when the time expired and ExeWait will wait for the EXE to end before run the second EXE but the EXE's need to stay active so that's why I preffered Exec but nobody confirm me if is the best option or if there is any other recommended method. If you have this please just let me know an example.

This is the script I use now:

Name "FileName"
OutFile "OutFile.exe"
Icon "icon.ico"

SilentInstall silent
RequestExecutionLevel user
SetCompressor /SOLID LZMA
CRCCheck On

Section

nsExec::Exec '"$EXEDIR\file1.exe"'
nsExec::Exec '"$EXEDIR\file2.exe"'

SectionEnd




Thanks!
vendorgsm is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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