Archive: How to run 2 .exe files same time?


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.


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.


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


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.


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!