Uninstall programmatically

ALX

Well-known member
Joined
Nov 16, 2005
Messages
253
Location
Columbia, SC
Programming Experience
10+
Under certain conditions where, say maybe the user has corrupted files or Registry Key/Values in the process of trying to bypass a free trial period, or maybe just accidently deleted some data files, it would probably be a lot easier to prompt the user to perform a completely new installation rather than trying to figure out exactly what has been screwed up and attempting to repair it. I'm thinking that I'd like to be able to "Uninstall" the application "programmatically" rather than asking the user to uninstall the app in the usual way through the "Control Panel". This is mostly because I'll need to run a small clean-up utility AFTER the uninstall to remove all traces of the previous installation which would prevent a new free trial from being installed. The code I've found online is in C#. I'd like to stay with VB if possible. It seems that I need to loop through the Registry Keys in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" until I find the entry with the correct Display Name to get the Uninstall string. 'Not too sure exactly how to do that... Alternately, I guess I could put the clean-up code in the uninstaller... but then I'd need to save a code to disk or to the registry to inform the uninstaller to run the clean-up utility...
' Anybody crossed this bridge before? I could use some advice...
Thanx in advance !
 
Last edited:
I'm thinking that I'd like to be able to "Uninstall" the application "programmatically" rather than asking the user to uninstall the app in the usual way through the "Control Panel". This is mostly because I'll need to run a small clean-up utility AFTER the uninstall to remove all traces of the previous installation which would prevent a new free trial from being installed.
Uninstalling from the Control Panel can do that. That's the sort of thing that Custom Actions are for in Setup projects.
 
Back
Top