views:

933

answers:

1

Upgrades work fine if no components have changed, but any time a component changes the upgrade fails and it requires the user to manually uninstall and reinstall.

Some snippets:

<Product Id="*" Name="My Application" Language="1033" Version="!(bind.FileVersion.ClientEXE)" Manufacturer="My Company" UpgradeCode="MYGUID-b94a-44eb-8e92-9286f1d89bbd">
    <Package Id="*" Description="My Installer" Comments="Copyright My Company 2008" InstallerVersion="200" Compressed="yes" />
    <Upgrade Id="MYGUID-b94a-44eb-8e92-9286f1d89bbd">
      <UpgradeVersion Language="1033" Property="UPGRADEFOUND" Minimum="0.0.0.0" Maximum="99.99.99.99" IncludeMinimum="yes" IncludeMaximum="yes" />
    </Upgrade>


    <InstallExecuteSequence>
          <RemoveExistingProducts Before="InstallInitialize" />
    </InstallExecuteSequence>

Also, have some issue with the following registry key sometimes not removing on uninstall and I don't understand why:

      <Component Id="InstalledRegistry" Guid="SOMEGUID-0a17-4c6b-983d-8f3feb3a7724">
        <RegistryKey Id="InstalledRegKey" Root="HKMU" Key="SOFTWARE\MyCompany\Client" Action="createAndRemoveOnUninstall">
          <RegistryValue Name="Version" Type="string" Value="!(bind.FileVersion.ClientEXE)" KeyPath="yes"/>
        </RegistryKey>
      </Component>

That's what the bootstrapper checks to know whether to launch msiexec with "REINSTALL=ALL REINSTALLMODE=vamus" or not, so if it was uninstalled but the registry key didn't get removed setup would try to do an upgrade and fail silently.

Let me know if any more information is needed


Edit: There was some other issue afterwards with only some files being updated. Changed RemoveExistingProducts to After="InstallValidate" and that resolved that. Makes it a little slower since it fully removes the previous install instead of just upgrading files that changed (which it didn't seem to detect properly for me) but it gets the job done.

+2  A: 

FWIW, you don't need any commandline arguments to perform a major upgrade.

The code looks ok to me, so might it be that the Version number is not changed? (keeping in mind that Windows Installer only cares about the three first parts if you are using a 4-part version number)

mostlytech
I see, so REINSTALL=ALL and REINSTALLMODE aren't required for major upgrade. I think that may be the problem. Will accept after I verify
Davy8