tags:

views:

175

answers:

1

Hello,

I'm using WiX (3.0.3815.0) on a fairly large project. I want to do some code generation that will generate Error elements out of some kind of source (purpose: Both C-compiled CAs and MSI need to see the error strings and know about the IDs). I generate something like this:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt;
  <Fragment>
    <UI>
        <Error Id="28002"><![CDATA[bla bla bla]]></Error>
        <Error Id="28003"><![CDATA[bli bli bli]]></Error>
(Lots more...)
    </UI>
  </Fragment>
</Wix>

During build, I use it like I use my other .wxs files: call candle.exe and get gen.wixobj, and then pass it to light.exe together with my other wixobjs.

Problem: WiX doesn't include the Error lines in the resulting MSI error table (validated with Orca).

Ugly workaround:Add a custom action with Error="28002" - then the entire file gets included in the MSI.

Anybody familiar with this? Any less-ugly solution?

+1  A: 

The UIRef element was added for just this sort of thing. Add an UI/@Id attribute and add a UIRef element with matching @Id in the fragment that includes your CustomAction definition.

Rob Mensching