Reputation: 5765
Sometimes it's necessary to modify Windows registry settings during an application install. I've recently been frustrated by applications that don't restore these settings when they are uninstalled. As I thought more about this, it occurs to me that there may not be a good (or valid) way to save and restore registry settings. Take the following sequence of events for example:
.abc
..abc
.At step 3, if Application A is smart enough, it will detect that it no longer owns the Open action and will therefore skip any attempt to restore it.
At step 4, is there any valid action that Application B can take?
This is only one of many bad situations that I can envision where there is no obvious one-and-only "correct" solution. My next project will require registry changes during install, and I'd like to know the best or recommended practice for the uninstall. Unfortunately, I've been burned by bad uninstall practices in current commercial packages, so I'm aware that there's no consensus on best practice here, and it's either a lot of work to do it right, or else a design flaw in the Registry, or both.
This is a very real programming problem for me. I'm tagging it Subjective because I'm not sure there's any one-size-fits-all right answer to this. Please feel free to disagree.
Upvotes: 0
Views: 267
Reputation: 400174
If you're writing Application B, then I'd say don't hijack the Open action for the .abc extension in the first place. During install, ask the user if he wants to associate .abc files with your program. During uninstall, check if your program is still associated. If so, disassociate the file extension, otherwise leave it alone.
If there's another application that wants to still be associated with .abc files after you uninstall B, tough - make the user fix it. After all, he consented to associate .abc files with your application and then uninstalled your application.
Upvotes: 1