MSI build - Downgradable options

Elanchezhiyan P 100 Reputation points
2023-12-05T11:20:32.1+00:00

I'm trying to downgrade the MSI build when we switch over the versions in the API. For e.g. We have installed the MSI build with the version 2.0 in the windows machine. I have to downgrade the version for some reasons and I'm updating the API with 1.0. Can the MSI build be downgraded to 1.0 version with Autoupdate?

I know that only manual installation allows this process to downgrade. Also, if the higher version is installed, we will be getting error when we try to uninstall the lower version. (Attached the image for reference)
User's image

Do we have any possibilities to install lower version through auto update process?

Community Center | Not monitored
{count} votes

1 answer

Sort by: Most helpful
  1. RLWA32 49,636 Reputation points
    2023-12-07T09:36:42.41+00:00

    A Visual Studio Installer project has two properties that control the content of the Upgrade table contained in the generated MSI file. They are -

    UpgradeTableProps

    You can generate an MSI that does not check for newer versions by setting DetectNewerInstalledVersion to "False". Consequently, the Upgrade table will not include an entry for that test.

    In my test to create an MSI that will downgrade from 2.0 to 1.0 I created an MSI for the 1.0 version that set DetectNewerInstalledVersion to "False" and RemovePreviousVersions to "True". Then I used Orca to edit the Upgrade Table so that it appeared as follows -

    DowngradeTable

    Testing with the generated MSI demonstrated that the 2.0 version of the executable remained in the application folder after downgrade. Other unversioned items were properly downgraded.

    To work around Windows not replacing a 2.0 version with a 1.0 version of a versioned binary it was necessary to add an additional property to the Property table. The property was REINSTALLMODE and the value was "amus" as seen below.

    PropTable

    These edits allowed a successful downgrade from 2.0 to 1.0.

    Consider carefully and test thoroughly the effect of the REINSTALLMODE edit. Depending on what your MSI does It has the potential of replacing deployed content with older versions even though you may not intend for that to happen. Refer to REINSTALLMODE property and also to this MSDN blog post Aaron Stebner's WebLog.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.