|
|
#1 |
|
Junior Member
Join Date: Apr 2004
Posts: 19
|
close windows Explorer
How do I close all the Windows Explorer on init?
I looked at this link but it's for IE browser. http://nsis.sourceforge.net/archive/...instances=0,11 |
|
|
|
|
|
#2 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
The whole Windows desktop is based on explorer, that isn't something you should close.
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Apr 2004
Posts: 19
|
ok i guess i have to find other way.
How do you ignore the error and then go to the next line. This is to put the file blah.dll into the folder but the dll is currently used which is in the Windows Explorer. since i can't close the explorer. Error opening file for writing: "C:\blah\blah.dll" Hit abore to abort installation, retry, ignore... |
|
|
|
|
|
#4 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
You'll have to use /REBOOTOK and let the user reboot the computer.
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Apr 2004
Location: Finland
Posts: 4
|
I would write a VB6 .exe, and use the FindFindow and SendMessage APIs.
(first, find a explorer window based on name with findwindow. then send the window a WM_CLOSE integer) I've used this with VB6, but those APIs are available to other languages as well. Hmm, after a second thought you can't find the windows based on window titles since it may be the folder name as well ![]() Well you could look into some windows APIs and write an exe to be included in the installer to do the job. EDIT: VB6 code that could work. You could find the open windows based on classname, instead of title. code: |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Apr 2004
Location: Finland
Posts: 4
|
wcloser.exe
Here, it just seemed too easy :P
You may use it from command line, i.e. run: wcloser.exe ExploreWClass .. to close all explorer windows. Also has a GUI to test it. http://lappi.skai.fi/~mikkoko/vbmodu...ndowCloser.zip |
|
|
|
|
|
#7 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
First of all explorer.exe should not be closed because it is the whole Windows desktop. It also doesn't have a window title.
The same thing can also be done using NSIS script code without VB6. When using a VB6 executable your installer will have to include the VB6 runtimes, which is a bit overkill for such a simple thing. |
|
|
|
|
|
#8 | ||
|
Junior Member
Join Date: Apr 2004
Location: Finland
Posts: 4
|
vb6
Quote:
Quote:
I'm using nsis mostly for vb6 installers so the runtimes for wcloser aren't a big problem since the runtimes are already installed when I run it :P |
||
|
|
|
|
|
#9 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
NSIS has a FindWindow and SendMessage command.
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|