View Full Version : Can NSIS hide a command window?
10th March 2003, 06:04
I just found NSIS this weekend, and I love it. I have a strange problem that I was wondering if anyone could figure out. I have .exe files made from Matlab, which are 16 bit .exe's that open a command window then a GUI when executed. All I want to do is have Windows hide this command window. The name changes on different systems and on different calls, but it's always a DOS window, and I know nothing about finding HWNDs and hiding them. Here is NSIS code that at least runs one of these programs (though it still opens up a separate command window):
SetOutPath "c:\Program Files\Foo"
Pretty simple, I'm just wondering if there's a way to use NSIS's FindWindow and HideWindow commands for this extra popup. I tried this in C, and it usually works, but only when I know and enter the correct window title. I like and understand NSIS, and just thought I'd ask some experts :).
10th March 2003, 06:52
I had no idea there's been so much discussion on this before. I had just given up trying to find a solution :). So, now I'm using
SetOutPath "c:\Program Files\foo"
nsExec::Exec "cmd /C foo.exe"
And I only have one question left. I want to make the working directory the program's installation directory (there are 2 exe's here, one for the install program, and this one). I assume this would include:
; Get the install directory created by the installer exe
ReadRegStr HKLM SOFTWARE\Foo "Install_Dir" $x
But I don't know what other steps are needed to make this the working directory for nsExec. And I love NSIS, but I've learned all I can for one weekend and need help :).
Actually, this exe file will be installed in the install directory, so would it automatically start with the correct working directory?
10th March 2003, 10:07
You can use variables in command parameters. As in your example the command should look like
as a global variable. This variable is set if you used the directory page
10th March 2003, 13:18
In version 2.0b2 and above SetOutPath sets the working directory.
13th March 2003, 10:45
I was searching for this thing only but i need my installer to wait to complete the exe and so i am using ExecWait. So can i have any such way to hide the cmd windows that pops out due to this call. This will help me alot. Thanks in advance.
13th March 2003, 12:26
nsExec waits for the program to finish.
14th March 2003, 04:59
Thank u for ur timely help. Thank u all
25th July 2004, 10:20
excuse me, when i type
nsExec::Exec "cmd /C ftp.exe"
where ftp.exe is the défault ftp manager of windows(c:\windows\system32\)
it doesn't work
EDIT : i understand, nsiexe wait for the programm to end but he never end
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.