title: How do I reference a Dynamically named MSI file in a Wix Bundle
body: <p>I am using Wix 3.9 and have it building 3 MSI files and then a Bundle that includes each of the MSI files in succession.  I have upgraded the primary Installer project to automatically include version number in the MSI file name using the techniques described <a href="http://blog.tentaclesoftware.com/archive/2009/05/03/38.aspx" rel="nofollow">here</a> and <a href="http://blog.tentaclesoftware.com/archive/2010/08/05/99.aspx" rel="nofollow">here</a>.  My BeforeBuild task in my Wix project is as follows (from second link)</p>
  
  <pre><code>&lt;!-- Set Output file name to include version--&gt;
  &lt;Target Name="BeforeBuild"&gt;
    &lt;GetAssemblyIdentity AssemblyFiles="$(SolutionDir)WindowsClient\bin\$(Configuration)\MyApp.exe"&gt;
      &lt;Output TaskParameter="Assemblies" ItemName="AssemblyVersions" /&gt;
    &lt;/GetAssemblyIdentity&gt;
    &lt;CreateProperty Value="$(OutputName)%(AssemblyVersions.Version)"&gt;
      &lt;Output TaskParameter="Value" PropertyName="TargetName"/&gt;
    &lt;/CreateProperty&gt;
    &lt;CreateProperty Value="$(TargetName)$(TargetExt)"&gt;
      &lt;Output TaskParameter="Value" PropertyName="TargetFileName"/&gt;
    &lt;/CreateProperty&gt;
    &lt;CreateProperty Value="$(TargetDir)$(TargetFileName)"&gt;
      &lt;Output TaskParameter="Value" PropertyName="TargetPath"/&gt;
    &lt;/CreateProperty&gt;
  &lt;/Target&gt;`
  </code></pre>
  
  <p>But this is causing my bundle to fail at the following line.</p>
  
  <pre><code>&lt;MsiPackage Id="MyMsiFile" Name="$(var.WixInstaller.TargetFileName)" SourceFile="$(var.WixInstaller.TargetDir)"/&gt;
  </code></pre>
  
  <p>It fails saying it cannot find the file MyMsiFile.msi, which is true because it is now named MyMsiFile1.0.1.msi.  How can I reference the MSI file with the dynamic name in the Bundle file?</p>