I have a wix installer which was recently updated to version 5(wix3 to wix5). I have a bundle for bootstrapping and 2 msi package installed using it. During first Installation, it works as expected. But during an update(for eg; v3.1.1.1 to v3.2.1.1) the installer executes the installation flow once again after the action RemoveExistingProducts.
Action start 14:25:12: RemoveExistingProducts.
RemoveExistingProducts: Application: {EE053203-AE7C-788E-5C50-1B0302020000}, Command line: UPGRADINGPRODUCTCODE={EE053203-AE7C-788E-5C50-1B0303020000} CLIENTPROCESSID=24664 CLIENTUILEVEL=0 MSICLIENTUSESEXTERNALUI=1 REMOVE=ALL
MSI (s) (A0:28) [14:25:12:734]: Resetting cached policy values
MSI (s) (A0:28) [14:25:12:734]: Machine policy value 'Debug' is 0
MSI (s) (A0:28) [14:25:12:734]: ******* RunEngine:
******* Product: {EE053203-AE7C-788E-5C50-1B0302020000}
******* Action:
******* CommandLine: **********
MSI (s) (A0:28) [14:25:12:737]: Note: 1: 2265 2: 3: -2147287035
MSI (s) (A0:28) [14:25:12:737]: MSCOREE not loaded loading copy from system32
MSI (s) (A0:28) [14:25:12:739]: End dialog not enabled
MSI (s) (A0:28) [14:25:12:739]: Original package ==> C:\windows\Installer\1522708.msi
MSI (s) (A0:28) [14:25:12:739]: Package we're running from ==> C:\windows\Installer\1522708.msi
MSI (s) (A0:28) [14:25:12:740]: APPCOMPAT: Uninstall Flags override found.
MSI (s) (A0:28) [14:25:12:740]: APPCOMPAT: Uninstall VersionNT override found.
MSI (s) (A0:28) [14:25:12:740]: APPCOMPAT: Uninstall ServicePackLevel override found.
MSI (s) (A0:28) [14:25:12:740]: APPCOMPAT: looking for appcompat database entry with ProductCode '{EE053203-AE7C-788E-5C50-1B0302020000}'.
MSI (s) (A0:28) [14:25:12:740]: APPCOMPAT: no matching ProductCode found in database.
MSI (s) (A0:28) [14:25:12:742]: Machine policy value 'DisablePatch' is 0
MSI (s) (A0:28) [14:25:12:742]: Machine policy value 'AllowLockdownPatch' is 0
MSI (s) (A0:28) [14:25:12:742]: Machine policy value 'DisableLUAPatching' is 0
MSI (s) (A0:28) [14:25:12:742]: Machine policy value 'DisableFlyWeightPatching' is 0
MSI (s) (A0:28) [14:25:12:742]: APPCOMPAT: looking for appcompat database entry with ProductCode '{EE053203-AE7C-788E-5C50-1B0302020000}'.
MSI (s) (A0:28) [14:25:12:742]: APPCOMPAT: no matching ProductCode found in database.
MSI (s) (A0:28) [14:25:12:742]: Transforms are not secure.
MSI (s) (A0:28) [14:25:12:743]: Command Line: UPGRADINGPRODUCTCODE={EE053203-AE7C-788E-5C50-1B0303020000} CLIENTPROCESSID=24664 CLIENTUILEVEL=0 MSICLIENTUSESEXTERNALUI=1 REMOVE=ALL
MSI (s) (A0:28) [14:25:12:743]: PROPERTY CHANGE: Adding PackageCode property. Its value is '{E56904AE-EC09-40A1-A6FB-D76D812EAB1D}'.
MSI (s) (A0:28) [14:25:12:743]: Product Code passed to Engine.Initialize: '{EE053203-AE7C-788E-5C50-1B0302020000}'
MSI (s) (A0:28) [14:25:12:743]: Product Code from property table before transforms: '{EE053203-AE7C-788E-5C50-1B0302020000}'
MSI (s) (A0:28) [14:25:12:743]: Product Code from property table after transforms: '{EE053203-AE7C-788E-5C50-1B0302020000}'
MSI (s) (A0:28) [14:25:12:743]: Product registered: entering maintenance mode
MSI (s) (A0:28) [14:25:12:743]: Determined that existing product (either this product or the product being upgraded with a patch) is installed per-machine.
MSI (s) (A0:28) [14:25:12:743]: MSI_LUA: Nested installation UAC elevation tracks that of parent (is not elevated)
MSI (s) (A0:28) [14:25:12:743]: Product {EE053203-AE7C-788E-5C50-1B0302020000} is admin assigned: LocalSystem owns the publish key.
MSI (s) (A0:28) [14:25:12:743]: Product {EE053203-AE7C-788E-5C50-1B0302020000} is managed.
MSI (s) (A0:28) [14:25:12:743]: MSI_LUA: Credential prompt not required, user is an admin
MSI (s) (A0:28) [14:25:12:743]: PROPERTY CHANGE: Adding ProductState property. Its value is '5'.
Full Log
Shown below is my upgrade elements used.
<MajorUpgrade DowngradeErrorMessage="!(loc.DOWNGRADEERRORMESSAGE)"
AllowSameVersionUpgrades="yes" Schedule="afterInstallFinalize"/>
<Upgrade Id="$(var.ProductUpgradeCode)">
<UpgradeVersion OnlyDetect="no" Minimum="1.0.0" Property="WIX_UPGRADE_DETECTED" IncludeMinimum="yes" />
</Upgrade>
Custom actions and install executions sequene is also attached below.
<CustomAction Id="CA_VerifyConnection" Return="check" Execute="immediate"
DllEntry="VerifyConnection" BinaryRef="Askion.Data.Setup.CA.dll" />
<CustomAction Id="CA_ReadConnectionSettings" Return="check" Execute="immediate"
DllEntry="ReadConnectionSettings" BinaryRef="Askion.Data.Setup.CA.dll" />
<CustomAction Id="CA_ExtractDatabase" Return="check" Execute="immediate"
DllEntry="ExtractDatabase" BinaryRef="Askion.Data.Setup.CA.dll" />
<CustomAction Id="CA_CreateOrUpdateDatabase_SetCustomActionData" Property="CA_CreateOrUpdateDatabase"
Value="PRODUCTDIR=[PRODUCTDIR];CONFIG_FILE=[CONFIG_FILE];TEMPSETUPDB=[TEMPSETUPDB];BACKUPUSERDB=[BACKUPUSERDB];BACKUP_DATABASE=[BACKUP_DATABASE];DBBACKUP_USER_FULLPATH=[DBBACKUP_USER_FULLPATH]" />
<CustomAction Id="CA_CreateOrUpdateDatabase" Return="check" Execute="deferred" DllEntry="CreateOrUpdateDatabase" BinaryRef="Askion.Data.Setup.CA.dll" />
<CustomAction Id="BrowseFile" DllEntry="BrowseSQLFile" Return="check" Execute="immediate" BinaryRef="Askion.Data.Setup.CA.dll" />
<SetProperty After="FindRelatedProducts" Id="FirstInstall" Value="true" Condition="NOT Installed AND NOT WIX_UPGRADE_DETECTED AND NOT WIX_DOWNGRADE_DETECTED" />
<SetProperty After="SetFirstInstall" Id="Uninstalling" Value="true" Condition="Installed AND (REMOVE="ALL") AND NOT (WIX_UPGRADE_DETECTED OR UPGRADINGPRODUCTCODE)" />
<InstallExecuteSequence>
<Custom Action="CA_ExtractDatabase"
Before="ProcessComponents"
Condition="Uninstalling <> "true"" />
<Custom Action="CA_ReadConnectionSettings"
Before="ProcessComponents"
Condition="FirstInstall <> "true"AND Uninstalling <> "true"" />
<Custom Action="CA_CreateOrUpdateDatabase_SetCustomActionData"
Before="CA_CreateOrUpdateDatabase"
Condition="Uninstalling <> "true"" />
<Custom Action="CA_CreateOrUpdateDatabase"
Before="CreateShortcuts"
Condition="Uninstalling <> "true"" />
</InstallExecuteSequence>
I have tried changing the Schedule of RemoveExistingProducts but the results were not apt. Also i cannot schedule it early(like before InstallValidate) , since i need access to some files from the previous installation during the CustomAction stages.
Attached is the bundle chain call of this msi;
<MsiPackage Id="CCServer" bal:DisplayInternalUICondition="WixBundleAction = 6" SourceFile="$(var.Setup.CCServer.TargetDir)\$(var.Setup.CCServer.TargetFileName)"
Vital="no" Permanent ="yes" />