今天在x64的英文版Windows Server 2012 r2上安装最新版的 Visual Studio 2015 Exterprise 时,提示需要重新启动:
于是我restart了N次,可还是不行,在网上进行搜索,发现能在日志文件中找到原因,日志文件在C:\Users\%username%\AppData\Local\Temp中,或者直接在安装界面点“日志文件”进入。
参考日志文件的Condition(环境检查)部分:
[0A60:1530][2015-07-10T18:48:07]i000: MUX: Failed to download the update xml file from http://go.microsoft.com/fwlink/?LinkID=500683 Setup will not be updated. [0A60:1530][2015-07-10T18:48:07]i052: Condition ‘(VersionNT = v6.3) AND (WindowsBuildNumber < 9600)‘ evaluates to false. [0A60:1530][2015-07-10T18:48:07]i052: Condition ‘CompatibilityMode = 0‘ evaluates to false. [0A60:1530][2015-07-10T18:48:07]i052: Condition ‘NOT((VersionNT > v6.1) OR (VersionNT = v6.1 AND ServicePackLevel >= 1))‘ evaluates to false. [0A60:1530][2015-07-10T18:48:07]i052: Condition ‘(NOT IsLanguagePack) AND ( CurrentOperation = "Install" ) AND ( FLP_Version > v14.0.22823 )‘ evaluates to false. [0A60:1530][2015-07-10T18:48:07]i052: Condition ‘RebootPending = 1‘ evaluates to true. [0A60:1530][2015-07-10T18:48:07]i052: Condition ‘NOT (IEsvcVersionExists) OR (IEsvcVersion < v10.0)‘ evaluates to false. [0A60:1530][2015-07-10T18:48:07]i052: Condition ‘(VersionNT < v6.2) AND ((NetworkAvailable = 0) OR (DisableRootAutoUpdate = 1)) AND NOT ((MicrosoftRootCertificateAuthority2011RootExists OR MicrosoftRootCertificateAuthority2011AuthRootExists) AND (MicrosoftRootCertificateAuthority2010RootExists OR MicrosoftRootCertificateAuthority2010AuthRootExists))‘ evaluates to false. [0A60:1530][2015-07-10T18:48:07]i052: Condition ‘( CurrentOperation = "Install" AND EnterpriseExists )‘ evaluates to false. [0A60:1530][2015-07-10T18:48:07]i052: Condition ‘( CurrentOperation = "Install" AND UltimateExists )‘ evaluates to false. [0A60:1530][2015-07-10T18:48:07]i052: Condition ‘( CurrentOperation = "Install" AND NOT EnterpriseExists AND ProfessionalExists)‘ evaluates to false. [0A60:1530][2015-07-10T18:48:07]i052: Condition ‘(VersionNT = v6.3) AND (KB2919355_amd64_CurrentState <> 112 AND KB2919355_x86_CurrentState <> 112)‘ evaluates to false. [0A60:1530][2015-07-10T18:48:07]i052: Condition ‘(VersionNT = v6.3) AND (netfxfullredist_43_DetectKey < v4.5.22816)‘ evaluates to false.
发现当VS进行安装前的环境检查时,当结果为 false 时代表检查通过,结果为 true 时代表没有通过安装环境检查。
日志中显示没有通过检查的有:
[0A60:1530][2015-07-10T18:48:07]i052: Condition ‘RebootPending = 1‘ evaluates to true.
这个‘RebootPending = 1‘代表系统需要重启,可问题是:我重启了之后RebootPending还是等于1,这就是问题之所在。
于是,在网上寻找各种关于‘RebootPending = 1‘的解决方案,归结于以下几种:
重启直接选择 restart 而不是 shut down 再开机。
关闭系统的休眠功能:管理员模式运行命令行,,输入powercfg.exe /hibernate off 进行关闭休眠。关闭休眠后等于关闭了 win8 及以上系统的快速启动功能,这样能使得系统能真正地重启,而不是休眠之后快速启动。