2010-10-07 62 views
0

我有一个自制的引导程序(称为SetUp.exe),用于检查目标计算机上是否安装了.NET 3.5,如果没有,运行dotnetfx35.exe启动安装。精细。这适用于我需要的所有情况,除了Windows 2008 Server R2之外。在此操作系统上,.NET安装程序不会安装/启用.NET 3.5。相反,它会弹出一个对话框,指出必须手动启用它。我更喜欢在我的引导程序exe或我的基于WiX的主MSI内自动执行此操作。如何将.NET 3.5的安装添加到Windows 2008 Server R2上的安装程序

回答

0

.NET Framework安装随Windows Server 2008 R2更改 - 您不能简单地运行dotnetfx35.exe(如您尝试的那样),但需要启用服务器功能。

通常您可以通过服务器管理器>添加功能> .NET Framework 3.5.1功能添加服务器角色,但是您表示需要通过WiX安装来安装它。

我知道的唯一方法就是使用PowerShell。在PowerShell中(开始作为管理员!),你需要运行以下命令:通过调用powershell.exe,像这样

Import-Module ServerManager 
Add-WindowsFeature as-net-framework 

这当然可以照本宣科:

powershell.exe -ImportSystemModules Add-WindowsFeature net-framework 

ImportSystemModules你需要能够致电Add-WindowsFeature。如果您希望打开top powershell以查看结果(我想不是在部署情况下),只需添加一个-noexit参数。

实际上在Microsoft SQL Server博客上有一篇关于How to install/enable .Net 3.5 SP1 on Windows Server 2008 R2 for SQL Server 2008 and SQL Server 2008 R2的文章

相关问题