Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove existing version and install msi setup

I am developing WPF application in C#. Currently my msi install the current application in machine.I need to check any existing version installed and remove the existing version installed in the machine and install the new one.

Can any one help me how to check the installed application in the machine and uninstall that before installation of my new msi.

like image 891
user2725407 Avatar asked Dec 19 '22 09:12

user2725407


1 Answers

You could do it by properly configuring MSI properties. Click on Installer project and press F4 to view MSI's properties window.

enter image description here

  1. When you go to properties you could see two type of properties that are Upgrade code and Product Code. Every Time you create/release a new installer package make sure to keep the same Upgrade code but change the Product Code.

  2. Change DetectNewerInstalledVersions property to true.

  3. Set RemovePreviousVersions to true.

  4. Now Change the version number to a higher version from previous release, if your previous release version was 1.0.2, change the new version to 1.0.3.

When you install a MSI with abovementioned settings, MSI will check if any other product installed with same Upgrade code, if it finds a product then it will check if the new installation has a higher version. If all the conditions are satisfied it will first remove the existing(Older) version and install the newer version.

like image 148
Kurubaran Avatar answered Dec 29 '22 01:12

Kurubaran