3

我使用 wix 制作了我的加载项项目的设置文件。它有一些依赖项,如 dotNet 和 VSTO 运行时。所以我使用 Wix 引导程序来确认在安装它也可以工作的产品之前必须安装依赖项。但是我需要有条件地安装依赖项,比如如果安装了 dotNet 和 VSTO 运行时,那么不要寻找安装这些项目。我也尝试了注册表搜索,但没有成功,这是我的引导程序代码,告诉我需要在哪里修改代码。

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" 
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
    <Bundle Name="FinalSetup" Version="1.0.0.0" Manufacturer="Ramesh" UpgradeCode="5704ca64-b7bc-487b-8867-cabb51621c0e">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" >
      <bal:WixStandardBootstrapperApplication LicenseFile="mylicense.rtf"
                                              SuppressOptionsUI="yes" />
    </BootstrapperApplicationRef>

        <Chain>
      <ExePackage Id="dotNetFx40_Full_x86_x64" SourceFile="dotNetFx40_Full_x86_x64.exe" PerMachine="yes" Cache="no"
                  Compressed="no"
                  DownloadUrl="http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe"
                  Permanent="yes"
                  InstallCommand="/q /norestart"
                  DetectCondition="VSTOR40_Installed"
                  InstallCondition="1" />
      <ExePackage Id="VSTORuntime" SourceFile="vstor_redist.exe" Permanent="yes" Vital="yes" Cache="no" Compressed="no"
                  DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=158917"
                  PerMachine="yes"
                  InstallCommand="/q /norestart"
                  DetectCondition="VSTOR40_Installed"
                  InstallCondition="NOT VSTOR40_Installed" />
      <MsiPackage SourceFile="$(var.Setup.TargetPath)" Vital="yes" Compressed="yes" Id="WordAddIns" After="VSTORuntime"/>
    </Chain>
    </Bundle>
</Wix>

我遇到的另一个问题是,我附加了mylicense.rft一些虚拟内容。但是安装程序在安装过程中没有显示许可证内容,请查看随附的快照 在此处输入图像描述

4

1 回答 1

3

问题是我忘记使用导致此问题的 value 属性。这是文件的问题rtf,在更改文件后它按预期工作。这是代码的工作版本。

工作版本在这里

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" 
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  <Bundle Name="FinalSetup" Version="1.0.0.0" Manufacturer="Ramesh" UpgradeCode="5704ca64-b7bc-487b-8867-cabb51621c0e">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" >
      <bal:WixStandardBootstrapperApplication LicenseFile="mylicense.rtf"
                                              SuppressOptionsUI="yes" />
    </BootstrapperApplicationRef>
    <util:RegistrySearch Id="VSTORuntimeTest" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R\" Value="VSTORFeature_CLR40" Variable="VSTORFeature"/>
    <util:RegistrySearch Id="VSTORuntimeVersionV4R" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R\" Value="Version" Variable="VSTORVersionV4R"/>
    <util:RegistrySearch Id="VSTORuntimeVersionV4" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4\" Value="Version" Variable="VSTORVersionV4"/>

    <util:RegistrySearch Id="DotNetTest" Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Install" Variable="DotNetInstall"/>
    <util:RegistrySearch Id="DotNetVersion" Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="DotNetVersion"/>

    <Chain> 
      <ExePackage Id="dotNetFx40_Full_x86_x64" SourceFile="dotNetFx40_Full_x86_x64.exe" PerMachine="yes" Cache="no"
                  Compressed="no"
                  DownloadUrl="http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe"
                  Permanent="yes"
                  InstallCommand="/q /norestart"
                  DetectCondition="NOT DotNetInstall"
                  InstallCondition="NOT DotNetInstall OR NOT (DotNetVersion >=v4.0.30319)" />
      <ExePackage Id="VSTORuntime" SourceFile="vstor_redist.exe" Permanent="yes" Vital="yes" Cache="no" Compressed="no"
                  DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=158917"
                  PerMachine="yes"
                  InstallCommand="/q /norestart"
                  DetectCondition="VSTORFeature"
                  InstallCondition="NOT VSTORFeature OR NOT (VSTORVersionV4R >=v10.0.40303) OR NOT (VSTORVersionV4 >=v10.0.21022)" />
      <MsiPackage SourceFile="$(var.Setup.TargetPath)" Vital="yes" Compressed="yes" Id="WordAddIns"/>
    </Chain>
  </Bundle>
</Wix>
于 2013-05-15T09:08:29.533 回答