开发者

WIX - Getting source files from an environment variable path

I'am new to WIX, trying to create an msi with feature tree.

  1. The installer should install all the assemblies in folder C:\ProgramFile\MyDir\MyApp.
  2. Reading path from an environment variable called MyFolder.

    <WixVariable Id ="MyFolder" Value="[%MyFolder]"/>
    
  3. Below is the code from where the assemblies are read.

    <Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="ProgramFilesFolder" Name="ProgramFilesFolder">
    <Directory Id="ProgramFilesFolder.MyDIR" Name="MyDIR">
    <Directory Id="PROGRAMFILESFOLDER.MyDIR.MyApp" Name="MyApp">
    
    <Component Id="Component.aaa.dll" Guid="guid1">
      <File Id="aaa.dll" Source="..\..\OutPut\aaa.dll" />
    </Component>
    
  4. Now I would like to get the assemblies from the folder MyFolder which is an environment variable and append it to my Source

    <Directory Id="MyFolder" Name="MyFolder" SourceName="MyFolder">
      <Component Id="Component.bbb.exe" Guid="guid2">
        <File Id="bbb.exe" Name="bbb.exe" Vital=开发者_如何学JAVA"yes" Source=MyFolder + bbb.exe />
      </Component>
    </Directory>
    

I receive a compilation error saying it is unable to find bbb.exe.

Please let me know on where I'm going wrong.


See the Preprocessor documentation. I think you can simply do this to get bbb.exe from a path defined in an environment variable:

<File Id="bbb.exe" Name="bbb.exe" Vital="yes" Source="$(env.MyFolder)bbb.exe" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜