简体   繁体   English

如何在Windows 2008 Server R2的安装程序中添加.NET 3.5的安装

[英]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-WindowsFeatureImportSystemModules 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.

相关问题 在Windows 2008 Server R2中运行asp.net 3.5应用程序时出现致命错误 - Fatal Error when running asp.net 3.5 application in windows 2008 server R2 在安装过程中安装SQL Server 2008 R2和.Net 3.5 - Install SQL Server 2008 R2 & .Net 3.5 during setup .NET 框架 3.5 SP1 用于 Window 服务器 2008 R2 - .NET Framework 3.5 SP1 for Window Server 2008 R2 无法在带有Chef Test Kitchen的Windows Server 2012 R2上安装.NET 3.5 - Cannot install .NET 3.5 on Windows Server 2012 R2 with Chef Test Kitchen 如何在Windows 8和Windows Server 2012上使用WiX Burn安装.NET Framework 3.5? - How can I install .NET Framework 3.5 on Windows 8 and Windows Server 2012 with WiX Burn? Windows Server 2008中不提供.NET 3.5功能-仅选项为3.0 - .NET 3.5 feature unavailable in Windows Server 2008 - only option is 3.0 适用于Windows 8的可再发行的脱机.NET Framework 3.5安装程序 - redistributable offline .NET Framework 3.5 installer for Windows 8 Windows服务在从3.5迁移的Windows Server 2008,x64,.NET 4上引发System.BadImageFormatException - Windows Service throws System.BadImageFormatException on Windows Server 2008, x64, .NET 4 migrated from 3.5 .Net3.5与.Net4.0中的TLS1.0问题。 Windows Server 2008 - TLS1.0 issues in .Net3.5 vs .Net4.0. Windows Server 2008 Win 2008 r2 x64服​​务器是否已安装.net 3 sp1软件包? - Does Win 2008 r2 x64 server come with .net 3 sp1 package already installed?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM