Skip to content

Prevent old version of PowerShell MSI from installing over newer versions #5834

Description

Instructions are here
https://msdn.microsoft.com/en-us/library/windows/desktop/aa370840(v=vs.85).aspx

Update: per Christoph Bergmeister (@bergmeister) , the msi already prevents downgrades.

We should also consider if we need to block downgrade to prerelease versions.

Activity

  1. bergmeister commented on Jan 9, 2018

    @bergmeister
    Contributor

    Travis Plunk (@TravisEz13) Should be as easy as (taken from official WiX documentation here)
    <MajorUpgrade DowngradeErrorMessage="A later version of $(var.ProductName) is already installed. Setup will now exit.">

  2. bergmeister commented on Jan 11, 2018

    @bergmeister
    Contributor

    Travis Plunk (@TravisEz13) I just built a couple of test MSIs and when trying to install a version that is older by either a digit in the minor or patch version, one already gets the following out of the box:
    image
    Unless we want to customise the message as per my above comment, I think we can close this one. WDYT?

  3. TravisEz13 commented on Jan 11, 2018

    @TravisEz13
    MemberAuthor

    sounds good.

  4. TravisEz13 commented on Jan 11, 2018

    @TravisEz13
    MemberAuthor

    Do we want to enable preventing downgrades to preview releases?

  5. bergmeister commented on Jan 11, 2018

    @bergmeister
    Contributor

    I personally do not see the need/value of that, therefore it's up to you.

  6. iSazonov commented on Jan 12, 2018

    @iSazonov
    Collaborator

    We get this for preview versions automatically if we add the feature in master branch. I see no problems - we can install previews side-by-side from zip distributives in any time.

  7. TravisEz13 commented on Jan 12, 2018

    @TravisEz13
    MemberAuthor

    The problem is the version is the same between previews and the final version. So downgrades from the final to preview is allowed. We would have to do something like adding a 4th place to the version which we increment at release.

  8. iSazonov commented on Jan 13, 2018

    @iSazonov
    Collaborator

    I believe we could increment 1th, 2nd or/and 3rd places at releases and use 4th place for daily preview builds. But the 4th (revision) is only in Version type, SemVer hasn't a revision place. It seems we need a map of the types.

    Maybe we better use GitVersion?
    I think the tool can help to resolve many version problems, e.g #5846 by alpha/beta channels /cc Steve Lee (@SteveL-MSFT)

  9. TravisEz13 commented on Jan 15, 2018

    @TravisEz13
    MemberAuthor

    I think we would update the 4th only for the milestone preview builds, but otherwise it shoulds correct.

  10. iSazonov commented on Jan 16, 2018

    @iSazonov
    Collaborator

    Implementation of 4th will require a lot of work.
    The use of 4th looks too difficult for the modern servicing model we use.
    I reread GitVersion docs and believe we could do the following way:

    1. Turn on auto increment PATCH per commit in 6.0.0 master branch.
    2. At the release time manually create release branch with 6.1.0 version and switch to 6.1.x version in master branch with again auto increment PATCH per commit.

    Or we could make odd versions as development versions:

    1. Switch to 6.1.x version and turn on auto increment PATCH per commit.
    2. At the release time manually create release branch with 6.2.0 version and switch to 6.3.x version in master branch with auto increment PATCH per commit.

    It seems such model resolve all problems with upgrades and simplified release process.

    Update: I think we should consider to switch from GitHubFlow to GitFlow

  11. TravisEz13 commented on Jan 17, 2018

    @TravisEz13
    MemberAuthor

    Using the third digit during previews is not needed. I don't believe there is a good reason to capture the information we are putting in the 4th digit in the SemVer. I'd rather just live with the downgrade issue or manually change the 3rd digit before release.

    Or, make the odd versions the development versions.

  12. 2 remaining items

  13. iSazonov commented on Jan 18, 2018

    @iSazonov
    Collaborator

    Ah, do you suggest not to increase 4th every prerelease?

  14. TravisEz13 commented on Jan 20, 2018

    @TravisEz13
    MemberAuthor

    I wouldn't. As you suggest, it would add hidden information that would be confusing. The main goal is to prevent people from downgrading from the release build to a pre-release build, without a warning.

  15. iSazonov commented on Jan 20, 2018

    @iSazonov
    Collaborator

    From Christoph Bergmeister (@bergmeister) link above:

    Increment the Version value in your Product element to be higher than any previous versions that you have shipped. Windows Installer only uses the first 3 parts of the version in upgrade scenarios, so make sure to increment your version such that one of the first 3 parts is higher than any previously shipped version. For example, if your version 1 uses Version value 1.0.1.0, then version 2 should have a Version value of 1.0.2.0 or higher (1.0.1.1 will not work here).

    We skip that MSI don't support 4th part.

  16. iSazonov commented on Jan 20, 2018

    @iSazonov
    Collaborator
  17. iSazonov commented on Jan 20, 2018

    @iSazonov
    Collaborator

    I think we need to use the experience of other teams:
    https://github.com/stuartleeks/dotnet-cli/blob/master/Documentation/cli-installation-scenarios.md#channels
    https://support.google.com/chromebook/answer/1086915

    If we use channels, we do not need to worry about their conflicts - ordinary users will only use the product channel, testers and developers will use either the beta channel or the development channel. Those who want to combine versions of different channels can use AppImages.

    As for the version numbering, we need to go back to my comment above.

  18. TravisEz13 commented on Jan 22, 2018

    @TravisEz13
    MemberAuthor

    It seems you are suggesting we can close this.

  19. SteveL-MSFT commented on Jan 24, 2018

    @SteveL-MSFT
    Member

    I don't think it's worth the effort to prevent downgrades to prerelease versions.

  20. iSazonov commented on Jan 24, 2018

    @iSazonov
    Collaborator

    Should we fix this for release versions? (Disable downgrade for release versions)

    Also what do you think about using the channels and branches - release, beta, develop?

  21. SteveL-MSFT commented on Jan 24, 2018

    @SteveL-MSFT
    Member

    I don't know if we should disable downgrade for release versions. If someone installs 6.1 and we made a mistake introducing a regression, they may want to roll back to 6.0 until we fix it in a newer version.

    I believe we discussed having multiple branches for stable vs experimental, but decided against it unless there's a real need for it.

  22. iSazonov commented on Jan 24, 2018

    @iSazonov
    Collaborator

    they may want to roll back to 6.0 until we fix it in a newer version

    They'll to have first uninstall new version and only then install previous. This protects against silent downgrade.

    but decided against it unless there's a real need for it

    Was it internal discussion? In recent days I'm looking at the CoreFX model - it seems more flexible and consume less resources after we have the release and we need the servicing.

  23. TravisEz13 commented on Jan 24, 2018

    @TravisEz13
    MemberAuthor

    Per Christoph Bergmeister (@bergmeister) Downgrade for release versions is already blocked. #5834 (comment)

  24. iSazonov commented on Jan 24, 2018

    @iSazonov
    Collaborator

    Yes, I skipped that this is enabled by default.

  25. TravisEz13 commented on Jan 26, 2018

    @TravisEz13
    MemberAuthor

    I checked and WiX does what the article says by default. I think the property mentioned only changes the error.

  26. bergmeister commented on Jan 26, 2018

    @bergmeister
    Contributor

    Yes, the property is only a customisation of the error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugWG-Maintainers-Buildspecific to affecting the build

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions