Old 22nd December 2004, 05:40   #1
sarathshiva_19
Junior Member
 
Join Date: Dec 2004
Posts: 4
Angry How to run an exe in the background?

Hi,
I need to run an exe in a hidden window. I first tried using exec but it throws up console windows on the screen for each exe I execute. so I tried using ExecShell I am confused with the action argument in the execshell, may I can know what other than "open" and "print" can be used in it to execute an image. One more thing I need to do is, one of the exe's I need to execute should wait for the previous exe execution to be completed, to do this I used ExecWait for the first exe, but I get a popup console window for this, how to avoid this popup.

-sarath.
sarathshiva_19 is offline   Reply With Quote
Old 22nd December 2004, 07:16   #2
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Use one of DOS plug-ins, nsexec (Program files\nsis\contrib\nsexec) or my ExecDos http://forums.winamp.com/showthread....hreadid=201522 , both hide consol window and wait for process end. ExecDos also can give application login/password input.
Takhir is offline   Reply With Quote
Old 22nd December 2004, 10:17   #3
sarathshiva_19
Junior Member
 
Join Date: Dec 2004
Posts: 4
Hi takhir,
Thanks for the reply. It worked. But one thing I am not able to see the progress for each of the exe being executed on the installfiles page.
Any inputs on this is highly appreciated.
--sarath.
sarathshiva_19 is offline   Reply With Quote
Old 22nd December 2004, 12:47   #4
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
I made changes both in ExecDos and nsExec, see attached package (2 dlls). This is not 'live output' (still in NSIS todo list), but 'Executing ...' appears on the instfiles page top.
Attached Files
File Type: zip execdos.zip (10.4 KB, 223 views)
Takhir is offline   Reply With Quote
Old 22nd December 2004, 15:31   #5
sarathshiva_19
Junior Member
 
Join Date: Dec 2004
Posts: 4
I tried both of your dll's, what I exactly wanted was the progress bar movement(the blue bar which moves from 0% to 100% on completion) not the updatation of the strings on the Installfiles page, as I want to hide what is going on beyond the screens and just want to keep the user showing that the system is progressing.
sarathshiva_19 is offline   Reply With Quote
Old 22nd December 2004, 17:04   #6
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Sarath, I understood what you want and wrote in the previous post that 'this is not live output'. But you will need time to do all as you want I see 2 sides of your task.
1. I don't know how NSIS sets progress bar position, may be it simply calculates script line number (and on loops bar looks crazy ), but to make correct progress bar position changes (that is possible from script or plug-in) you must understand this algorithm, finally you should know bar 'borders' for nsExec (or ExecDos) step.
2-nd big question - your DOS application execution step-marks or execution time - also required for bar positioning inside 'borders'. IE often draws download progress bar by timer
Other words - I don't know ready decisions, task is not simple, but possible. You should be ready to spent much time on this (hours or days)
Takhir is offline   Reply With Quote
Old 23rd December 2004, 06:30   #7
sarathshiva_19
Junior Member
 
Join Date: Dec 2004
Posts: 4
Hi Takhir,
Thanks for the messages, lets wait and see if somebody has a readymade solution.

Bbye.
--sarath
sarathshiva_19 is offline   Reply With Quote
Old 23rd December 2004, 13:16   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I doubt anyone already has a solution. This has never been asked before from my knowledge. If it's not on the NSIS Archive Downloads page then I doubt it exists.

-Stu
Afrow UK is offline   Reply With Quote
Old 20th June 2005, 09:07   #9
blue_raptor
Junior Member
 
Join Date: May 2005
Location: Dortmund, Germany
Posts: 15
Send a message via ICQ to blue_raptor
nsExec and execDos both hide the command windows but also wait until the application finishes. is there any solution to hide a window and get the behaviour of the simple "Exec" ?

I want to run two vbs files where the first waits itself for the other one. But if I use nsExec or execDos the first script will never finish!
blue_raptor is offline   Reply With Quote
Old 25th July 2005, 18:16   #10
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Attached ExecDos worked with 2 applications in my test. In /ASYNC mode 'exec' call returns handle to control thread, this parameter helps to get exit code for this application in the 'wait' call (if required). Please find included Multi.nsi sample.
Attached Files
File Type: zip execdos.zip (11.9 KB, 213 views)
Takhir 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