tags:

views:

70

answers:

1

I'm making 'minor upgrade' packages using WIX. I'm confused when it comes to basing the upgrade packages.

When I generate a patch do I always base off version 1, or do I base version 3 off of version 2?

in short, I'm having trouble understanding the

<UpgradeImage SourceFile="$(var.ProjNew)" Id="Upgrade1_$(var.NewID)">
    <TargetImage SourceFile="$(var.ProjOld)" Order="2" Id="Target1_$(var.NewID)" IgnoreMissingFiles="no" />
</UpgradeImage>

ProjNew should point to the new MSI, what should ProjOld point to? the first MSI, or the n-1 MSI?

could someone help me understand whats going on and how to do this correctly? Ideally someone who's running version1 when version 3 comes out could just get one update package, that leads me to believe I should always base off version1. But if I do that what happens if someone has version 2 installed? are they toast?

I think the heart of my question is assume I've built three versions 1, 2, and 3. Assume each is based on version 1. If someone installs version 1 and then version 2. They then get version 3 patch what will happen? will msiexec remove patch 2 and then apply patch 3? keep in mind patch 3 is based off of version 1.

+2  A: 

First, unless you absolutely must use WiX v2 don't use the PatchCreation element. Switch to using WiX v3's Patch element. It si far easier to use, more powerful and has much better error checking.

Now what it sounds like you want to do is to create a patch that targets multiple products. In other words, you want a single patch that can target both v1 and v2 to turn them into v3. The way you accomplish this is creating a transform from v1 to v3 and another transfrom from v2 to v3.

To do that start by reading the "Using Purely WiX" topic in the WiX.chm. When you get to the part that says "Create the transform between your products" do that step twice to create a v1tov3.wixmst and a v2tov3.wixmst. Then in the "Build the patch" step, provide both .wixmst files on the commandline. Pyro will take care of the rest.

There are a lot of options in the Patch element. If you don't them don't turn them on. It really isn't that complicated when you follow the step by step and practice a little bit.

Rob Mensching
thanks Rob! do you have any tricks for knowing that the work was done correctly? I'd love to create some positive failure cases, so I can prove to myself that I know what i'm doing :)
stuck
I typically use Orca to view the patch applied to the MSIs in question (i.e. manual verification). I haven't done enough patching to justify building tools to verify it in an automated fashion.
Rob Mensching