Jump to content


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.
Photo

Uninstall on Reboot


7 replies to this topic

discomonger

discomonger
  • Members
  • 16 posts

Posted 06 May 2002 - 17:49

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



Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

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.
user posted image

discomonger

discomonger
  • Members
  • 16 posts

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

discomonger

discomonger
  • Members
  • 16 posts

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

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

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.
user posted image

discomonger

discomonger
  • Members
  • 16 posts

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.

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

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.
user posted image

discomonger

discomonger
  • Members
  • 16 posts

Posted 09 May 2002 - 18:22

I totally agree with you.  Now I just have to convince QA...   :)