Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>The problem:</strong></p> <p>The MSBuild task (not MSBuild.exe, the MSBuild task named MSBuild) cannot handle multiple constants used by WIX projects. Normally you would specify the properties in your build script like:</p> <pre><code>&lt;MSBuild Projects="YourSolution.sln" Properties="Configuration=MyConfig;Platform=x86;DefineConstants=&amp;quot;SOMETHING=1;SOMETHINGELSE=2&amp;quot;" /&gt; </code></pre> <p>What you see however, when looking at the build logs is the MSBuild separates the constants and does not keep the values grouped together like you would expect - similar to:</p> <pre><code>Task "MSBuild" Global Properties: Configuration=MyConfig Platform=x86 DefineConstants="SOMETHING=1 SOMETHINGELSE=2" </code></pre> <p>So when candle tries to use those constants it typically responds with "error CNDL0150: Undefined preprocessor variable '$(var.SOMETHINGELSE)'. What this means is the MSBuild task is not properly handling properties which contain multiple '=' in the value even when grouped within quotation marks. Without the property value being grouped in quotation marks, they should obviously be treated as separate properties, rather than a single value.</p> <p><strong>The workaround:</strong></p> <p>In order to fix this problem, you need to call MSBuild.exe directly and pass those values to it manually.</p> <pre><code>msbuild.exe /p:Configuration=MyConfig /p:Platform=x86 /p:DefineConstants="SOMETHING=1;SOMETHINGELSE=2" YourSolution.sln </code></pre> <p>This will get your constants the work the way you want them to, without having to redesign your WiX installation project.</p> <p>NOTE: If you're only using a single constant you can still use the MSBuild task like so:</p> <pre><code>&lt;MSBuild Projects="YourSolution.sln" Properties="Configuration=MyConfig;Platform=x86;DefineConstants=&amp;quot;SOMETHING=1&amp;quot;" /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload