在 WiX 中,启用 .NET 3.5 的正确方法是什么? [英] In WiX, what's the correct way to enable .NET 3.5?

查看:34
本文介绍了在 WiX 中,启用 .NET 3.5 的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 Windows 桌面应用程序创建安装程序,该应用程序依赖于另一个需要 .NET 3.5 的产品

在 Windows 10 上安装它时,.NET 3.5 已包含在内,并且必须在添加/删除 Windows 功能"中启用.我认为在 Windows 10 上安装可下载版本的 .NET 3.5 无效(如果我错了,请纠正我!).

那么,有没有办法让 WiX 启用 .NET 3.5功能"而不是下载和安装它?

解决方案

有一种方法可以在 Windows 10 和最新的 Windows Server 上安装 .NET 3.5:更新允许下载 .NET 3.5 (这就是我们要修改的内容.让我们打开它并检查已启用"然后勾选第二个选项——直接从 Windows Update 而不是 Windows Server Update Services (WSUS) 下载修复内容和可选功能"并单击确定":现在,如果我们重新尝试添加 .NET Framework 3.5,我们可以看到它成功了...

然后我个人将此策略设置恢复为其原始值,如果它不同的话.

I'm creating an installer for a Windows desktop app, which has a dependency on another product that requires .NET 3.5

When installing this on Windows 10, .NET 3.5 is included and has to be enabled in Add/Remove Windows Features. I don't think it is valid to install a downloadable version of .NET 3.5 on Windows 10 (correct me if I'm wrong!).

So, is there a way to get WiX to enable the .NET 3.5 "feature" rather than downloading and installing it?

解决方案

There is a way to install .NET 3.5 on Windows 10 and the latest Windows Server: to update a group policy value that will allow to download .NET 3.5 (blog post).

...open the command prompt and type "gpedit". The "Local Computer Policy Editor" opens where we can locate the necessary setting under the "Computer Configuration" > "Administrative Templates" > "System". On the left side, under "Settings", we can find a setting named "Specify settings for optional component installation and component repair" This is what we are going to modify. Let's open it and check "Enabled" and then check the second option – "Download repair content and optional features directly from Windows Update instead of Windows Server Update Services (WSUS)" and click "OK": Now, if we retry adding the .NET Framework 3.5, we can see that it succeeds...

I personally then revert this policy setting to its original value, if it was different.

这篇关于在 WiX 中,启用 .NET 3.5 的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆