[wix-users] Cannot update the currently installed product to a newer version (the third version component is changed)

Edwin Castro egcastr at gmail.com
Mon Apr 27 16:41:53 PDT 2020


The behavior doesn't change when you remove the <MajorUpgrade> element
because you did not implement a major upgrade.

https://docs.microsoft.com/en-us/windows/win32/msi/patching-and-upgrades
clearly
states that you implemented a minor upgrade which means you are bound by
the restrictions for minor upgrades. The Windows Installer engine doesn't
allow you to install a new version of the same product (defined as both
versions having the same ProductCode).

The <MajorUpgrade> element adds the required rows in the Upgrade table to
detect and upgrade the related product as the ProductCode is different in
the new version.

I would recommend that you do not equate what the Windows Installer engine
calls major upgrade, minor upgrade, and small update with version changes
in your product. As a concrete example https://semver.org/ has rules on
when you should change the major, minor, and patch version components of
your product, files, etc *but* those are version numbers and have nothing
to do with the different types of update mechanisms supported by the
Windows Installer engine. You could use something like https://semver.org/ to
decide how to change ProductVersion but the update mechanism should likely
be major upgrade unless you have a good reason to use a different update
mechanism.

Jacob is spot on. You should aim to update your MSI products using major
upgrades (both ProductCode and ProductVersion change) as that provides the
greatest amount of flexibility when upgrading. You can use minor upgrades
and small updates if you really want but there are more restrictions and
you must adhere to the component rules very carefully! There are some
changes that are just not allowed in minor upgrades and small updates that
are allowed in major upgrades.

If you are installing a huge DVD's worth of bits then using minor upgrades
and small updates to update portions of the system likely makes sense
because releasing a huge DVD just to apply a small security fix or release
some new features/components as defined by the Windows Installer. The
Windows Installer doesn't care about your product's functionality. If
you're installing a relatively small piece of software, then always using
major upgrades to update your software makes it easier to manage because
you can _almost_ ignore the component rules. You have the largest amount of
flexibility in your upgrades! Additionally, you have the benefit of always
knowing the collection of components deployed on systems because they are
all upgraded together. Configuration management veterans dislike changing
entire systems because back in the day upgrading systems was incredibly
error prone. Today, we get much more benefit from upgrading everything
together because we can ensure the customer has exactly what was tested!
What is easier to support? The small subset of configurations you actually
tested? OR the near infinite combination of configurations that can occur
when you allow small portions of your system to be upgraded separately?
Allowing fine grained updates means that each customer will have near
unique configurations that were never actually tested together. That is a
support nightmare. Always try to keep things simple as long as possible.
Only complicate matters when you absolutely have to. And if somebody else
is dictating matters to you, then know your technology well enough to argue
why the proposed approach is not a good one.

--
Edwin G. Castro


On Mon, Apr 27, 2020 at 1:21 PM Tigran Galoyan via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> Thanks for the tip! My case is definitely a minor upgrade. However, based
> on the MS docs, I clearly change the package code (controlled through the
> *) and product version. And not necessarily I need to do patch install,
> since by following the document, I couldn't see that request. But even in
> that case if I remove the whole MajorUpgrade element from my main wxs file
> I still get that error. Am I missing anything here? Or in other words, is
> there a way to do minor upgrade, without using patch install or
> uninstall/install order?
>
> On Mon, Apr 27, 2020 at 3:54 PM Hoover, Jacob <Jacob.Hoover at greenheck.com>
> wrote:
>
> > https://docs.microsoft.com/en-us/windows/win32/msi/minor-upgrades
> >
> >
> >
> > If you want a minor upgrade, then you have to deal with servicing those
> > existing installs by generating a patch (or forcing an
> > uninstall/reinstall). Major upgrades are much easier to manage.
> >
> >
> >
> >
> >
> >
> >
> > *From:* Tigran Galoyan [mailto:tigran.galoyan at gmail.com]
> > *Sent:* Monday, April 27, 2020 2:45 PM
> > *To:* Hoover, Jacob <Jacob.Hoover at greenheck.com>
> > *Cc:* WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
> > *Subject:* Re: [wix-users] Cannot update the currently installed product
> > to a newer version (the third version component is changed)
> >
> >
> >
> > Hi Jacob,
> >
> >
> >
> > But I don't change the Major or minor versions, those stay "1.10". I
> > change only the 3rd and 4th. The forth is ignored anyways, but the 3rd
> > changes. So once we have a major upgrade we will bump up the first
> > component of the version from 1 to 2 and we'll also change the Product
> Id,
> > but for now we don;t need it. However, we should still be able to upgrade
> > the product having the 3rd component increased.
> >
> >
> >
> > Thanks,
> >
> > Tigran
> >
> >
> >
> > On Mon, Apr 27, 2020 at 3:23 PM Hoover, Jacob <
> Jacob.Hoover at greenheck.com>
> > wrote:
> >
> >
> >
> https://docs.microsoft.com/en-us/windows/win32/msi/changing-the-product-code
> >
> >
> >
> > If you want a MajorUpgrade, you need to change the product code.
> >
> >
> >
> > *From:* wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] *On
> > Behalf Of *Tigran Galoyan via wix-users
> > *Sent:* Monday, April 27, 2020 2:19 PM
> > *To:* WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
> > *Cc:* Tigran Galoyan <tigran.galoyan at gmail.com>
> > *Subject:* [wix-users] Cannot update the currently installed product to a
> > newer version (the third version component is changed)
> >
> >
> >
> > Hi,
> >
> > I have installed my product version e.g. 1.10.1511.2574 and now when I
> try
> > to install version 1.10.1525.0722 of the same product it gives an error
> > "another version of this product is already installed installation of
> this
> > version cannot continue ...".
> >
> > My Product Id and UpgradeCode attributes have constant GUID values. The
> > Package Id attribute has * value for auto generation.
> >
> > Without MajorUpgrade element declaration I get that error when installing
> > the next version.
> >
> > When adding the MajorUpgrade with the following attributes and values I
> get
> > the same error.
> >
> > <MajorUpgrade AllowSameVersionUpgrades="no" AllowDowngrades="no"
> > DowngradeErrorMessage="A newer version of [ProductName] is already
> > installed."
> > Disallow="yes" DisallowUpgradeErrorMessage="An older
> > version of [ProductName] is already installed. Uninstall it first." />
> >
> > When changing the AllowSameVersionUpgrades attribute value to YES I still
> > get the same error.
> >
> > <MajorUpgrade AllowSameVersionUpgrades="yes" AllowDowngrades="no"
> > DowngradeErrorMessage="A newer version of [ProductName] is already
> > installed."
> > Disallow="yes" DisallowUpgradeErrorMessage="An older
> > version of [ProductName] is already installed. Uninstall it first." />
> >
> > The description of AllowSameVersionUpgrades clearly indicates that MSI
> > ignores the forth version component, but in my case the existing 3rd
> > component is 1511 and for the new one it's 1525, so it increased, why
> would
> > it then doesn't allow me to upgrade?
> >
> > Thanks for the support.
> >
> > Best,
> > Tigran
> >
> > ____________________________________________________________________
> > WiX Toolset Users Mailing List provided by FireGiant
> > http://www.firegiant.com/
> >
> > NOTE: This email was received from an external source. Please use caution
> > when opening links or attachments in the message.
> >
> > NOTE: This email was received from an external source. Please use caution
> > when opening links or attachments in the message.
> >
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-users mailing list