Hello. Just so that I have said it: You should have a really good reason for doing this. I can't say I can imagine why you shouldn't ask the user to remove the program with add/remove programs.
Still, if it is urgent, here goes:
You would need to find the program by searching registry in the folders directly under
1) Search for name matching the application to remove in regkey:"DisplayName" If you find it 2a) Open a "Process" specified by regkey:"UninstallString" 2b) On successful completion: Remove the registry key (the folder containing the two values)
Remember: your program will most likely need the same priveleges you need for doing this manually (with add/remove programs).
No garanties given (you might destroy your users installation, at least in their point of view).
Hello. Just so that I have said it: You should have a really good reason for doing this. I can't say I can imagine why you shouldn't ask the user to remove the program with add/remove programs.
Still, if it is urgent, here goes:
You would need to find the program by searching registry in the folders directly under
1) Search for name matching the application to remove in regkey:"DisplayName" If you find it 2a) Open a "Process" specified by regkey:"UninstallString" 2b) On successful completion: Remove the registry key (the folder containing the two values)
Remember: your program will most likely need the same priveleges you need for doing this manually (with add/remove programs).
No garanties given (you might destroy your users installation, at least in their point of view).