0

How can I make the install require a previous version to be installed?

Is that not the purpose of Upgrade element? I cannot get it to work as expected.

The upgrade is happy to launch with or without previous 1.2.3 version installed.

Here is what I did:

  1. Opened version 1.2.3 of the original MSI in Wix Edit
  2. Replaced a single DLL with an updated DLL
  3. Updated version to 1.2.4
  4. Updated Product Id
  5. UpgradeCode did * not * changed
  6. Added Upgrade element after the last Property element

Code Sample:

<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
<Upgrade Id="{59BF7F9E-FF46-45D5-8050-F1477466A661}">
    <UpgradeVersion Minimum="1.2.3" Maximum="1.2.3" IncludeMinimum="yes"
    IncludeMaximum="yes" Property="PREVIOUSVERSIONSINSTALLED" />
</Upgrade>
<RemoveExistingProducts Sequence="1525" />

Thanks in advance,

-Ed

1
  • No, the upgrade element handles the special case of the package obsoleting other packages that some users might have, most commonly previous versions of the same product. MSI packages should be complete in and of themselves. Perhaps you are thinking of a patch package. See Patching and Upgrades. Commented May 3, 2014 at 17:04

1 Answer 1

1

I have never heard of such a design. Normally you make a setup capable of installing fresh and to update any previous versions on the system. See this thread: How to implement WiX installer upgrade?

Sign up to request clarification or add additional context in comments.

4 Comments

As a use case, customer purchases commercial software on a CD, updates are available on web. A customer who has purchased software can install an update. Everyone else cannot. Is this more of a launch condition check?
That's generally an application task to determine whether there is an appropriate license. But you can make your setup look for and verify that there is an existing installation using AppSearch: wixtoolset.org/documentation/manual/v3/xsd/wix/appsearch.html
@Ed. There is no security in launch conditions. But if a not-yet-paying-customer has downloaded and attempted to install your product, why would you want to stiff arm them when you could continue selling to them? It could also be a paying customer that is attempting a fresh install.
I've done it. I once had a customer who shipped an MSI and then MSP. Well, the MSP wasn't working out so well so he came to me. I convinced him to go Major Upgrade but due to massive size and desire to make "updates" publically available but "releases" privately available I created a build variation point that included everything for a release and omitted numerous packages for "updates" and enforced a required upgrade rule for updates but not releases. Make sense?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.