Old 6th May 2002, 16:05   #1
bmatzelle1
Junior Member
 
Join Date: May 2002
Location: Philadelphia, PA
Posts: 4
Hiding ExecWait windows

My installer uses ExecWait quite a bit and some of the programs that it executes take a lot of time to execute, thus the console window sits in the foreground for long periods of time. Is there a possiblity that one of the following things could be added to the installer to make ExecWait a little cleaner:

* Hide the console window
* Minimize the console or place it behind the installer window
* Fire up a nice message box with a message that explains to the user what it is doing during the wait like "Starting MySQL Daemon ..."

Warm regards,

Brent

By the way, this issue has been brought up before with no results: http://forums.winamp.com/showthread....threadid=77705
bmatzelle1 is offline   Reply With Quote
Old 6th May 2002, 17:28   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
What you can do is excute the program with Exec and not ExecWait and then find its window with FindWindow. Then you should call BringToFront to bring the installer back to front, show some install options dialog that says installing whatever or just printing it in the details, and finally enter into a loop waiting for the window to close (using FindWindow and waiting for it to return zero).

To just hide it you can create a shortcut for it and execute it with ExecWait.

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 7th May 2002, 02:03   #3
bmatzelle1
Junior Member
 
Join Date: May 2002
Location: Philadelphia, PA
Posts: 4
I tried your solution but it still is unsatisfactory. To the user the console still flashes to screen before going to the background and the installer seems like it is frozen (to an ordinary user) while the command is running. I believe that the solution to this problem will require some enhancements to the ExecWait code base.

Justin, could you please look into this, or point me in the right direction so I can add something like this myself?

Thanks and warm regards,

Brent
bmatzelle1 is offline   Reply With Quote
Old 7th May 2002, 14:58   #4
rainwater
Senior Member
 
Join Date: Aug 2000
Posts: 397
Send a message via ICQ to rainwater
If you are running DOS commands, you need to create a dll extension to execute the program and pump the output to the program and not to a console window.
rainwater is offline   Reply With Quote
Old 7th May 2002, 15:05   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
[edit]rainwater's idea seems better than mine [/edit]

How aobut this:

PHP Code:
DetailPrint "Executing whatever, please hold..."
SetDetailsPrint none
GetTempFileName $R1
StrCpy $R1 
"$R1.lnk"
CreateShortcut $R1 "whatever dos command you want" "paramaters" "" "" SW_SHOWMINIMIZED
Exec $R1
loop
:
   
Sleep 200
   FindWindow $R2 
"ConsoleWindowClass" "window name"
   
NOTEMake sure it is the same class name in Win9x too
   StrCmp $R2 
"0" 0 loop
Delete $R1
SetDetailsPrint both
DetailPrint 
"Done!" 
If you still don't like it, you can always write your own DLL that creats a new thread which displays some message box and then destroy the thread when the operation is done.

KiCHiK

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius

Last edited by kichik; 7th May 2002 at 17:02.
kichik is offline   Reply With Quote
Old 7th May 2002, 18:19   #6
bmatzelle1
Junior Member
 
Join Date: May 2002
Location: Philadelphia, PA
Posts: 4
Create an extension every time I want to prevent a console window from showing up? There has to be a better way.

Brent
bmatzelle1 is offline   Reply With Quote
Old 7th May 2002, 18:27   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
If you want it just to hide use my code, if you want a more elegant solution use rainwater's solution.
BTW you won't have to create an extension for every console window, just one that will get the message to display and the command to run using the stack.

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 23rd November 2007, 21:22   #8
Fightin_Foo
Junior Member
 
Join Date: Nov 2007
Location: Ohio
Posts: 49
Send a message via AIM to Fightin_Foo
I am in a similiar situation, did you ever get the problem solved bmatzelle1? Can anyone tell me how or point me to a place that says how to create the dll like rainwater suggested?

From there to here,
from here to there,
funny things
are everywhere.

Dr. Seuss
"One Fish Two Fish Red Fish Blue Fish"
Fightin_Foo is offline   Reply With Quote
Old 23rd November 2007, 21:29   #9
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Use nsExec.

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 23rd November 2007, 21:44   #10
Fightin_Foo
Junior Member
 
Join Date: Nov 2007
Location: Ohio
Posts: 49
Send a message via AIM to Fightin_Foo
I've tried to use nsExec before, but it seems that it gives no indication that the script has been run. Did it display something and I just missed it?

From there to here,
from here to there,
funny things
are everywhere.

Dr. Seuss
"One Fish Two Fish Red Fish Blue Fish"
Fightin_Foo is offline   Reply With Quote
Old 23rd November 2007, 22:44   #11
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
No, it doesn't display anything. That's the whole point - it hides the command window. See Docs\nsExec and Examples\nsExec for more details on what it returns to the script.

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 21st December 2007, 06:18   #12
pospec
Senior Member
 
pospec's Avatar
 
Join Date: Jun 2007
Location: Otrokovice, Czech Republic
Posts: 308
Is there a way to display ExecWait's "DOS Box" (console) output in installation details? I know that I can redirect output to file like "hello.exe > hello.txt" and then display that .txt. Any other way? Thank you.
pospec is offline   Reply With Quote
Old 21st December 2007, 08:43   #13
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
nsExec::ExecToLog.

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 21st December 2007, 09:26   #14
pospec
Senior Member
 
pospec's Avatar
 
Join Date: Jun 2007
Location: Otrokovice, Czech Republic
Posts: 308
Yay! :-) Thank you very much!
pospec 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