[wix-users] Problem with upgrading when format of the ProductVersion changes

Stefan Boros fanelaru at gmail.com
Thu Jul 7 06:11:49 PDT 2016


Hi,

I have the following problem and I'm trying to understand what is
happening. I have this code:
...
<Product Name="My Service"
           Id="*"
           UpgradeCode="$(var.UpgradeCode)"
           Language="$(var.Language)"
           Codepage="$(var.CodePage)"
           Version="$(var.ProductVersion)"
           Manufacturer="$(var.Manufacturer)">

    <Package Id="*"
             Keywords="Installer"
             Description="My Service Installer"
             Comments="Service Installer"
             Manufacturer="$(var.Manufacturer)"
             InstallerVersion="300"
             Languages="$(var.Language)"
             Compressed="yes"
             SummaryCodepage="$(var.CodePage)" />

     <Upgrade Id="$(var.UpgradeCode)">

      <!-- Populate NEWERVERSIONDETECTED if there is an installed
           package with the same upgrade code
           and version is > the version being installed -->
      <UpgradeVersion Minimum="$(var.ProductVersion)"
                      IncludeMinimum="no"
                      OnlyDetect="no"
                      Property="NEWERVERSIONDETECTED" />

      <!-- Populate UPGRADEFOUND if there is an installed
           package with the same upgrade code
           and the version is between the earliest version defined
           and the version being installed -->
      <UpgradeVersion Minimum="$(var.FirstVersion)"
                      IncludeMinimum="yes"
                      Maximum="$(var.ProductVersion)"
                      IncludeMaximum="no"
                      Property="PREVIOUSVERSIONSINSTALLED" />
    </Upgrade>

    <Condition Message="A newer version is already installed.">NOT
NEWERVERSIONDETECTED</Condition>

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

<!-- Step 1: Define the directory structure -->
...
<!-- Step 2: Add files to your installer package -->
...
<!-- Step 3: Tell WiX to install the files -->
...

ProductVersion and FirstVersion has the x.x.x format. Because the msi
contains only 3 files I prefer to uninstall everything and put the new
files in place (like a major upgrade).
Here is what it's happening:
if the FirstVersion is "0.0.1" and I build twice my project (ProductVersion
for first build will be "0.0.2" and for the second one "0.0.3"), when I
install 0.0.3 on top of 0.0.2 everything is going smoothly. In Add/Remove
Programs I see the new version installed, "My Service" is up&running in
Local Services, in Program Files I see my folder containing the new files.

If I change the ProductVersion to 2.0.2 and 2.0.3 (same steps as the
previous ones), when I install 2.0.3 on top of 2.0.2, no error pops-up, the
installation finishes successfully (at least Event Viewer says so) but my
folder in Program Files doesn't exist, My Service is unknown in Local
Services. The only thing looking good is in Add/Remove programs which shows
me the new version 2.0.3 is installed.And another strange thing is the fact
that I can install my application from Add/Remove Programs successfully. No
error!

So why for 0.0.x format as ProductVersion upgrading is working fine, but
not for 2.0.x?

I tried to log the output of msiexec during the upgrading, but it is too
complicated for me.

PS: do not recommend another way of implementing upgrade. I need to stick
to this code because I'm using msitools.

Thanks,
-- Stefan


More information about the wix-users mailing list