Running different .msi package and triggering the maintenance mode - Advanced Installer Community
anotheraiuser
Posts: 3
Joined: Thu Jul 04, 2024 10:13 am

Running different .msi package and triggering the maintenance mode

So assume I have installed a product having a product code as "xyz".

When I run the same .msi package again, I get the Maintenance Mode dialogue which gives me the option to either Modify, Repair or Remove the product.

Now when I use a another .msi package having the same product code "xyz", I get the error:
Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Programs and Features in the Control Panel.

So is there anyway to trigger the Maintenance Mode through the second .msi and perform the operations from there or is there any way to bypass this error?

The second .msi is identical to the first .msi in every way except that it is rebuilt.
Catalin
Posts: 7849
Joined: Wed Jun 13, 2018 7:49 am

Re: Running different .msi package and triggering the maintenance mode

Hello,

What you are seeing happens because the PackageCode is changed once you rebuild the project.
PackageCode
This is not to be confused with the ProductCode property. Although it is a GUID, the package code is not a property referring to a version of your product. It is more specific than that, meaning it refers to the particular .msi file generated. A new PackageCode is generated each time you build your project. Think of the PackageCode as some sort of checksum. No two .msi files should ever have the same PackageCode unless they are identical.

A common instance in which the PackageCode can be seen in action is when your product has already been installed on the machine. Suppose the user would then double-click the installer again. Windows Installer will check the installer's ProductCode to see if the product has been installed on the machine. Since it was, Windows Installer will find it and then check the PackageCode of the installed product. One of two things can happen:

should the PackageCode found be identical with the PackageCode of the installer double-clicked by the user, Windows Installer will run the installer in maintenance mode and the user will then be presented with choices to alter the installed product, repair it or remove it (done through the MaintenanceTypeDlg).
should the PackageCode found be different than the PackageCode of the installer double-clicked by the user, Windows Installer will display the error mentioned in this article's "ProductCode" section.
The PackageCode property is NOT stored within the .aip project file. It is instead generated each time you rebuild your project.
That being said, it is not possible to achieve what you want as this goes against the default behavior of Windows Installer.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”