title: WiX: How to create file name from a property value
body: <p>I have a working WiX installer that correctly writes properties to certain INI files, which works fine, but I have a need to generate the name of an INI file on the fly, from the computer name, eg.</p>
  
  <p><strong>MACHINE(xxx).INI</strong></p>
  
  <p>where xxx is my computer name.</p>
  
  <p>I have tried all sorts of combinations of properties and I just can't seem to get it working. Can anyone put me right ?</p>
  
  <p>This is my latest attempt that doesn't work:</p>
  
  <pre><code>&lt;Property Id="MACHINEINI" Value="MACHINE([%COMPUTERNAME]).ini" /&gt;
  ...
  &lt;IniFile Id="IniPermissions"
      Directory="MYDIR"
      Action="addLine"
      Name="[MACHINEINI]"
      Section="[ComputerName]"
      Key="Permissions"
      Value="TEST" /&gt;
  </code></pre>
  
  <p>I never see the value of MACHINEINI, as the filename that gets created is actually called</p>
  
  <p>[MACHINEINI]</p>
  
  <p>The value it writes in is correct, so I see the contents as follows:</p>
  
  <blockquote>
    <p>[xxx] Permissions=TEST</p>
  </blockquote>
  
  <p>(where xxx is my machine name)</p>
  
  <p>I have tried using [ComputerName], [COMPUTERNAME], [%COMPUTERNAME]</p>
  
  <p>When I build the installer, I get the following error:</p>
  
  <blockquote>
    <p>C:\Source\blah\BLAH.wxs(50) : warning CNDL1077 : The 'MACHINEINI' Pro
    perty contains '[COMPUTERNAME]' in its value which is an illegal
    reference to an other property.  If this value is a string literal,
    not a property reference, pl ease ignore this warning.  To set a
    property with the value of another property,  use a CustomAction with
    Property and Value attributes.</p>
  </blockquote>