Uninstall the existing version and install the msi setting.

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

Can anyone help me check the installed application on the machine and uninstall it before installing my new msi.

+3


source to share


1 answer


You can do this by configuring the MSI properties correctly. Click on Installer Project and click F4to view the MSI Properties window.

enter image description here



  • When you go to properties, you will see two types of properties Upgrade code

    and Product Code

    . Every time you create / release a new installer package, be sure to keep the same upgrade code, but change the Product Code.

  • Change the property DetectNewerInstalledVersions

    to true

    .

  • Install RemovePreviousVersions

    in true

    .

  • Now change the number version

    to a higher version from the previous version, if your previous release version is 1.0.2, change the new version to 1.0.3.

When you install MSI with the above parameters, MSI will check if any other product with the same update code is installed, if it find the product, then it will check if the newer version has a higher version. If all conditions are met, it will first uninstall the existing (older) version and install the newer version.

+10


source







All Articles