77

I'm a software developer with a Windows 10 PC. I have to support some older software written in Visual Studio 2010 using Windows SDK 7.1

In trying to set up the development environment, I have successfully installed VS2010, and come to install Windows SDK 7.1, however the installer gives the error:

Some components cannot be installed

Some Windows SDK components require the RTM .NET Framework 4. Setup detected a pre-release version of the .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 http://go.microsoft.com/fwlink/?LinkID=187668 and then rerun Setup.

However, Windows 10 comes with .NET 4.5, so as far as I can tell there is yet another version check problem.

This would not worry me so much, but in attempting to install the Visual Studio 2010 compiler update, this fails, saying

cannot install because windows sdk 7.1 is not found

Attempting to install .NET 4 fails because it detects a later version of .NET.

Wai Ha Lee
  • 7,664
  • 52
  • 54
  • 80
Greg
  • 905
  • 1
  • 7
  • 7
  • 1
    Just to note - Windows 10 comes with .NET 4.6, not .NET 4.5 - see https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx – NextInLine Dec 08 '15 at 17:50
  • 2
    Possible duplicate of [Windows SDK Setup failure](http://stackoverflow.com/questions/31455926/windows-sdk-setup-failure) – JohnC Oct 06 '16 at 19:56

8 Answers8

87

I stumbled across another workaround, which I've also posted on a msdn thread:

  1. Uninstall any Visual C++ 2010 Redistributables from the control panel first.

  2. Download the corresponding offline ISO image from the Windows SDK archive. This lists which ISO is which.

  3. After mounting the image, open F:\Setup\SDKSetup.exe directly.

Community
  • 1
  • 1
Jeremy Wong
  • 979
  • 1
  • 9
  • 9
  • 3
    Doesn't change anything for me: unable to install the C++ compilers :( The post from @dougg3 did the trick. – CedX May 02 '16 at 18:05
  • @CédricBelin same problem, do you have some solution for this problem? – xavierzhao Jun 16 '16 at 06:31
  • 2
    @xavierzhao Finally used the instructions on [Nodegyp repository](https://github.com/nodejs/node-gyp), and installed the [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools). – CedX Aug 19 '16 at 10:17
  • I'm confused... @Greg did this work for you? You accepted this as the answer but judging by comments this did not do the trick... – Arvo Bowen Sep 08 '16 at 13:12
  • This installed for me with no issues and no registry changes were needed. I did have `Microsoft Visual C++ 2010 Redistributable (x86)` and `Microsoft Visual C++ 2010 Redistributable (x64)` uninstalled before trying this though (if that helps anyone). – Arvo Bowen Sep 08 '16 at 17:33
  • 1
    It worked for me too, but first I had to remove .Net 4.6.2 and install [4.0](https://download.microsoft.com/download/1/B/E/1BE39E79-7E39-46A3-96FF-047F95396215/dotNetFx40_Full_setup.exe) again. – Mattia72 Nov 24 '16 at 21:14
  • 10
    Thanks, worked for me. One thing to note, though: take care of downloading the right ISO for your system. The download page has 3 files and no explanation about them. `GRMSDK_EN_DVD.iso` is for x86, `GRMSDKX_EN_DVD.iso` is for x64, and I assume `GRMSDKIAI_EN_DVD.iso` is for Itanium. – Thomas Levesque Jan 09 '17 at 22:29
  • With GRMSDK_EN_DVD.iso - same error. Then I tried GRMSDKX_EN_DVD.iso and it was successfully installed on my Windows 10 x64! Thank you! – ViH Apr 26 '20 at 15:32
77

I just ran into this same problem. No idea how safe this actually is to do, but I was able to work around it by temporarily fooling the installer into thinking I had a different version of .NET 4.0 installed. I opened Process Monitor and used it to monitor everything that setup.exe was doing in order to find out how it was determining that I had a "pre-release" version of .NET 4.0.

It turns out that it looks at these two strings in the registry:

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

On my Windows 10 machine, these currently are both 4.6.00079. The installer doesn't seem to like this value. I temporarily replaced both of them with the string 4.0.30319 in regedit to match the value from InstallPath, and that seemed to do the trick. And of course, when I was finished, I put them back the way they originally were.

However, I did not have permission to change those values, so it was a bit tricky. I right-clicked on the Client key, chose Permissions, and clicked Advanced. Then I changed the owner to my user account instead of TrustedInstaller. This allowed me to add permissions for Full Control for myself so I could modify the Version value. I repeated the same process on the Full key. After the installer completed successfully, I put the original version values back in (4.6.00079), deleted the permissions I added for myself, and restored the owner to TrustedInstaller (to do that, type NT SERVICE\TrustedInstaller as the username).

There might be a safer/easier way of intercepting the registry reads than actually modifying the registry, but this was simple enough for me!

dougg3
  • 1,191
  • 9
  • 8
  • I'm not near the win10 machine until next week but that sounds good to me. – Greg Sep 02 '15 at 08:32
  • I changed both values and still get the same error when trying to install `dotNetFx40_Full_setup.exe`. This registry fix does not solve the issue for me. – Arvo Bowen Sep 08 '16 at 12:39
  • 2
    @ArvoBowen The registry hack does not help you install .NET 4.0; it allows you to install the Windows SDK 7.1. You shouldn't need to be running dotNetFx40_Full_setup.exe, because Windows 10 already has .NET 4 installed. – dougg3 Sep 09 '16 at 06:56
  • @dougg3 I finally just installed the SDK directly without changing any registry keys. But the message says `...require the RTM .NET Framework 4. Setup detected a pre-release version of the .NET Framework 4`. So I was thinking if it detected a "pre-release" I would want to install the "standard" release of .Net 4. But I did manage to get it installed by going this route http://stackoverflow.com/a/32534158/1039753 thanks! – Arvo Bowen Sep 09 '16 at 11:55
27

@dougg3's answer scripted:

First install SubInAcl,can be downloaded from Microsoft here. You may need to add it to your PATH, ex: set PATH=%PATH%;C:\Program Files (x86)\Windows Resource Kits\Tools

Then run these commands in an elevated cmd prompt:

for /f "tokens=2*" %%a in ('reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Client" /v Version /reg:32') do set "CurrentNDPv4ClientVersion=%%~b"
for /f "tokens=2*" %%a in ('reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full" /v Version /reg:32') do set "CurrentNDPv4FullVersion=%%~b"
subinacl.exe /subkeyreg "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4" /setowner="%username%"
subinacl.exe /subkeyreg "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4" /grant="%username%"=f
reg ADD "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full" /v Version /t REG_SZ /d 4.0.30319 /reg:32 /f
reg ADD "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Client" /v Version /t REG_SZ /d 4.0.30319 /reg:32 /f

echo start your installer now
pause

reg ADD "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Client" /v Version /t REG_SZ /d %CurrentNDPv4ClientVersion% /reg:32 /f
reg ADD "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full" /v Version /t REG_SZ /d %CurrentNDPv4FullVersion% /reg:32 /f

subinacl.exe /subkeyreg "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4" /revoke="%username%"
subinacl.exe /subkeyreg "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4" /setowner="NT SERVICE\TrustedInstaller"
rogerdpack
  • 50,731
  • 31
  • 212
  • 332
janv8000
  • 1,506
  • 2
  • 19
  • 30
  • Nice! I should point out that the .NET version number in the registry has changed since my original answer, and my version currently doesn't match the version in this answer either--so for anyone planning on running this script, it would probably be best to check your registry first and change the script to match. – dougg3 Feb 13 '16 at 20:13
  • Edited to take into account @dougg3 's remark, keep version in variable and restore to the same value – janv8000 Feb 24 '16 at 14:42
  • 1
    `reg ADD "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full" /v Version /t REG_SZ /d %CurrentNDPv4ClientVersion% /reg:32 /f`- shouldn't there be `%CurrentNDPv4FullVersion%` ? It has the same value on my machine though.. – Lukas Z. May 11 '16 at 14:30
  • Worked here too. Don't forget to uninstall VC++ 2010 Redistributables first as noted by Jeremy's answer. – mklein9 Jul 08 '16 at 19:16
  • Oops, if you username contains space, this will fail. So replace %username% with "%username%". Also in my WIndows 10 installation subinacl.exe wasn't there, I had to download it here: https://www.microsoft.com/en-us/download/confirmation.aspx?id=23510 – Arya S. Jul 19 '16 at 17:27
  • Space in username issue fixed, thx. Link to SubInAcl was already present – janv8000 Jul 29 '16 at 11:27
  • If somebody ends up with this error ".net framework 4.6 is not installed. please reinstall or repair visual studio" like me after following this scripted answer... you may need to manually restore the version also in the registry key HKLM\SOFTWARE\WOW6432Node see solution here: https://developercommunity.visualstudio.com/content/problem/106459/cant-installuse-vs-2017.html – firepol Mar 20 '19 at 13:36
5

Great answer by Dougg3 above. Just so it helps others, I went through the process and took some screen shots in case it helps anybody. I do have 64 bit Windows 10.

This is the reg edit file path that Dougg referenced. Ths Here click on Advanced button

enter image description here

Where it says Owner on the top click the Change link enter image description here

The next image has two steps - first click on Advanced from "Select User or Group" then click on Find Now button on next dialogue which has the same title. enter image description here

Find the user you want to change owner to then click ok enter image description here

Click ok on the next page

enter image description here

Go to your user you just selected on previous dialogues then select Allow Full Control, then click OK enter image description here

Now you're able to edit the version. enter image description here

After you're finished with this revert the version number to what it was before and undo giving yourself the Full Control for that registry.

CAM_344
  • 1,144
  • 13
  • 27
  • I know this original post was a couple years old, but I ran into this same issue this week and found his post to help install Windows SDK properly which allowed me to create a Kit in QT. – CAM_344 Sep 30 '17 at 19:18
  • 1
    `NT SERVICE\TrustedInstaller` is the name of the original owner. I switch it back to that when I was done. You have to type the full name (not just `TrustedInstaller`) in order for Windows to know what you're talking about. You also do not need to apply permissions/ownership recursively in order to trick the installer into working. – Merlyn Morgan-Graham Aug 25 '18 at 23:42
2

Install SDK 7.1 on your computer, it will mostly fail on compiler extras, but you need this first.

Now install this compiler package from Microsoft:

http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=4422

It will then install the compiler and make it possible to use the compiler.

Dealazer
  • 41
  • 4
  • Note that at the first step (install SDK 7.1) the dialog box still appears, and C++ compiler is still grayed out. Also: the C++ compiler is in `C:\Program Files\Microsoft Visual Studio 10.0\VC\bin` . – user202729 Sep 18 '18 at 12:13
0

download the exe. change the extension from 'exe' to 'zip'. extract the file now. run SDKSetup.exe from within the /Setup directory

0

I just needed to compile some one else's code quickly and this was the fix for me on Windows 10.

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

tkrn
  • 576
  • 1
  • 3
  • 16
0

If your here trying to install psycopg2 make sure your pip is up-to-date or you'll get these errors.

pip install -U pip

pip install psycopg2-binary

See - http://initd.org/psycopg/docs/install.html

Andrew Allen
  • 3,180
  • 2
  • 19
  • 46