1

I will try to explain the issue by example. I have mypackage-v1.0.msi and mypackage-v1.1.msi. Both packages when installed silently expecting PASSWORD parameter:

msiexec /i mypackage-v1.0.msi /qb PASSWORD=SomeThing1

mypackage-v1.0.msi is already installed and mypackage-v1.1.msi should upgrade mypackage-v1.0.msi. There is a custom action in both packages that depends on this parameter but because of the issue with conditioning this custom action in mypackage-v1.0.msi, during upgrade it is executed but the PASSWORD parameter is not transferred to it.

I wonder if there is a way to patch mypackage-v1.0.msi before upgrading to mypackage-v1.1.msi. But the patch is not changing any contents of installation but the package itself. Is it possible?

Edit: More focused input - is it possible with the patch to replace a condition for InstallExecuteSequence custom actions?Reference to actions displayed in Orca

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
eddyuk
  • 4,110
  • 5
  • 37
  • 65
  • 1
    It is not uncommon for packages to contain errors that cause upgrade problems. [Here are some approaches for dealing with installed packages that cause upgrade or uninstall problems](https://stackoverflow.com/questions/53876550/wix-custom-action-dialogbox-on-silent-uninstall-of-application/53876981#53876981). One option is to use a minor upgrade. These [minor upgrades have many limiations](https://stackoverflow.com/a/51444047/129130), but they allow you to upgrade a product "in-place" rather than uninstall and reinstall (which is what major upgrdes do and trigger problems in the process). – Stein Åsmul May 24 '21 at 00:13
  • Thanks I will look into that. – eddyuk May 24 '21 at 11:20
  • Those approaches are for packages that fail to uninstall, but the use of minor upgrades can generally fix any errors in the installed package's uninstall sequence that manifest on uninstall or upgrade and cause the process to fail. In effect the minor upgrade "hotfixes" the uninstall sequence before it is called or invoked. Only approach 2 should be relevant for you in [the list](https://stackoverflow.com/a/53876981/129130). – Stein Åsmul May 24 '21 at 11:41
  • I edited the question and added more focused question of what I am trying to achieve. – eddyuk May 24 '21 at 11:45
  • Yes, you can change almost anything in the installed package. The simplest sample of a minor upgrade I could find at the moment is probably [this one](https://github.com/rstropek/Samples/tree/master/WiXSamples/Patch). Open the `CreatePatch.cmd` and update path to WiX binaries (likely ending in v3.11 at this point in time). Keep in mind that a minor upgrade has [many limitations](https://stackoverflow.com/a/51444047/129130). Keep things simple and change only what you need to fix your problem. – Stein Åsmul May 24 '21 at 12:28
  • [See what needs to change for a minor upgrade in the table at the bottom here](https://docs.revenera.com/installshield26helplib/helplibrary/MajorMinorSmall.htm) (package code and product version + plus whatever change you want to implement). You can deliver the minor upgrade as a new MSI or as a patch file (*.msp). For an MSI you need to use a special command line to install. Something like this: `msiexec.exe /i MySetup.msi REINSTALLMODE=vomus REINSTALL=ALL`. The `v` there tells msiexec to re-cache the MSI so that it updates the existing cached one "in-place". – Stein Åsmul May 24 '21 at 12:31
  • See below for the above in answer form - too many messy comments. – Stein Åsmul May 24 '21 at 13:12

2 Answers2

0

Yes. Patches include transforms, which modify packages. In fact, patches always modify tables in the package, even when they don't change content of the payload files.

Bob Arnson
  • 21,377
  • 2
  • 40
  • 47
  • I added an explanation to the question of what I am trying to achieve. Will that be possible to do with the patch? – eddyuk May 24 '21 at 11:45
0

The comments above became too messy. Here is a quick re-write as a regular answer:


Minor Upgrade: A minor upgrade can change most things in an installed MSI package before its uninstall or upgrade sequence is called. It can hence fix problems relating to major upgrades or failed uninstalls among other things (you fix the uninstall sequence before it is invoked).

Sample: Here is the simplest sample of a minor upgrade I could find at the moment (another sample from FireGiant's documentation).

  • For the simple sample: open the CreatePatch.cmd and update path to WiX binaries (likely ending in v3.11 at this point in time: set wixDir="C:\Program Files (x86)\WiX Toolset v3.11\bin\").

  • Keep in mind that a minor upgrade has many limitations. Keep things simple and change only what you need to fix your problem.

Minor Upgrade Details: The table at the bottom here shows what needs to change for a minor upgrade. Essentially package code and product version + plus whatever change you want to implement. The above link is to InstallShield's documentation (a different MSI tool), but this is a generic MSI technology concept - it is not vendor specific.

You can deliver the minor upgrade as a new MSI or as a patch file (*.msp). For an MSI you need to use a special command line to install. Something like this:

msiexec.exe /i MySetup.msi REINSTALLMODE=vomus REINSTALL=ALL

The v tells msiexec to re-cache the MSI so that it updates the existing cached one "in-place".


Links:

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164