How do I persuade a VS2005 msi to upgrade?

后端 未结 3 1623
没有蜡笔的小新
没有蜡笔的小新 2021-02-06 10:09

I have a Windows service written in C# using VS2005.

The installation is via a wizard that calls msiexec to install the msi file also created using VS2005.

I am

3条回答
  •  深忆病人
    2021-02-06 10:34

    There are several things that need to be done to get "upgrades" to work with MSI's if you want to automatically remove the previous version.

    First some background information about the mysterious "codes". There are 3 codes (GUID's) associated with an MSI:

    1. Package Code - This identifies a particular version of the MSI installer and should never be reused across builds. It must always be updated.
    2. Product Code - This identifier is used to ID a particular version of the application. It is up to the installer author to decide when to assign a new product code.
    3. Upgrade Code - This identifies the application and should not change through it's lifetime

    The Upgrade Code should never change. For you upgrade scenerio, the Product Code must be changed for each version. Additionally, as you mentioned, you must bump the version number. The Product Code and Upgrade Code can be found by selecting your setup project and going to the Properties Window. The Package Code is hidden in Studio and will always be updated.

    The item you are probably missing, is that you also need to set the RemovePreviousVersions setting in the Properties Window to true.

提交回复
热议问题