0

这是我的 bundle.wxs 的代码 我有另一个项目正在创建 AppInstaller.msi 文件,并且我有许多 3rd 方,如 .NET 4.5 和 c++ 可再发行组件。

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" 
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
     xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" 
     xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">

 <Bundle Name="APP" Version="0.0.0.60" 
         Manufacturer="me" UpgradeCode="PUT-GUID-HERE">
  <Chain>
      <!-- TODO: Define the list of chained packages. -->
      <PackageGroupRef Id="Netfx45FullPackage" />
  </Chain>
 </Bundle>

  <Fragment>
    <!--checking for matlab 2012a installation-->
    <util:RegistrySearch Id="MatlabPath" Variable="MatlabPathExists" Root="HKLM" Key="SOFTWARE\MathWorks\MATLAB\4.17" Result="exists" Win64="yes" />
    <!--checking for matlab MCR 2012a 64 bit installation-->
    <util:RegistrySearch Id="MatlabMCRPath" Variable="MatlabMCRPathExists" Root="HKLM" Key="SOFTWARE\MathWorks\MATLAB Compiler Runtime\7.17" Result="exists" Win64="yes" />
    <!--checking for c++ Redistributable 2010 x64-->
    <util:RegistrySearch Id="redistributable_2010_64" Variable="redist2010Exists" Root="HKLM" Key="\SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x64" Result="exists" Win64="yes" />
    <!--checking for c++ Redistributable 2012 x64-->
    <util:RegistrySearch Id="redistributable_2012_64" Variable="redist2012Exists" Root="HKLM" Key="\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\VC\" Result="exists" Win64="yes" />
    <PackageGroup Id="Netfx45FullPackage">
      <ExePackage Id="vcredist_2012_x64" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="no" InstallCommand="/q" SourceFile="..\SetupProject\vcredist_x64_2012.exe" InstallCondition="(VersionNT &gt;= v6.0 OR VersionNT64 &gt;= v6.0)" DetectCondition="redist2012Exists" />
      <ExePackage Id="vcredist_2010_x64" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="no" InstallCommand="/q" SourceFile="..\SetupProject\vcredist_x64_2010.exe" InstallCondition="(VersionNT &gt;= v6.0 OR VersionNT64 &gt;= v6.0)" DetectCondition="redist2010Exists" />
      <ExePackage Id="Netfx45Xxx" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="no" InstallCommand="/q" SourceFile="..\SetupProject\dotnetfx45_full_x86_x64.exe" DetectCondition="(Netfx4FullVersion=&quot;4.5.50709&quot;) AND (NOT VersionNT64 OR (Netfx4x64FullVersion=&quot;4.5.50709&quot;))" InstallCondition="(VersionNT &gt;= v6.0 OR VersionNT64 &gt;= v6.0) AND (NOT (Netfx4FullVersion=&quot;4.5.50709&quot; OR Netfx4x64FullVersion=&quot;4.5.50709&quot;))" />
      <ExePackage Id="MatlabMCR2012a64" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="no" InstallCommand="/q" SourceFile="..\SetupProject\MCR_R2012a_win64_installer.exe" DetectCondition="MatlabMCRPathExists OR MatlabPathExists" />
      <MsiPackage Id="App" Cache="no" Compressed="no" DisplayInternalUI="yes" Vital="yes" SourceFile="$(var.installerPath)\APPInstaller.msi" />
    </PackageGroup>
  </Fragment>
</Wix>

1:如何从所有文件中创建一个 setup.exe 文件?

2:如何创建包含所有文件的子文件夹?

更新:为了创建一个子文件夹,只需添加属性 Name=""

所以

<MsiPackage Id="App" Cache="no" Compressed="no" DisplayInternalUI="yes" Vital="yes" SourceFile="$(var.installerPath)\APPInstaller.msi" />

变成这样:

<MsiPackage Id="App" Cache="no" Name="Files\APPInstaller.msi" Compressed="no" DisplayInternalUI="yes" Vital="yes" SourceFile="$(var.installerPath)\APPInstaller.msi" />
4

1 回答 1

1

为了将您的安装程序嵌入到包中,您应该在您的和节点上将属性设置Compressed为。YesExePackageMsiPackage

参考:

http://wixtoolset.org/documentation/manual/v3/xsd/wix/exepackage.html

于 2014-10-09T13:31:33.570 回答