Uninstall?

  • Thread starter Thread starter Julie
  • Start date Start date
J

Julie

Is there any class in .Net that handles uninstallation of an installed application?

Something that takes the add/remove program name, and then looks up the
appropriate command line in the registry and then calls the uninstaller?

System.Configuration.Install.Installer does *not* seem to do what I want, as
far as I can tell anyway.

Anything in the framework that handles this? If not, any source out there that
accomplishes this?

Thanks
 
Julie,

Just my 2 cents but why would you want to code something like that when you
can build a nice looking professional install with installshield or
something like it and it automatically takes care of the unstall portion for
you.

glenn
 
Julie,

There is nothing in the framework that does this.

What you can do is use the classes in the System.Management namespace to
get the instance of the Win32_Product WMI class that corresponds to the
program, and then call the Uninstall method on that, and it should uninstall
the product.

Hope this helps.
 
glenn said:
Julie,

Just my 2 cents but why would you want to code something like that when you
can build a nice looking professional install with installshield or
something like it and it automatically takes care of the unstall portion for
you.

*Something* has to call that 'automatic uninstall portion', and that is what
I'm after.

In short, I want to uninstall an application from my application, using the
application's uninstall command string (stored in the registry).

It would be nice if there was a simple way to get that registry string in .Net,
but it doesn't look to me like there is...
 
Nicholas said:
Julie,

There is nothing in the framework that does this.

What you can do is use the classes in the System.Management namespace to
get the instance of the Win32_Product WMI class that corresponds to the
program, and then call the Uninstall method on that, and it should uninstall
the product.

Hope this helps.

I looked into that, but never found any information on Win32_Product and
related methods. Do you have any sample code that demonstrates how to locate
the product and then call the uninstall method?

Thanks
 
Back
Top