user786981
user786981

Reputation:

Windows Installer : Changing installation policy during upgrade causing duplicate copies of application

I am facing a problem with Windows Installer's installation policy. If I install application using any of these options per user/per machine(Just Me/ Everyone) and then install an upgraded version with different option then the installer does not detect the earlier version and does not uninstall earlier version, which leads to duplicate entries of same application in control panel as well. Why my installer does not detect existing installation if installation policy is changed? Is there any way to trick installer to uninstall earlier version correctly? I found a similar article here but this does not solve my issue.

Upvotes: 2

Views: 146

Answers (1)

Christopher Painter
Christopher Painter

Reputation: 55601

The process you are referring to is called a "Major Upgrade". During this process, Windows Installer installs a new version and uninstalls the previous version ( the order depends on where you schedule a standard action called RemoveExistingProducts ) within a single transaction.

Per MSDN, Major Upgrades cannot change the context (per-user -> per-machine or per-machine -> per-user )

Note If an application is installed in the per-user installation context, any major upgrade to the application must also be performed using the per-user context. If an application is installed in the per-machine installation context, any major upgrade to the application must also be performed using the per-machine context. The Windows Installer will not install major upgrades across installation context.

You must first uninstall the per-user installation ( in all profiles it may exist ) and then install the per-machine installation. This is one of the reasons per-user installs are not normally a best practice. They are difficult to service.

Upvotes: 2

Related Questions