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

Ed of the Mountain
  • 5,219
  • 4
  • 46
  • 54
  • 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](http://msdn.microsoft.com/en-us/library/aa370579.aspx). – Tom Blodget May 03 '14 at 17:04

1 Answers1

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?

Community
  • 1
  • 1
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • 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? – Ed of the Mountain May 02 '14 at 21:18
  • 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: http://wixtoolset.org/documentation/manual/v3/xsd/wix/appsearch.html – Stein Åsmul May 02 '14 at 21:36
  • @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. – Tom Blodget May 03 '14 at 17:14
  • 1
    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? – Christopher Painter May 03 '14 at 18:13