在Windows 8.1和/或10上脱机安装.NET 4.0 [英] Install .NET 4.0 offline on Windows 8.1 and/or 10

查看:163
本文介绍了在Windows 8.1和/或10上脱机安装.NET 4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在为需要.NET 3.5和4.0的.NET应用程序创建安装程序.还要求安装程序应在没有Internet连接的情况下安装所需的所有内容.

可以使用DISM(Microsoft的 D 雇用谋杀 S M 管理工具),然后通过以下位置的Windows 8.1或10安装DVD重新分发.NET 3.5的cabinet(.cab)文件:

< drive_letter>:\ sources \ sxs \ microsoft-windows-netfx3-ondemand-package.cab 

作为应用程序安装程序设置的一部分. .cab文件有32位版本,大小约为37 MB,而64位版本的大小约为69.1 MB.这些.cab文件应用于在Windows操作系统版本下以脱机模式将.NET 3.5作为Windows功能安装. Windows 7是集成的8.1或10.Windows7集成了.NET 3.5安装程序文件,应该发布DISM命令行指令以将.NET 3.5启用为Windows功能.若要使用此方法触发.NET 3.5脱机安装,请执行以下任一操作 可以使用命令行语句:

 dism/在线/安静/启用功能/功能名称:NetFx3/LimitAccess/源:< dot_net_35_cab_file_dir_path> 


 dism/在线/Add-Package/PackagePath:< dot_net_35_cab_file_path> 

这两个语句仅适用于Windows 8.1和10,因为与Windows 7版本相比,DISM工具已更新.如果后者是手头的Windows操作系统版本,则应按以下方式发出命令:

 dism/在线/安静/启用功能/FeatureName:NetFx3 

这是安装.NET 3.5的有效方法,而不是将庞大的.NET 3.5 Service Pack 1脱机安装程序(大小约为231 MB)集成到目标应用程序的安装程序中.

问题:首先尝试在所有三个Windows操作系统版本:7、8.1、10上安装独立的.NET 4.0安装程序.它在7上成功,但是Windows 8.1和10报告了以下错误:

.NET 4.0安装程序报告此错误,即使尚未将任何版本的.NET 4.x作为Windows功能或使用独立安装程序进行安装:

从"Windows功能"的内容可以明显看出.在Windows 8.1环境中拍摄的最后一个引用的屏幕快照对话框中,.NET 4.x可作为Windows功能使用,但Windows 8.1或10的安装DVD中没有.cab文件,或者 到目前为止,我还没有发现.据推测,由于存在.NET> ;,因此会输出上述错误.当前工作站上的Windows 4.0作为Windows功能,无论是否禁用(未选中).

问题:您能否告诉我在没有Windows 8.1或10的情况下,如何使用脱机安装程序(或者可能是.cab文件,.wim文件等)在Windows 8.1或10上正确部署/重新分发.NET 4.0.任何互联网连接.那里非常稀缺和辛苦 来查找由于谷歌搜索此问题而导致的信息,或者我搜索的不是正确的东西.


追求完美..."

解决方案

Hi Ivan,

感谢您在MSDN论坛中发帖.

请参阅 .NET Framework系统要求:

.net Framework 4.5.1已预先安装在Windows 8.1中,因此.net Framework 4.6已安装在Win 10中.

两者都是Microsoft .NET Framework 4的高度兼容的就地更新.

因此,我们不能使用安装程序来单独安装.Net Framework 4.0,请转到控制面板以启用.Net Framework功能.我也在我的机器上进行了测试,/layout脱机安装程序在Win 10上不起作用.

最好的问候


Currently, I am creating an installer for a .NET application which requires .NET 3.5 and 4.0. The requirement is also that the setup should install everything needed in the absence of Internet connectivity.

.NET 3.5 can be installed in offline mode as a Windows feature by using DISM (Microsoft's Deployment Image Servicing and Management tool) and by redistributing the .NET 3.5's cabinet (.cab) file from a Windows 8.1 or 10 installation DVD located at:

<drive_letter>:\sources\sxs\microsoft-windows-netfx3-ondemand-package.cab

as part of the application installer setup. There is a 32-bit version of the .cab file that is ~37 MB large and a 64-bit one sized ~69.1 MB. These .cab's should be used for installing .NET 3.5 as a Windows feature in offline mode when the Windows OS version at hand is 8.1 or 10. Windows 7 has the .NET 3.5 installer files integrated and one should just issue the DISM command-line instruction to enable .NET 3.5 as Windows feature. To trigger the .NET 3.5 offline installation using this approach either of the following command-line statements could be used:

dism /Online /Quiet /Enable-Feature /FeatureName:NetFx3 /LimitAccess /Source:<dot_net_35_cab_file_dir_path>

or

dism /Online /Add-Package /PackagePath:<dot_net_35_cab_file_path>

Both of these statements are applicable only to Windows 8.1 and 10, since the DISM tool there is updated compared to its Windows 7 version. If the latter is the Windows OS version at hand, the command should be issued as follows:

dism /Online /Quiet /Enable-Feature /FeatureName:NetFx3

This is much more efficient way to install .NET 3.5 instead of integrating the humongous .NET 3.5 Service Pack 1 offline installer (sized ~231 MB) in the target application's installer.

The problem: First tried installing the standalone .NET 4.0 setup installing on all the three Windows OS versions: 7, 8.1, 10. It succeeded on 7 but Windows 8.1 and 10 reported the following error:

The .NET 4.0 setup reported this error even without already having installed any version of .NET 4.x either as a Windows feature or using a standalone installer:

As obvious from the contents of the "Windows Features" dialog in the last cited screenshot taken in Windows 8.1 environment, .NET 4.x is available as a Windows feature but there is no .cab file in either Windows 8.1 or 10's installer DVD for it or I haven't found such by far. Presumably, the error above is output since there is a .NET > 4.0 on the current workstation as a Windows feature, no matter if it is disabled (unchecked) or not.

The question: could you tell me how exactly to deploy/redistribute .NET 4.0 on Windows 8.1 or 10 using an offline installer, or possibly a .cab file, .wim file, etc. in the absence of any Internet connectivity. There is very scarce and hard to find information as a result from Googling this problem or I am not searching for the right thing.


"The pursuit of perfection ..."

解决方案

Hi Ivan,

Thank you for posting in MSDN forum.

Please see .NET Framework system requirements:

.Net Framework 4.5.1 is pre-installed in Windows 8.1,so as .Net Framework 4.6 is within in Win 10.

both are  highly compatible, in-place update to the Microsoft .NET Framework 4.

So we couldn't use an installer to install .Net Framework 4.0 separately, go to Control Panel to enable .Net Framework feature is the only way. I have also tested on my machine, the /layout offline installer doesn't work on Win 10.

Best Regards,


这篇关于在Windows 8.1和/或10上脱机安装.NET 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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