Hi,
I would like my C# program to uninstall our old installation. Is it possible
from C# to do the same think that user does, i.e get the list of installed
applications (similar to Add/Remove programs), select an application, and
command it to uninstall?
I am using Visual Studio 2003, but I can use VS 2005 if necessary.
If this is a wrong newsgroup, please advice where I should post this
question.
Thank you.
Gregory
Dmytro Lapshyn [MVP] - 19 Apr 2006 07:55 GMT
Hi,
This actually depends on whether your old application's installer is
MSI-based. If this is the case, you are lucky 'cause you can P/Invoke to the
MSI API to query for installed applications and then use the same API to
command the target application to uninstall itself.
If you are not that lucky, explore the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
It should list all installed applications with command lines to be run in
order to uninstall them (the UninstallString value).
> Hi,
> I would like my C# program to uninstall our old installation. Is it
[quoted text clipped - 9 lines]
> Thank you.
> Gregory