Wix 检测 bundle 中的 .NET 4.5.2

标签 wix windows-installer .net-framework-version wix-extension

我正在尝试为 .NET 4.5.2 制作安装包。

我关注了these说明,它适用于该 .NET 版本。

但是当我更改版本时,如下所示,当我第二次运行安装程序时,它没有检测到已安装的 .NET 版本:

  <ExePackage Id="Netfx452" Cache="no" Compressed="yes" PerMachine="yes" Permanent="yes" Vital="yes" InstallCommand="/q /norestart"
    SourceFile="$(var.ProjectDir)Resources\NDP452-KB2901907-x86-x64-AllOS-ENU.exe"
    DetectCondition="(Netfx4FullVersion=&quot;4.5.51209&quot;) AND (NOT VersionNT64 OR (Netfx4x64FullVersion=&quot;4.5.51209&quot;))"
    InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Netfx4FullVersion=&quot;4.5.51209&quot; OR Netfx4x64FullVersion=&quot;4.5.51209&quot;))"/>

最佳答案

这仅在 WiX 3.9 中受支持:

  1. 包括对 WixNetFxExtension.dll 的引用

    enter image description here

  2. 在您的 Bundle.wxs 文件中,将以下内容添加到您的 <Bundle><Chain>元素

    <PackageGroupRef Id="NetFx452Redist" />
    

    或者,用以下任何一项代替 Id属性值:

    PackageGroup ID     Description
    NetFx452Web         .Net Framework 4.5.2 web setup.
    NetFx452Redist      .Net Framework 4.5.2 standalone setup.
    

这是最终标记的一个简短示例:

<Bundle Name="My App" Version="1.0.0.0" Manufacturer="Me" UpgradeCode="{YOUR-GUID-HERE}">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
    <Chain>
        <PackageGroupRef Id="NetFx452Redist" />
        <MsiPackage SourceFile="$(var.AppInstaller.TargetPath)" />
    </Chain>
</Bundle>

关于Wix 检测 bundle 中的 .NET 4.5.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25624443/

相关文章:

.net - WiX:同时注册 .NET COM 组件 x86 x64

c# - Visual Studio 2010 安装项目中的 "Runtime Implementation from ASSEMBLE NAME"是什么? (vs 2015 中的安装程序扩展设置项目)

windows - Windowsinstaller 中的 Autogen guid (*) 导致 ICE08 错误

.net - 无需卸载即可升级Windows服务

.net-core - 将所有依赖项从.Net标准库复制到.Net Framework Console应用程序

com - 如何使用 WiX 将 dll 注册到 COM 安装后

combobox - WiX:根据组合框选择安装组件

asp.net-mvc - AzureKeyVault ConfigurationBuilder 中的 connectionString 属性是什么样的?

.net - 针对不同 .NET Framework 构建 TeamCity NuGet 包

c# - WiX Bootstrap 项目上的 .NET 4.8 框架安装问题