Setup Custom Action Uninstall question

J

Joe Cool

I am using C# with VS2008.

I have an app that uses a Custom Action Install and Uninstall actions
to create and optionally delete some config files.

The Setup project properties specify to remove previous versions if
they exist.

If I manually uninstall the app from the control panel, the Custom
Action Uninstall is invoked.

If the setup automatically removes the previous version, the Custom
Action Uninstall is NOT invoked.

How come?
 
J

Joe Cool

The only authoritative answer would have to come from the VS or .NET team..

But I speculate that installing a new version is simply not considered
an uninstall.  Note that the option is to "remove" previous versions,
not "uninstall" previous versions.

It's a subtle distinction, but from an installation point of view, all
you're really doing is upgrading an existing install.  You're not
uninstalling anything.  Thus, the custom uninstall action isn't invoked..

Also, it seems to me that the more common user desire in the upgrade
scenario is to keep your configuration from the previous install and
other related files.  So in fact, while you could work around the
"issue" by having your custom install action check for old configuration
and remove it before installing new configuration, I'm not sure that'd
really be the best implementation.

I agree with your assessment. Actually, in the Install custom action,
I check to see if the config file already exists and if so, I give the
user the option to replace it or not.
 

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

Top