Wix:如何定义条件引导程序先决条件?

发布于 2024-09-11 07:31:44 字数 1098 浏览 2 评论 0原文

我正在使用 WIX 3.0 工具集和 VS2008。在我的“.wixproj”文件中,我添加了以下代码(工作正常)。我想添加一个条件,以便仅在安装了 Office 2007 的情况下才安装 PIA。

...
    <ItemGroup>
        <BootstrapperFile Include="Microsoft.Net.Framework.3.5">
          <ProductName>.NET Framework 3.5</ProductName>
        </BootstrapperFile>

        <!-- Here I want to check if office is installed. If true then install the PIAs -->    
        <BootstrapperFile Include="Microsoft.Office.PIARedist.2007">
          <ProductName>Microsoft Office 2007 Primary Interop Assemblies</ProductName>
        </BootstrapperFile>

      </ItemGroup>
     ...

我在安装程序脚本 .wxs 中编写了以下代码,但这在引导程序中没有用。

...
<!-- Properties to check for Word 2007 Version. Return string should be "Word.Application.12" -->
    <Property Id="WORDVERSION">
      <RegistrySearch Id="RegistrySearchWordVersion"
                      Root="HKCR"
                      Key="Word.Application\CurVer"
                      Type="raw"/>
    </Property>
...

I am using WIX 3.0 Toolset and VS2008. In my ".wixproj" file I have added the following code (which works fine). I want to add a condition so that it will only install PIA if office 2007 is installed.

...
    <ItemGroup>
        <BootstrapperFile Include="Microsoft.Net.Framework.3.5">
          <ProductName>.NET Framework 3.5</ProductName>
        </BootstrapperFile>

        <!-- Here I want to check if office is installed. If true then install the PIAs -->    
        <BootstrapperFile Include="Microsoft.Office.PIARedist.2007">
          <ProductName>Microsoft Office 2007 Primary Interop Assemblies</ProductName>
        </BootstrapperFile>

      </ItemGroup>
     ...

I have the following code written in my installer script .wxs but this is not useful in the bootstrapper.

...
<!-- Properties to check for Word 2007 Version. Return string should be "Word.Application.12" -->
    <Property Id="WORDVERSION">
      <RegistrySearch Id="RegistrySearchWordVersion"
                      Root="HKCR"
                      Key="Word.Application\CurVer"
                      Type="raw"/>
    </Property>
...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

手长情犹 2024-09-18 07:31:44

类似于:WIX:生成BootStrapper条件?

查看产品和包架构参考,您可能想查看和<安装检查>元素。

Similar to: WIX: GenerateBootStrapper conditions?

Check out the Product and Package Schema Reference and you probably want to look at the <BypassIf> and <InstallChecks> element.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文