I am writing an installer for my web app and I struggle with the uninstaller part. Despite the fact that I created a custom action on Uninstall in my Application Setup Project, the InstallerClass is set to true, the method:
public override void Uninstall(IDictionary savedState)
{
//MessageBox.Show("Attach debugger!", "Viper.Setup");
Cleanup();
base.Uninstall(savedState);
}
on the installer class doesn't seem to be called. Any ideas what could be the reason?
EDIT: I also noticed that it not only doesn't run the Installer, but also doesn't delete my main dll file. To make it worse, when I install a new version after uninstalling the previous one, this dll is still the old one (even though installation and uninstallation were successful)
Did you include the output of your installer code in the Code Actions tab of the installer?
If that's not it...
I ran into a similar problem in the past and found I needed all 4 methods defined or the uninstall would not run. Add your code to the template below:
[RunInstaller(true)]
public class MyInstaller: Installer
{
public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
}
public override void Commit(IDictionary savedState)
{
base.Commit(savedState);
}
public override void Rollback(IDictionary savedState)
{
base.Rollback(savedState);
}
public override void Uninstall(IDictionary savedState)
{
base.Uninstall(savedState);
}
}
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With