title: Set File Name to Property
body: <p>I have a Merge Module which installs a file.  I would like to use a property passed to the Merge Module during MSI creation.  Something like:</p>
  
  <pre><code>&lt;Configuration Name='FileNameProperty'
                 Format='Text'
                 DefaultValue='[FileNameProperty]' /&gt;
  
  &lt;Substitution Table='CustomAction'
                Row='SetFileName'
                Column='Target'
                Value='[=FileNameProperty]' /&gt;
  
  &lt;CustomAction Id='SetFileName'
                Property='MYFILENAME'
                Value='[MYFILENAME]' /&gt;
  
  &lt;InstallExecuteSequence&gt;
    &lt;Custom Action='SetFileName'
            Before='LaunchConditions'&gt;1&lt;/Custom&gt;
  &lt;/InstallExecuteSequence&gt;
  
  ...
  
  &lt;File Name="[MYFILENAME]"
        Source="my-file.exe" /&gt;
  </code></pre>
  
  <p>Currently I am using a Custom Action, namely Type 51, which works when substituting property values for other element attributes, such as ServiceInstall DisplayName.  However, in this instance the file is deployed as [MYFILENAME].</p>
  
  <p>I've looked through the other Custom Actions provided by MSDN, but can't find anything that fits this situation.  Any suggestions or idea if this is even possible?</p>
  
  <p>My last ditch option is to include File elements for each variation of file name and select the desired file based off condition, but I would like to avoid that.</p>