aherrick
aherrick

Reputation: 20169

WIX Installer Install in Multiple Locations then Patch

First let me say if this doesn't make sense to somebody please let me know.

Here is my scenario... and I believe it should be potentially simple. Let's say I had a scenario where my Installer installed to:

Program Files/MyProduct/Development

Also I wanted to have the same installer install to:

Program Files/MyProduct/Test

Is this possible with WIX?

In addition, how might I go about patching each if so?

Upvotes: 1

Views: 378

Answers (3)

David Martin
David Martin

Reputation: 12248

The following should allow you to install side-by-side, I would suggest that you are very careful with this approach and should only use this for development purposes.

<?xml version="1.0" encoding="UTF-8"?>

<?if $(var.MyApplication.Configuration) = Debug ?>
<?define UpgradeCode = "<INSERT-DEVELOPMENT-GUID-HERE>" ?>
<?else ?>
<?define UpgradeCode = "<INSERT-RELEASE-GUID-HERE>" ?>
<?endif ?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*"  Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="SetupProject1" UpgradeCode="$(var.UpgradeCode)">

This approach uses the configuratuion of the referenced project, so for this to work you must have referenced a project (shown above as MyApplication). This will create an installer with a different Upgrade Code when you compile for Debug.

You then need to deploy in the manner described by @KMoraz.

Upvotes: 0

KMoraz
KMoraz

Reputation: 14164

Conventionally the INSTALLDIR or INSTALLLOCATION is a public property which you can set via the command line or bootstapper. E.g.:

msiexec /i setup.msi INSTALLDIR="C:\Program Files\MyProduct\Test"

Upvotes: 0

Christopher Painter
Christopher Painter

Reputation: 55581

What you are trying to put your finger on is called multiple instance installers. I've done a lot of it in InstallShield rather then WiX and Major/Minor upgrades rather then patching. Yan's done more on the WiX side including writing some blog articles.

But be warned, it's not simple. :-)

Revisited: Multiple Instance installations and patches

Upvotes: 2

Related Questions