Wix:如何定义条件引导程序先决条件?
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
类似于: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.