tags:

views:

774

answers:

10

I know of a lot of programs that once installed (or an update to the registry) they need something to refresh the values. This can be done by killing and restarting explorer.exe, however most of them do not do this and rather ask you to restart your computer. A process that takes a long time.

I'm currently writing a tool that will be used by technical people only, and it makes some changes to the registry that needs a reboot (or restart explorer.exe) to take effect. I don't have to worry about my users being freaked out by explorer.exe restarting on them so that's not an issue.

What else should I consider before doing this? Why do the other applications tell you to reboot instead of the faster, restart explorer? Is there a security reason? Or is it just habit?

+3  A: 

It is possible that other changes have been made that require more than a restart of explorer.exe. Also as you said, restarting explorer.exe can be quite alarming for end-users.

Andrew Hare
But if programs commonly did that after an installation, it would stop alarming them. Although I do believe I've had one installer do that to me and I freaked out. But then I switched to linux and then all manner of odd things can happen ;)
Malfist
It would stop alarming them the same way rebooting after installation no longer alarms anyone. It went from alarming to annoying...
Shog9
+5  A: 

I've seen problems with icons in the notification area not showing up after explorer has restarted (usually after it stops responding and I have to kill it).

Depending on the notification icon, this could cause the user problems.

crashmstr
A: 

Restarting explorer has the unfortunate side-effect of scrapping the user's current environment. Things like task bar buttons, pending operations, and the like will all be lost if you simply kill explorer.exe.

Ron Warholic
Care to expand on this?
Malfist
They won't be lost.Their invisible property will be set to true until you start explorer.exe again.
John
right, which will be less than a second after explorer is killed.
Malfist
A: 

Why not let the user choose whether to to reboot or restart explorer.

Remember though that the average user won't know what that means or entails so make sure your users really are 'technical enough'.

geoff
it's an internal tool so that's not a concern.
Malfist
+3  A: 

The explorer can have unsaved state (open windows, folder view settings, etc) which are lost if it suddenly restarts). I'd hate it if an installer would kill my explorer.exe without asking and I'm not sure I would think it an improvement over just rebooting.

On the list of things that are not handled by restarting the explorer.exe are especially replacing DLLs which are currently in use and programs (beyond the explorer.exe) that do not listen to the registry change events but hold information from there.

David Schmitt
+1  A: 

Is it always explorer that needs to be restarted?

I had an app once that installed a performance monitor counter that should have been shared by my app and Perfmon (when it was running) so installing it should be just to make sure either app was closed. Simples... except for a driver (can't remember which one or I'd name n shame the manufacturer) that loaded every perfmon object dll and kept them all locked. As a result, my app required a reboot.

Now, if you have a tool that can determine which processes have which of your to-be-installed files locked, and offer to close them though the user must get to decide, one of those processes might be important to Windows (eg workstation service, or a svchost) or important to the user (eg Word with a day's worth of unsaved work)(that's probably a bad example).

gbjbaanb
To be honest, if the have a whole day of work in a word document and haven't saved it once, they deserve to lose it :D (not serious)
Malfist
+11  A: 

Killing and restarting explorer is not going to do everything that a restart of the system will do:

1) Any currently running application will not get refreshed.

2) This can lead to stability problems on the system, as well. I've, in particular, noticed problems with my graphics driver not getting updated correctly after an explorer shutdown/restart.

3) It just kind of smells ;) Killing a process as part of an install just seems nasty.

Reed Copsey
in the tool, the registry key being changed is the autorun key, and the autorun key only. Other things should be effected.
Malfist
If it's just the autorun key, there's no need to restart explorer - just start the process yourself. :)
Reed Copsey
It's so when we do things with multiple cd's we can make sure auto run is enabled. That's the way I'd do it, it's less invasive to the users computer, but...I'm not the boss
Malfist
Wow... Enabling autorun after i've gone to the trouble of disabling it is ANOTHER annoying thing that installers do. Maybe i've got a reason for not wanting automatic execution of *anything* when i insert a disc?
Shog9
@Shog9, agreed.
Malfist
+1  A: 

Use the reboot option instead of refreshing explorer.exe. It's expected already, most software installs on Windows use a reboot so users are accustomed to rebooting when installing software and it gives them a chance to close down any other windows and save data. Secondly, as already pointed out, rebooting explorer.exe blanks your current screen without warning and makes it appear as though something has gone wrong and all their information is lost.

+1  A: 

There are quite a few things that get done in the registry for installed things that occur at next reboot; for example, entries under the "RunOnce" key get run, well, once, at the next boot. There are a lot of installation applications that have dependency upon this behavior; and because Microsoft hasn't deprecated the functionality or found a good workaround, people keep writing software the expects this functionality and depends upon it.

McWafflestix
+5  A: 

Rebooting Windows is a very well-tested operation. Log out/in is too. You can expect all third-party software has been tested through a restart, and almost all has been tested through log out, log in.

How much of it do you think is tested through kill & respawn explorer.exe? Probably nowhere near as much, and certainly nowhere near as thoroughly.

So, if you're distributing internally, to a very well-controlled environment, sure, go ahead and kill & respawn explorer.exe. But don't do it otherwise, as you're putting the user's machine into a very poorly tested state, and things may mysteriously break until (s)he reboots.

derobert
I agree. I think that outright killing explorer.exe is just asking for trouble.
17 of 26