0
votes

I have InstallShield product - setup.exe. This setup.exe is actually a bootstrapper of some kind that install a file called product.msi. I have the UpgradeCode of this product.msi thingy. So I should be able to make a Wix installer with MajorUpgrade element. But, it does not works - not all files are getting installed. Here is the link to the log.

Here are some suspect lines from the log:

MSI (s) (2C:F4) [22:47:19:663]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 2911 
DEBUG: Error 2911:  Could not remove the folder C:\Config.Msi\.
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2911. The arguments are: C:\Config.Msi\, , 
MSI (s) (2C:F4) [22:47:19:667]: Note: 1: 2318 2:  

Here are the relevant parts of the wxs file:

<Product Id="*" Codepage="1252" Language="1033" Manufacturer="Intel Corporation"
           Name="TenLira" UpgradeCode="$(var.UpgradeCode)" Version="$(var.Version)">

    <Package Comments="Contact: Refael Sheinker, [email protected]." Description="TenLira"
             InstallerVersion="500"
             Compressed="yes"
             InstallPrivileges="elevated"
             InstallScope="perMachine"
             Keywords="Installer,MSI,Database" Languages="1033" Manufacturer="Intel Corporation" Platform="x64" />

    <Property Id="REINSTALLMODE" Value="amos" />
    <Property Id="REBOOT" Value="ReallySuppress" />

    <Media Id="1" Cabinet="my_application.cab" EmbedCab="yes" />

    <MajorUpgrade AllowDowngrades="no"
                  AllowSameVersionUpgrades="yes"
                  Disallow="no"
                  IgnoreRemoveFailure="no"
                  MigrateFeatures="yes"
                  Schedule="afterInstallFinalize"
                  DowngradeErrorMessage="A later version of [ProductName] is already installed" />

Please advise. Thanks. Refael.

2

2 Answers

1
votes

When using the default MajorUpgrade element configuration you will default to uninstalling older product versions entirely before your new version is installed during a major upgrade. In technical terms: the positioning of RemoveExistingProduct changes in the InstallExecuteSequence (it is moved from after InstallFinalize to before InstallInitialize) - I verified that this indeed happens when you change the MajorUpgrade element to its default and most simple format - like you did).

Uninstalling early during a major upgrade will help eliminate any errors caused by faulty component references in the two setups. Such faulty component referencing can typically cause files to be missing after upgrades, or files have not been overwritten as expected (the latter is a larger issue relating to the dangerous REINSTALLMODE setting which affects file versioning rules). I will update this tomorrow with more details - I wrote a long answer that is too messy to post now.

For the record, your value for REINSTALLMODE (amos), appears to not be a valid parameter for REINSTALLMODE. Some people use amus to force overwrite files, but amos is simply incorrect parameters (letters a and o are in conflict - they define different behavior for the same thing). Using amus can cause a number of highly undesirable side-effects that I will try to explain tomorrow if I get the time.

0
votes

Ok, ehhh... I don't know why, but changing the MajorUpgrade element to the following:

<MajorUpgrade DowngradeErrorMessage="A later version of [ProductName] is already installed" />

Solves the problem.