How to prevent an installer.MSI Force to uninstall?

If I create a setup in format .msi and install it on another pc the first time, fine, but if I make some simple change (compile a .exe and put it in the .msi replacing the previous one), and install it on the pc where it had already been installed, a message comes out saying that it is necessary to uninstall,

To top it off the message does not help or say how or allow to do the uninstall automatically, the end user (sometimes very inexperienced) should look for how to uninstall and after uninstalling look for the setup.msi and install it.

The message it says is:

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 add or Remove Programs from the control panel.

In English:

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 Add/Remove Programs on the Control Panel.

A little tedious.

This not only happens with the .msi i generate, it has happened to others, so I think it is something inherent in the msi system.

What I would like is for a setup.msi to simply be installed and if there is already something installed that crushes and nothing else.

What is the best way for a setup.msi to reinstall without saying anything about uninstall?

 5
Author: Carlos Muñoz, 2016-01-17

2 answers

When an installer is created it is assigned a Guid that identifies it and is entered in the windows registry, but I'm mistaken it should be here

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall [ProductId GUID]

The installer assigns a product GUID that identifies it, when running for the first time the GUID is registered in the registry, a next one will validate that that guid is already present and show the dialog uninstall.

For a continuous installation you should regenerate the product guid every time you compile a new msi, although be careful because if you then check the option "Add or Remove Programs", you will surely see repeated the item of the MSI installer.


For example if you use Wix to create installers you can configure it

How to: Generate a GUID

If you use Visual Studio by creating a "setup Project" you can change the ProductCode

Updates to setup projects

Although I wonder, Did you not analyze if the creation of the msi allows to create upgrades? I raise it because I work with Visual Studio and this includes an integrated version of InstallShield that allows you to define updates, perhaps it is the way you should evaluate.

Doing Upgrades with InstallShield le

 1
Author: Leandro Tuttini, 2016-01-18 02:15:18

Dear, to do what you want to do, if it is in Visual Studio, you have to change within your installer properties, where it says: "RemovePreviousVersions", give it True, this allows the previous version to be uninstalled before installing it, in the same process.

Greetings!

 1
Author: Eduardo Constancio, 2016-05-31 13:20:29