Howdy,
I'm wondering if anyone else has seen this, and if so, how did you get around it?
When uninstalling the user gets a warning dialog if there are locked files because the app is running. They can select a "Reboot" option that causes all the locked files to be marked for deletion on the next reboot. After you reboot, all the files are removed but the empty folder is left behind...
Is there any way to have that folder removed as well?
Thanks,
disco
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Uninstall on Reboot
Started by
discomonger
, May 06 2002 17:49
7 replies to this topic
Posted 06 May 2002 - 18:13
Was this a folder that your install created? Because otherwise it wouldn't even be in the uninstall routines.
However, locked files are a special and this could probably be handle with some work on your end.
You probably need to add the default OnFileLocked event and modify it to set a global variable or registry entry indicating such a file was encountered during the uninstall.
Now that you have this information is available, you'll need to add the default OnRebooted event and, in a case such as this, have it remove the folder once those files have been successfully deleted.
Hope it helps.
However, locked files are a special and this could probably be handle with some work on your end.
You probably need to add the default OnFileLocked event and modify it to set a global variable or registry entry indicating such a file was encountered during the uninstall.
Now that you have this information is available, you'll need to add the default OnRebooted event and, in a case such as this, have it remove the folder once those files have been successfully deleted.
Hope it helps.
Posted 06 May 2002 - 19:22
Hmm, well now I'm a bit confused.
I added OnReboot to my script and added the folder delete and the removal of some registry entries to the function. When I reboot after uninstall the folder is removed now (yay! but the registry entries are still there. Strange...
Thanks for the OnReboot suggestion though, it does seem to have solved some of my problems.
disco
I added OnReboot to my script and added the folder delete and the removal of some registry entries to the function. When I reboot after uninstall the folder is removed now (yay! but the registry entries are still there. Strange...
Thanks for the OnReboot suggestion though, it does seem to have solved some of my problems.
disco
Posted 06 May 2002 - 20:03
Okay, now I'm super confused. Looks like the folder removal is only happening on my Win2k box. Tried it on Windows Me and the empty folder is still there after reboot, along with the reg entries...
Sigh.
So now I'm not sure the OnRebooted thing is getting called at all. Is it possible that telling the uninstall to remove a file on reboot doesn't trigger the OnRebooted action?
disco
Sigh.
So now I'm not sure the OnRebooted thing is getting called at all. Is it possible that telling the uninstall to remove a file on reboot doesn't trigger the OnRebooted action?
disco
Posted 06 May 2002 - 22:04
I would think that the OnRebooted event would still be called.
However, for starters, how about displaying some debug message boxes in that code to know if things are actually running as you might expect.
You should also see the return values on those registry entries.
However, for starters, how about displaying some debug message boxes in that code to know if things are actually running as you might expect.
You should also see the return values on those registry entries.
Posted 07 May 2002 - 19:46
I added some debugging messages as you suggested and it is definitely not calling the OnRebooted function. I am displaying the SdFinishReboot dialog at the end of the uninstall if there is a reboot needed. Regardless of whether the user chooses to reboot then or reboot later, the OnRebooted function never happens.
Posted 08 May 2002 - 14:27
Humm, well in that case, you could probably add yourself to the RunOnce area of the registry along with an additional command line argument (i.e. -cleanup) to let you know of such being the case. However, that's assuming your supporting (uninstall) files are still intact and haven't already been removed by the uninstall.
However, I'm really not sure of a good solution because whatever you use to do the cleanup (i.e. your setup, a batch file, etc.) will need to kill itself afterwards and most things aren't allowed to commit suicide. Basically due to the same locked file problem that you originally ran into. Otherwise you'll have those program files lying around afterwards.
That being said, I'd say you're better off with a leftover empty directory, but that's just MHO. Good luck.
However, I'm really not sure of a good solution because whatever you use to do the cleanup (i.e. your setup, a batch file, etc.) will need to kill itself afterwards and most things aren't allowed to commit suicide. Basically due to the same locked file problem that you originally ran into. Otherwise you'll have those program files lying around afterwards.
That being said, I'd say you're better off with a leftover empty directory, but that's just MHO. Good luck.