Thread: Upgrading by double-clicking the .msi

Upgrading by double-clicking the .msi

From
Heikki Linnakangas
Date:
Upgrading the driver by double-clicking the new .msi file doesn't work:

  "Another version of this product is already installed."

That's why we include the upgrade.bat file, which uses the right flags
to msiexec to force reinstallation over the old version. But that's not
very user-friendly.

To fix that, we need to use the Windows Installer "major upgrade"
feature. Browsing the web on this subject, most people seem to recommend
treating every upgrade as a major upgrade, because that's the simplest
method. Dealing with Minor or Small upgrades properly would require much
more work, while a major upgrade just removes the old installation and
installs the new one. For a small product like psqlODBC, that works fine.

I'm following the WiX tutorial at
http://wixtoolset.org/documentation/manual/v3/howtos/updates/major_upgrade.html
on how to do that. Fortunately we already include an UpgradeCode and
ProductId.

So all we need to do is to add a MajorUpgrade tag to the .wxs file:

     <MajorUpgrade
    Schedule="afterInstallInitialize"
    DowngradeErrorMessage="A later version of the driver is already
installed. Setup will now exit.">

And whenever we ship a new version, we must update the product code.

Any objections? We'll need to somehow automate the generation of product
codes. I'll try to figure out how to do that with MSBuild.

Once we do that, we should stop shipping upgrade.bat. At the downloads
website, I think we should just provide the plain .msi file, and not zip
it anymore. (the MM and DLL binaries would be unchanged)

- Heikki


Re: Upgrading by double-clicking the .msi

From
Marco Gaiarin
Date:
Mandi! Heikki Linnakangas
  In chel di` si favelave...

> That's why we include the upgrade.bat file, which uses the right
> flags to msiexec to force reinstallation over the old version. But
> that's not very user-friendly.

...and for my experience, even not working every time... i'm installing
psqlodbc via WPKG (http://wpkg.org/), and it is at least an year that,
roughly, i uninstall the old version and install the new one, for the
sake of safety.

I've not understood if, with your proposal, the new installer take care
of uninstalling the old one, or simply stop to run and ask to do
that manually.

--
dott. Marco Gaiarin                        GNUPG Key ID: 240A3D66
  Associazione ``La Nostra Famiglia''                    http://www.sv.lnf.it/
  Polo FVG   -   Via della Bontà, 7 - 33078   -   San Vito al Tagliamento (PN)
  marco.gaiarin(at)lanostrafamiglia.it   t +39-0434-842711   f +39-0434-842797

        Dona il 5 PER MILLE a LA NOSTRA FAMIGLIA!
       http://www.lanostrafamiglia.it/chi_siamo/5xmille.php
    (cf 00307430132, categoria ONLUS oppure RICERCA SANITARIA)


Re: Upgrading by double-clicking the .msi

From
Craig Ringer
Date:
On 06/24/2014 04:49 PM, Heikki Linnakangas wrote:
> Upgrading the driver by double-clicking the new .msi file doesn't work:

...

> To fix that, we need to use the Windows Installer "major upgrade"
> feature.

...

> Any objections?


Sounds great to me. I was quite struck by the odd use of "upgrade.bat"
when I first started looking closely at psqlODBC.

Among other nice things, doing what you suggest should keep the registry
entries pointing to the correct things.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Re: Upgrading by double-clicking the .msi

From
Heikki Linnakangas
Date:
On 06/25/2014 07:25 AM, Craig Ringer wrote:
> Among other nice things, doing what you suggest should keep the registry
> entries pointing to the correct things.

Oh, has there been a problem with that?

- Heikki



Re: Upgrading by double-clicking the .msi

From
Dave Page
Date:
On Tue, Jun 24, 2014 at 9:49 AM, Heikki Linnakangas
<hlinnakangas@vmware.com> wrote:
> Upgrading the driver by double-clicking the new .msi file doesn't work:
>
>  "Another version of this product is already installed."
>
> That's why we include the upgrade.bat file, which uses the right flags to
> msiexec to force reinstallation over the old version. But that's not very
> user-friendly.
>
> To fix that, we need to use the Windows Installer "major upgrade" feature.
> Browsing the web on this subject, most people seem to recommend treating
> every upgrade as a major upgrade, because that's the simplest method.
> Dealing with Minor or Small upgrades properly would require much more work,
> while a major upgrade just removes the old installation and installs the new
> one. For a small product like psqlODBC, that works fine.
>
> I'm following the WiX tutorial at
> http://wixtoolset.org/documentation/manual/v3/howtos/updates/major_upgrade.html
> on how to do that. Fortunately we already include an UpgradeCode and
> ProductId.
>
> So all we need to do is to add a MajorUpgrade tag to the .wxs file:
>
>     <MajorUpgrade
>         Schedule="afterInstallInitialize"
>         DowngradeErrorMessage="A later version of the driver is already
> installed. Setup will now exit.">
>
> And whenever we ship a new version, we must update the product code.
>
> Any objections? We'll need to somehow automate the generation of product
> codes. I'll try to figure out how to do that with MSBuild.

There was a good reason why that was done originally, but I forget the
details (Magnus may well remember). I vaguely recall that it was to do
with having the ability to have major versions installed side-by-side,
but that may be a hangover from when the installer code originally
came from the old PostgreSQL MSI packages where that was essential
(with psqlODBC, I'm not even sure it'll work, as the driver names are
not currently versions as far as I'm aware).


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: Upgrading by double-clicking the .msi

From
Craig Ringer
Date:
On 06/25/2014 03:47 PM, Heikki Linnakangas wrote:
>
> Oh, has there been a problem with that?

The pgxalib.dll entries don't seem to get updated by the installer. It
hasn't been a problem because pgxalib.dll doesn't really change.

I haven't looked into it properly, just noticed it in passing. It may be
fixed by the recent changes to add the registry key at install time.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services