Search code examples
visual-studio-2010installationcustom-action

windows installer custom action install & uninstall both called when upgrade


Excel AddIn, VS2010, C#, Windows Installer

VS2010, Setup project, RemovePreviousVersion: True, DetectNewerInstalledVersion: True, InstallAllUsers:True

I have some install, uninstall codes in Custom Action

When I do a upgrade install, I notice, install is called first, which installs newer version, and then uninstall is called, which uninstalls the newer version. The end result is not-working AddIn left.

If I do a new install (i.e. no earlier version of AddIn), then only install is called and addin installs successfully

Installer used to work fine when I built it in VS2008, and I just converted projects to VS2010 and then the issue comes up.

Anyone know why ? thanks


Solution

  • I already answered in comment under my question. Now answer it explicitly for convenience in search.

    I edited my MSI-file in Orca resequenced RemoveExistingProducts right after InstallInitialize (sequence number 1501). This was found in the InstallExecuteSequence table. This was originally sequence number 6550.

    Pls refer Web setup project removes files after upgrade from VS2008 to VS2010