Post by Ivo BeltchevI had a similar problem but decided not to solve it. I have a shell
extension (http://classicshell.sourceforge.net/) that is installed by an
MSI file (created by a Visual Studio Setup project). During uninstall the
shell extension is in use by Explorer. It will be nice if the uninstaller
(or the installer during upgrade to a new version) can close all Explorer
processes, and relaunch Explorer when the setup is done.
I decided to give up on this because I could not find a good way to
relaunch Explorer from the installer. The installer runs as the SYSTEM
user and can't launch explorer.exe on behalf of the current user.
If somebody has figured out how to do this, I'll be very grateful if you
share :)
It's a bad idea to close Explorer. TaskBar button are out of order, and tray
icons or missing. It's possible to run a program as the logged on user when
running as system(See CreateProcessAsUser), but it still not a good idea to
close Explorer.
Another option is to rename the inuse DLL to something temporary, then
install the replacement DLL. Renaming EXE/DLL while they are is use is
something that is supported in Windows 2000+. You can rename in use
EXE/DLL's, but you can't delete them.
In this case, you rename your DLL to something else, then install the
updated version. The new DLL will be loaded by Explorer the next time it
tries to load the DLL. I am not sure how this works with COM based DLL's
though. See this topic for details:
Dynamic-Link Library Updates
http://msdn.microsoft.com/en-us/library/ms682604(VS.85).aspx
There is also Restart Manager in Vista+:
Restart Manager:
http://msdn.microsoft.com/en-us/library/cc948910(VS.85).aspx