tags:

views:

147

answers:

3

I have a defines.wxi-file which contains some good definitions used in all my wxs-files.

When I attempt to reference the defined value from one of the <Fragment>-files I get Undefined preprocessor variable '$(var.IMAGE_FOLDER)' back in my face.

I guess there is something trivial I am missing here... Any ideas?

Edit 19:th April.
Found that issue only occurs if reference from a Fragment-file.
Re-wrote sample to match that.


defines.wxi

<Include>
    <?define IMAGE_FOLDER="Images" ?> 
</Include>

some-Fragment.wxs

<Fragment>
  <?Include defines.wxi ?>

  <Component Id='c.Images' Guid=".." Directory='INSTALLDIR.Images' >
     <File Id='f.sample.jpg' Source='$(var.IMAGE_FOLDER)sample.jpg' Name='sample.jpg' />
  </Component>
A: 

In the text of the error message you provided it says "Undefined preprocessor variable '$(var.MAGE_FOLDER)'", not $(var.IMAGE_FOLDER) - the leading 'I' is missing. This made me think that you reference the same variable somewhere in the rest of your code, but misspelling it.

In this case, the candle.exe is absolutely right - it can find IMAGE_FOLDER, but can't find MAGE_FOLDER.

Hope this is the case and you'll fix it quickly. ;-)

Yan Sklyarenko
Thanks, but it was really IMAGE_FOLDER in the error-message. The tyop was in the question.
leiflundgren
+1  A: 

Ok, another try. Do you reference anything in that <Fragment/> from the main <Product/> ? The contents of the fragment are visible to the rest of the code in case you reference anything from it. For instance, you can reference a component (<ComponentRef/>) or component group (<ComponentGroupRef/>). Once anything is referenced, the entire fragment is included.

Hope this helps.

Yan Sklyarenko
Why yes.In my main-feature in Product I have a ComponentRef to my component c.Images.However, I don't think we have come that far. The error message comes from the WiX-compiler candle, not from the linker.So WiX believes that it is pre-processor error.
leiflundgren
Yeah, that's right... I ran out of ideas...Did you try to upgrade to WiX 3.0 RTM if you're not using it?
Yan Sklyarenko
A: 

Solved it.

Where it in the sample says:

<?Include defines.wxi ?>

it should be lower case...

<?include defines.wxi ?>

then it works like a charm!

/L

leiflundgren