wintergreen53
30th June 2009 14:57 UTC
Uninstaller Issues
Hi all,
I'm having a very strange problem with the uninstaller. Here's the flow of the problem:
1) User installs program
2) User uninstalls program, doesn't reboot
3) User installs program again
4) User reboots system.
When the system starts up again the application files the uninstaller was supposed to delete get deleted. Unfortunately, the files it deletes are the newly installed ones! Is there any way to prevent this from happening?
Thanks!
Afrow UK
30th June 2009 16:18 UTC
If HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations value exists then you can prompt the user to reboot first.
Stu
wintergreen53
2nd July 2009 19:36 UTC
But my application isn't the only thing that can write to that key from what I understand, checking for it's existence wouldn't solve my issue completely.
Is there a way I can parse the registry string to see if it contains the file I'm looking for?
Afrow UK
6th July 2009 14:27 UTC
Only installations should ever write to that registry key in theory, but if you really have to check the values I'm sure you can loop through the entries using EnumRegValue. I cannot remember the format off the top of my head.
Stu
thek
6th July 2009 15:32 UTC
What about controlling it manually?
the uninstaller could create a file or regkey if he has to reboot. This flag can be checked by the installer (and reset if not needed any more).
Afrow UK
6th July 2009 16:25 UTC
But then you'd need to delete the registry value after the reboot (maybe another executable run via RunOnce).
Stu