[英]How can I add the installation of .NET 3.5 to Installer on Windows 2008 Server R2
I have a homemade bootstrapper (call it SetUp.exe) that checks whether .NET 3.5 is installed on the target machine, and, if not, launches the installation by running dotnetfx35.exe. 我有一个自制的引导程序(称为SetUp.exe),它检查目标计算机上是否安装了.NET 3.5,如果没有,则通过运行dotnetfx35.exe启动安装。 Fine. 精细。 This works for all cases that I need EXCEPT for Windows 2008 Server R2. 这适用于Windows 2008 Server R2需要除EXCEPT的所有情况。 On this OS, the .NET installer does not install/enable .NET 3.5. 在此OS上,.NET安装程序未安装/启用.NET 3.5。 Instead it pops up a dialog indicating that one must manually enable it. 而是弹出一个对话框,指示必须手动启用它。 I would prefer doing this automatically from within my bootstrapper exe OR from within my main MSI which is WiX based. 我宁愿从我的bootstrap exe中自动执行此操作,也可以从基于WiX的主MSI中自动执行此操作。
The .NET Framework installation changed with Windows Server 2008 R2 - you cannot simply run the dotnetfx35.exe (as you tried), but need to enable the server feature. Windows Server 2008 R2更改了.NET Framework的安装-您不能简单地运行dotnetfx35.exe(如您所试),而需要启用服务器功能。
Usually you would add the server role via the Server Manager > Add Features > .NET Framework 3.5.1 Features, but you said you need to install it via a WiX installation. 通常,您将通过“服务器管理器”>“添加功能”> .NET Framework 3.5.1功能来添加服务器角色,但您说需要通过WiX安装进行安装。
The only way I know of is to use PowerShell. 我知道的唯一方法是使用PowerShell。 In PowerShell (started as Administrator!) you need to run the following commands: 在PowerShell(以管理员身份启动!)中,您需要运行以下命令:
Import-Module ServerManager
Add-WindowsFeature as-net-framework
This of course could be scripted by calling powershell.exe like so: 当然,可以通过调用powershell.exe编写脚本,如下所示:
powershell.exe -ImportSystemModules Add-WindowsFeature net-framework
The ImportSystemModules
you need to be able to call Add-WindowsFeature
. 您需要能够调用Add-WindowsFeature
的ImportSystemModules
。 If you want top keep powershell.exe open to see the results (I guess not in a deployment situation), just add a -noexit
parameter. 如果要让powershell.exe保持打开状态以查看结果(我想不是在部署情况下),只需添加-noexit
参数即可。
There is actually an article on the Microsoft SQL Server Blog about How to install/enable .Net 3.5 SP1 on Windows Server 2008 R2 for SQL Server 2008 and SQL Server 2008 R2 Microsoft SQL Server博客上实际上有一篇有关如何在Windows Server 2008 R2上为SQL Server 2008和SQL Server 2008 R2安装/启用.Net 3.5 SP1的文章
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.