3

I made my WIX install option, upgrade so that it removes previous DLLs, However when I go into Control Panel, and go to the Add/Remove Programs section, the previous version is still present.

How do I remove this previous icon from this Add/Remove section?

.....

In response to the comment below Sorry I still cant get this to work, previous versions still show in the Add/Remove Programs section when I upgrade, Here is some code

I did have Id initially to "*" but now I just change Product ID when I make my next build

<Upgrade Id="$(var.UpgradeCode)">
  <UpgradeVersion Minimum="$(var.ProductVersion)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/>
  <UpgradeVersion Minimum="1.0.0"
                  IncludeMinimum="yes"
                  OnlyDetect="no"
                  Maximum="$(var.ProductVersion)"
                  IncludeMaximum="no"
                  Property="PREVIOUSVERSIONSINSTALLED" />
</Upgrade>
TheWommies
  • 4,922
  • 11
  • 61
  • 79
  • 1
    If you have two versions of the same .msi installed, you are have not set the UpgradeCode correct. Read more here. http://blogs.msdn.com/b/johnls/archive/2006/11/13/how-to-upgrade-software-with-a-windows-installer-package.aspx – Morten Frederiksen Oct 24 '11 at 05:38
  • I agree with Morten, although I think you are getting confused between the product ID and the upgrade ID. The upgrade id would have been set in your product element. This is the one you need to use when detecting previous versions. – David Martin Nov 14 '11 at 11:32

1 Answers1

0

The upgrade id must be the same between versions that you want to upgrade. If you want to perform a major upgrade, were you remove previous installations and then install your new version, the property that must change is product id

An "*" causes a new guid to be generated by WIX

You want something like this:

<!--Product -->
<Product Id="*" Name="$(var.Product.Name)" Language="$(var.Product.Lang)" Version="$(var.Product.Version)" Manufacturer="$(var.Product.Manufacturer)" UpgradeCode="{Replace me with a constant Upgrade Guid}">
<Package InstallerVersion="$(var.Package.InstallerVersion)" Compressed="yes" Platform="$(var.Platform)" />   


   <!--Condition Messages-->
    <Condition Message="A newer version of $(var.Product.Name) is already installed. Exiting installation.">
      <![CDATA[Installed OR NOT NEWER_VERSION_FOUND]]>
    </Condition>

<!-- Upgrade Table -->
<Upgrade Id="{Replace me with a constant Upgrade Guid}">

  <UpgradeVersion
    Property="OLD_VERSION_FOUND"
    Minimum="0.0.0.0"
    Maximum="$(var.Product.Version)"
    IncludeMinimum="yes"
    IncludeMaximum="no"
    OnlyDetect="no"
    IgnoreRemoveFailure="yes"
    MigrateFeatures="yes"
    Language="1033"  />

  <UpgradeVersion
    Property="NEWER_VERSION_FOUND"
    Minimum="$(var.Product.Version)"
    IncludeMinimum="no"
    OnlyDetect="yes"
    Language="1033"  />

</Upgrade>

<!--Removes the old version and then installs the new version-->
<InstallExecuteSequence>
  <RemoveExistingProducts After="InstallInitialize"></RemoveExistingProducts>
  <InstallExecute After="RemoveExistingProducts"></InstallExecute>
</InstallExecuteSequence>

You should also note that you cannot switch between per user and per a machine installs between versions.

Sam Plus Plus
  • 4,381
  • 2
  • 21
  • 43