tags:

views:

130

answers:

4

I have a WIX file that I need to modify using MSBuild. It starts like this:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension"&gt;

  <?--... Removed Params ...-->

  <?define ProductVersion = "1.0.1"?>

  <?--... Removed Params ...-->

  <Product Id='$(var.ProductCode)'
    UpgradeCode='$(var.UpgradeCode)'
    Name='$(var.AppName)' Language="1033" Version='$(var.ProductVersion)'
    Manufacturer='$(var.Manufacturer)'>
    <Package Id='$(var.PackageCode)' InstallerVersion="200" 
    Compressed="yes" />

  <?--... Rest of the WIX XML file ...-->

My problem is that I don't know what the XPath would to the <?define ProductVersion = "1.0.1"?> would be. Is there a way to reference that via XPath so I can use the SDC SetValue MSBuild Task to change it? It is not a node (I think) so I am not sure how to reference it.

Vaccano

+2  A: 

It looks like /Wix/processing-instruction('define') may work for an XPath (whether or not MSBuild recognizes that, I don't know).

By plugging that into SketchPath, I was able to click around in it and test various XPaths to see what would select that element.

bdukes
A: 

//processing-instruction('define')

TML
A: 

<?define> is a processing instruction node, so you should be able to address it using an XPath expression such as

//processing-instruction('define')
Dan Breslau
+4  A: 

Another approach would be to define the parameter via the command-line to candle:

candle -dProductVersion=1.0.1
Rob Mensching