3

我正在使用 WiX 创建我的产品安装程序。由于某种原因,它不再将 .exe 和 .dll 嵌入到安装程序中。所以我有这个:

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="USERSPECIFIEDDIR" Name="My-app-name" />
  </Directory>

它会在名为 My-app-name 的文件夹旁边创建一个 .msi,其中包含应用程序所需的所有 .exe 和 dll 文件。如果我从那里运行安装程序,没关系,但是如果我将 msi 移到其他地方(没有子目录),它会出错,因为它找不到文件。我如何告诉 WiX 将所有二进制文件嵌入到安装程序中?

如果有帮助,这里有一些来自我的 wxs 的其他片段。如果您需要任何其他信息,请告诉我。哦,我直接从 Visual Studio 2008 使用 wix。

<DirectoryRef Id="USERSPECIFIEDDIR">
  <Component Id="MainExe" Guid="580F8F15-C06C-49A7-ADDC-56C96580DC0D">
    <File Id="MainExe" Name="OrderMonkey.exe" KeyPath="yes" />
  </Component>
  <Component Id="OMEmailerExe" Guid="3B0AECC3-67E5-40B3-83CB-9B84FE965ED8">
    <File Id="OMEmailerExe" Name="OMEmailer.exe" />
  </Component>
  <Component Id="migradomDLL" Guid="37E1BCAE-EB39-4DF5-88C7-AE74CA5EA171">
      <File Id="migradom" Name="MigraDoc.DocumentObjectModel.dll" />
  </Component>
  <Component Id="migrarenderDLL" Guid="C2910B9E-0B06-467A-853C-7651BE7BD9E4">
        <File Id="migrarender" Name="MigraDoc.Rendering.dll" />
  </Component>
  <Component Id="migrartfDLL" Guid="CEBE4DE9-7CA0-4F48-A8B1-1D46E4E48B66">
          <File Id="migrartf" Name="MigraDoc.RtfRendering.dll" />
  </Component>
  <Component Id="mysqldataDLL" Guid="2E474737-474C-4146-8E67-D3837B5DB862">
            <File Id="mysqldata" Name="MySql.Data.dll" />
  </Component>
  <Component Id="pdfchartingDLL" Guid="7467B6C2-BE38-4283-B179-9FA94C4A087F">
              <File Id="pdfcharting" Name="PdfSharp.Charting.dll" />
  </Component>
  <Component Id="pdfsharpDLL" Guid="39F23E36-BF9C-40C1-8190-6A3554B879BC">
                <File Id="pdfsharp" Name="PdfSharp.dll" />
  </Component>
  <Component Id="sqliteDLL" Guid="B043CF20-8DC2-4A10-AE4B-4721263A111E">
    <File Id="sqlite" Name="System.Data.SQLite.dll" KeyPath="yes" />
  </Component>
</DirectoryRef>
<DirectoryRef Id="ApplicationProgramsFolder">
  <Component Id="ApplicationShortcut" Guid="414E91FD-7410-492C-9D48-8125C6ECCF0B">
    <Shortcut Id="ApplicationStartMenuShortcut"
              Name="Order Monkey"
              Description="Order Monkey Orders and Quotes"
              Target="[USERSPECIFIEDDIR]OrderMonkey.exe"
              WorkingDirectory="USERSPECIFIEDDIR" />
    <Shortcut Id="ApplicationOfflineStartMenuShortcut"
              Name="Order Monkey Offline"
              Description="Order Monkey Orders and Quotes"
              Target="[USERSPECIFIEDDIR]OrderMonkey.exe"
              WorkingDirectory="USERSPECIFIEDDIR" 
              Arguments="-offline" />
    <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
    <RegistryValue Root="HKCU" Key="Software\Microsoft\OrderMonkey" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
  </Component>
</DirectoryRef>

<Feature Id='Complete' Level='1' Title='Order Monkey Complete' Description='The complete package' ConfigurableDirectory='TARGETDIR' Display='expand'>
  <ComponentRef Id='MainExe' />
  <ComponentRef Id='OMEmailerExe' />
  <ComponentRef Id='migradomDLL' />
  <ComponentRef Id='migrarenderDLL' />
  <ComponentRef Id='migrartfDLL' />
  <ComponentRef Id='mysqldataDLL' />
  <ComponentRef Id='pdfchartingDLL' />
  <ComponentRef Id='pdfsharpDLL' />
  <ComponentRef Id='sqliteDLL' />
  <ComponentRef Id='ApplicationShortcut' />
  <ComponentRef Id='AppData' />
</Feature>
4

1 回答 1

6

使用这些元素:

<Package Compressed="yes" InstallScope="perMachine" />
<MediaTemplate EmbedCab="yes" />

Package/@Compressed="yes"创建橱柜而不是松散的文件。MediaTemplate/@EmbedCab="yes"将默认文件柜嵌入到 .msi 中。

于 2013-01-05T20:26:05.313 回答