Reputation: 558
I am creating an msi installer with a basic directory installation and a single post-install custom action. The installer should support reinstall on all version ranges (newer, older, same).
Almost everything is working fine, except for performing a reinstall of an identical msi. When performing an msiexec of the same msi as is currently installed (but possibly other msiexec command line properties), the installer starts and exits but does not do anything and does not show an error in the logs.
Upgrades and downgrades are working fine (when specifying 'AllowDowngrades="yes"'). The reinstall also happens correctly when I build a new msi with the same version as currently installed. I also tried setting the AllowSameVersionUpgrades instead of the AllowDowngrades, but without luck.
Any hints on how my wxs should be configured to allow reinstall of the same msi file? Currently my MajorUpgrade looks like this:
<MajorUpgrade AllowDowngrades="no" AllowSameVersionUpgrades="yes" Disallow="no" DowngradeErrorMessage="Not allowed to downgrade." IgnoreRemoveFailure="yes" MigrateFeatures="yes" />
What I do see in the msiexec output as a difference between a normal reinstall and the same msi install failure; is the start of the installer mentioning 'FindRelatedProducts. Return Value0':
Action 14:12:52: INSTALL.
Action start 14:12:52: INSTALL.
Action 14:12:52: FindRelatedProducts. Searching for related applications
Action start 14:12:52: FindRelatedProducts.
Action ended 14:12:52: FindRelatedProducts. Return value 0.
Action 14:12:52: AppSearch. Searching for installed applications
Action start 14:12:52: AppSearch.
AppSearch: Property: NETFRAMEWORK45, Signature: NetFramework45
Action ended 14:12:52: AppSearch. Return value 1.
Action 14:12:52: LaunchConditions. Evaluating launch conditions
Action start 14:12:52: LaunchConditions.
Action ended 14:12:52: LaunchConditions. Return value 1.
Action 14:12:52: ValidateProductID.
Action start 14:12:52: ValidateProductID.
Action ended 14:12:52: ValidateProductID. Return value 1.
Action 14:12:52: CostInitialize. Computing space requirements
While a successful upgrade/downgrade msiexec log looks like this:
Action 18:27:21: INSTALL.
Action start 18:27:21: INSTALL.
Action 18:27:21: FindRelatedProducts. Searching for related applications
Action start 18:27:21: FindRelatedProducts.
FindRelatedProducts: Found application: {014FD491-292B-4BFC-BCFB-87121C11BCE9}
Action ended 18:27:21: FindRelatedProducts. Return value 1.
Action 18:27:21: AppSearch. Searching for installed applications
Action start 18:27:21: AppSearch.
AppSearch: Property: NETFRAMEWORK45, Signature: NetFramework45
Action ended 18:27:21: AppSearch. Return value 1.
Action 18:27:21: LaunchConditions. Evaluating launch conditions
Action start 18:27:21: LaunchConditions.
Action ended 18:27:21: LaunchConditions. Return value 1.
Action 18:27:21: ValidateProductID.
Action start 18:27:21: ValidateProductID.
Action ended 18:27:21: ValidateProductID. Return value 1.
I am rather new to Wix, so any hints on how to fix this or what I could try are very welcome.
Cheers.
Clarification: I do not want multiple instances of the same msi/program installed at once, however I would like to force a complete reinstall upon executing the same msi again, without manually performing an uninstall first. This to allow reconfiguration of the software through msiexec cli properties and a custom action.
Upvotes: 3
Views: 1545
Reputation: 558
My issue got resolved through the comment from Daniel Lee - thanks for that! The use of msiexec paramters / switches REINSTALL and REINSTALLMODE indeed allow a clean reinstall of the identical msi file, using REINSTALL=all and REINSTALLMODE=a .
Upvotes: 0
Reputation: 20780
The most likely cause of this is that you cannot install the same identical MSI more than once. The product is identified by its ProductCode, and if that product is already installed then there is no "install it again". The installed product will go into maintenance mode, and that is typically a repair (in the absence of the ability to add or remove features).
If you really want (say) 10 identical products installed side-by-side then they each need to be different products (as identified by ProductCode). There are the general issues of multiple identical entries in Programs&Features, possible multiple identical shortcuts, problems with objects that can be used only once (such as service names), and you may need to think about how to maintain multiple products on the same system regarding patching, upgrades and so on.
If your goal is to do an upgrade of the installed product (usually this means you have updated files) then you need a major upgrade, using the MajorUpgrade element. This will install the newer version and automatically uninstall the previous version. However it can only be the "same" MSI if your major upgrade specifies AllowSameVersionUpgrades=yes and you change the ProductCode and PackageCode, so there isn't really a way to reinstall the same MSI - it can have the same files and other content, but it needs new Product and Package code values with the major upgrade.
Upvotes: 1