在Windows 10 64-bit上安裝Windows SDK 7.1和.NET4


目的:

成功在window10上安裝window sdk7.1 和 .NET Framework 4

需求:

support some older software written in Visual Studio 2010 using Windows SDK 7.1

步驟:

一、卸載.NET Framework 4 以上版本

 

如果安裝了.NET Framework 4 以上的版本,則即使sdk7.1安裝成功,在安裝.NET 4也可能出現問題。

先卸載,然后安裝.NET 4,然后在安裝所需要的.NET的版本,比如4.5或者4.6。

 

二、卸載Microsoft Visual Studio C++ 2010

 

適用情況一:

解決方案來自:

http://www.cnblogs.com/duanshuiliu/archive/2013/04/02/2994776.html

下面4個組件尤其需要卸載:

Visual c++ 2010 x86 redistributable、

Visual c++ 2010 x64 redistributable(64位windows)、

Microsoft Visual C++  Compilers 2010 X86和X64版本(有些電腦可能不存在則不必理會)。

值得注意的是后面兩個需要在注冊表中查找是否存在,路徑為HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall,

查找Display name為“Microsoft Visual C++  Compilers 2010 Standard - enu - x86”和“Microsoft Visual C++  Compilers 2010 Standard - enu - x64”,然后根據上述鏈接方法進行卸載。

 

適用情況二:

解決方案來自:

https://forum.openrobotino.org/forum/main-forum/software/211-matlab-64bit-compiler-problems-with-sdk-7-1-under-windows-10

首先,Uninstall any Visual C++ 2010 Redistributables from the control panel

也就是卸載Visual C++ 2010相關組件,同上面的適用情況一類似

 

其次,Download the corresponding offline ISO image from the Windows SDK archive

這里用的是iso鏡像(https://www.microsoft.com/en-us/download/details.aspx?id=8442),

根據自己的情況選擇不同的鏡像
x86 ISO File Name:GRMSDK_EN_DVD.iso      32位系統
x64 ISO File Name:GRMSDKX_EN_DVD.iso    64位系統
Itanium ISO File Name:GRMSDKIAI_EN_DVD.iso


最后,After mounting the image to an virtual disk (Like Virtual clone drive) , open F:\Setup\SDKSetup.exe directly

掛在鏡像,點擊安裝。我做的時候沒后這么順利,總出現一個錯誤提示

Some Windows SDK components require the RTM .NET Framework 4. Setup detected a pre-release version of .NET Framework 4. If you continue with Setup, these components will not be installed. If you want to install these components, click Cancel, then install the .NET Framework 4 from https://go.microsoft.com/fwlink/?LinkID=187668 and then rerun Setup.

Click OK to continue.

點擊OK,一點都不OK,哪里來的pre-release version of .NET Framework4.

原來在win10 64bit系統中,仍需要修改2個注冊entry:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Full\Version HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Client\Version

找到它們,

image

將Client和Full這兩個的Version的值由4.6.01586(需要記住)改為4.0.30319,這個修改需要權限。

如何修改權限,根據下面的鏈接自行修改,https://www.groovypost.com/howto/take-full-permissions-control-edit-protected-registry-keys/

由於隱私問題,這里不好演示。其基本內容是先修改Owner,然后添加Permission Entry(也就是選擇一個principal)

image

保存修改后就有權限修改了,修改了也就可以順利安裝了。

最后,再返回這里,改回原來的值。

 

三、測試結果

在我的Matlab2013a中設置默認的C compiler。

>> mex -setup

Welcome to mex -setup.  This utility will help you set up  

a default compiler.  For a list of supported compilers, see  

http://www.mathworks.com/support/compilers/R2013a/win64.html

Please choose your compiler for building MEX-files:

Would you like mex to locate installed compilers [y]/n? y

Select a compiler:

[1] Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files (x86)\Microsoft Visual Studio 10.0

[0] None

Compiler: 1

Please verify your choices:

Compiler: Microsoft Software Development Kit (SDK) 7.1

Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0

Are these correct [y]/n? y

 

omit….

>>

 

后記

如果為matlab2013a在win10 64bit中配置sdk7.1中的C編譯器,有人直接安裝visual studio2012便可以了。不過我用的是visual studio2015,不想安裝前個版本。圖簡單的,可以試一試。

 

 

參考:

Questions

http://stackoverflow.com/questions/32091593/cannot-install-windows-sdk-7-1-on-windows-10

solutions

https://www.mathworks.com/matlabcentral/answers/101105-how-do-i-install-microsoft-windows-sdk-7-1

https://forum.openrobotino.org/forum/main-forum/software/211-matlab-64bit-compiler-problems-with-sdk-7-1-under-windows-10

http://stackoverflow.com/questions/31455926/windows-sdk-setup-failure

https://www.groovypost.com/howto/take-full-permissions-control-edit-protected-registry-keys/

resources

Microsoft Windows SDK for Windows 7 and .NET Framework 4 (ISO):

https://www.microsoft.com/en-us/download/details.aspx?id=8442


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM