Programatic uninstall?

  • Thread starter Thread starter Steve Long
  • Start date Start date
S

Steve Long

Hello all,
is there a way to programatically uninstall a program via one of the Windows
Management classes or one of the Win32 classes? I'm looking for a way to
invoke the process that occurs when you click Add or Remove Programs in the
control panel. I have some applications in an install base that I not longer
have the setup.exe file (Installshield express) for. If I had that, I could
just use the command line switches to do it but alas, I don't have a way to
tell which versions are installed.

I'm looking at the Win32_Product class as a possibility but it would be nice
to see an example of how to use the Uninstall method? Anybody???

Thanks in advance for any help.

Steve
 
Hello Steve,

AFAIK, actions which are performed when you click Uninstall button are
stored in the registry, in the
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
section. In here, each subsection lists an installed product;
DisplayName parameter indicates name and UninstallString parameter
indicates the program which is executed if you hit Uninstall. So, you
must be able to use classes in Microsoft.Win32 namespace to extract the
command string and Process.Start() to execute it.

Hope this helps,
Roman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top