├── VisualStudio2010.reg ├── Artwork ├── SDK71_prop.png ├── propmgt_1.png ├── propmgt_2.png ├── InstallSDK71.gif └── Install_atlmfc_1.png ├── SDK7.1Patch_NoTrack.props ├── SDK7.1Patch.props └── README.md /VisualStudio2010.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenk/WinSDK71_VisualStudio2019/HEAD/VisualStudio2010.reg -------------------------------------------------------------------------------- /Artwork/SDK71_prop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenk/WinSDK71_VisualStudio2019/HEAD/Artwork/SDK71_prop.png -------------------------------------------------------------------------------- /Artwork/propmgt_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenk/WinSDK71_VisualStudio2019/HEAD/Artwork/propmgt_1.png -------------------------------------------------------------------------------- /Artwork/propmgt_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenk/WinSDK71_VisualStudio2019/HEAD/Artwork/propmgt_2.png -------------------------------------------------------------------------------- /Artwork/InstallSDK71.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenk/WinSDK71_VisualStudio2019/HEAD/Artwork/InstallSDK71.gif -------------------------------------------------------------------------------- /Artwork/Install_atlmfc_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenk/WinSDK71_VisualStudio2019/HEAD/Artwork/Install_atlmfc_1.png -------------------------------------------------------------------------------- /SDK7.1Patch_NoTrack.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <_PropertySheetDisplayName>SDK7.1 Patch NoTrack 6 | 7 | 8 | false 9 | 10 | -------------------------------------------------------------------------------- /SDK7.1Patch.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <_PropertySheetDisplayName>SDK7.1 Patch 6 | 7 | 8 | true 9 | $(WindowsSdkNetFx4ToolsDir) 10 | $(WindowsSdkNetFx4ToolsDir) 11 | $(WindowsSdkNetFx4ToolsDir) 12 | $(WindowsSdkNetFx4ToolsDir) 13 | 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WinSDK71_VisualStudio2019 2 | Get your Visual Studio 2019 (2017) to work with Windows SDK 7.1 3 | 4 | ------ 5 | 6 | ## Motivation 7 | 8 | Windows SDK 7.1 first appeared in 2010.05. It has been 10 years since then. It was designed as an SDK for Windows 7, and many projects still use Windows 7 as the base support today. This is why these projects still want to use this 10 year old version as the most basic development base. 9 | 10 | When Windows SDK 7.1 was released, the expected version of Visual Studio was VS2010, which is why SDK 7.1 projects always require VS 2010 support. This is also why it is so difficult to work with the latest versions of VS (2017 / 2019). 11 | 12 | Let's start looking at how to get your VS 2019 to work with the Windows 7.1 SDK **without installing VS 2010**. 13 | 14 | [**Microsoft Windows SDK from WIKI**](https://en.wikipedia.org/wiki/Microsoft_Windows_SDK) 15 | 16 | | Microsoft Windows SDK | Version | Build Version | Release Date | Description | 17 | | -------------------------------------------------------- | ------- | ---------------- | ------------ | ------------------------------------------------------------ | 18 | | Included in Visual Studio 2010 | v7.0a | 6.1.7600.16385 | 2010-04-12 | It is the latest version that officially supports [Windows XP](https://en.wikipedia.org/wiki/Windows_XP) target. | 19 | | Microsoft Windows SDK for Windows 7 and .NET Framework 4 | v7.1 | 7.1.7600.0.30514 | 2010-05-19 | Introduces the "v110_xp" platform toolset | 20 | | Included in Visual Studio 2012 Update 1 (or later) | v7.1A | 7.1.51106 | | | 21 | 22 | This is where we start discussing the possible problems. We will use Visual Studio 2019 as the default development tool and explain in detail how to compile Windows SDK 7.1 and Visual Studio 2010 Visual C++ MFC based projects using Visual Studio 2019 and runs on Windows 10. 23 | 24 | ## List Challenges 25 | 26 | * Install Windows SDK 7.1 27 | * Working with Visual C++ 2010 Projects 28 | * Install "atlmfc" Visual C++ Files 29 | * Setup Visual C++ for Your System 30 | 31 | 32 | 33 | ## Install Windows SDK 7.1 34 | 35 | - Download the Windows SDK 7.1. [Microsoft Windows SDK for Windows 7 and .NET Framework 4 (ISO)](https://www.microsoft.com/en-us/download/details.aspx?id=8442) 36 | 37 | - Mount the **ISO** file according your system. 38 | 39 | [Windows SDK 7.1, ISO images](https://www.notion.so/44cd9698b57644108246b19bb35658d4) 40 | 41 | > **32** bits platform, please download **GRMSDK_EN_DVD.iso** and **64** bits platform, please download **GRMSDKX_EN_DVD.iso**. 42 | 43 | - Don't run the default installer. 44 | 45 | Please don't run the setup.exe in ISO folder. Run \setup\SdkSetup.exe. 46 | 47 | - Unselect Visual C++ Compilers and unselect redistributable Packages. 48 | 49 | ![WinSDK71-InstallSDK](/Artwork/InstallSDK71.gif?raw=true "Install Windows SDK 7.1") 50 | 51 | Since the VC 2010 runtime is no long compatible with Windows 10 and SDK, you should not install the old redistribution files. We will try to install new version later. 52 | 53 | - Install Windows VC 2010 SP1 Update for SDK 7.1 [Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1](https://www.microsoft.com/en-US/download/details.aspx?id=4422) Download and Install **VC-Compiler-KB2519277.exe**. 54 | 55 | - Install VC 2010 SP1 Redistributable Packages. 56 | 57 | [Microsoft Visual C++ 2010 SP1 Redistributable Package (x64)](http://www.microsoft.com/en-US/download/details.aspx?id=13523) 58 | 59 | [Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)](https://www.microsoft.com/en-US/download/details.aspx?id=8328) 60 | 61 | Download and Install "**vcredist_x64(2010).exe**" and "**vcredist_x86(2010).exe**". 62 | 63 | After these steps, Windows SDK 7.1 has been successfully installed on your Windows 10 system. You can start to use SDK to build and compile your C/C++ source code. But this is not our intention, we want the SDK to run perfectly with Visual Studio 2019. Now, select "**Windows7.1SDK**" in your Platform Toolset. 64 | 65 | ![WinSDK71-SDK-PROP](/Artwork/SDK71_prop.png?raw=true "Visual Studio SDK") 66 | 67 | ## Working with Visual C++ 2010 Projects 68 | 69 | If your project is based on VC 2010, you need to access the "**atlmfc**" headers, libraries and binary files. These files are not included in Windows SDK 7.1 and VC Compiler update (**VC-Compiler-KB2519277.exe**). To overcome this problem, you need to install Visual C++ files. 70 | 71 | ### Install "atlmfc" Visual C++ files 72 | 73 | Open **%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC** and there is no atlmfc. This means you can not build your Visual C++ project. To build the VC project, you need install atlmfc. 74 | 75 | ![WinSDK71-ATLMFC-1](/Artwork/Install_atlmfc_1.png?raw=true "Select atlmfc file") 76 | 77 | Due to the "license" issue, it is not possible to download atlmfc directly. you must copy and paste from another computer that already has VS 2010 installed. For my case, I copy the atlmfc from my test computer to this Visual Studio 2019 PC. 78 | 79 | Copy and install **atlmfc** to **%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC** so that your VC project could compile and link with **atlmfc** libraries. 80 | 81 | ### Setup Visual C++ for Your System 82 | 83 | After installing VC++ files, you should setup system registries for VS 2010 and your Visual Studio 2019 will find your installed VC 2010 automatically. 84 | 85 | - **Update Visual Studio 2010 Registry Settings** 86 | 87 | ```xml 88 | Windows Registry Editor Version 5.00 89 | 90 | [HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\10.0] 91 | "Source Directories"="C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 10.0\\\\VC\\\\crt\\\\src\\\\;;;" 92 | 93 | [HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\10.0\\Setup] 94 | 95 | [HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\10.0\\Setup\\VC] 96 | "ProductDir"="C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 10.0\\\\VC\\\\" 97 | 98 | [HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\10.0\\Setup\\VS] 99 | "ProductDir"="C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 10.0\\\\" 100 | ``` 101 | 102 | Change the Visual Studio 2010 paths according your system. 103 | 104 | Visual Studio 2019 uses "Microsoft.Cpp.Win32.Windows7.1SDK.targets" to probe your installed Windows SDK 7.1 and Visual C++ 2010. With above REG update, Visual Studio will read out your in VC paths and related variables properly and your old Visual C++ 2010 projects could be built successfully. 105 | 106 | - **Fix Compiler Errors, File Tracking Issue** 107 | 108 | Visual Studio will track changes to your source files and related files. It needs to set up the tracer correctly so that file tracing will work properly. 109 | 110 | To solve this problem, basically, we have two options. The first option is to disable this feature. The other option is to set the correct track parameters. 111 | 112 | **Disable File Track Feature:** 113 | 114 | If you don't need this feature, then turning it off is the easiest option for you. Just turn off the "**TrackFileAccess**" parameter to solve the problem. We have already wrapped this function in a prop file. You just need to use it in your project. 115 | 116 | ```xml 117 | 118 | 119 | 120 | 121 | <_PropertySheetDisplayName>SDK7.1 Patch No Track 122 | 123 | 124 | false 125 | 126 | 127 | ``` 128 | 129 | View → Other Windows → Property Manager 130 | 131 | ![WinSDK71-PROPMGT-1](/Artwork/propmgt_1.png?raw=true "Select Property Manager") 132 | 133 | Select "Add Existing Property Sheet..." and choose the property file. 134 | 135 | ![WinSDK71-PROPMGT-2](/Artwork/propmgt_2.png?raw=true "Select Property File") 136 | 137 | **Disadvantage:** You will find that Visual Studio does not automatically detect file changes. You'll have to manually recompile the file over and over again. If you change the code a lot, it can be very annoying. 138 | 139 | **Setup Correct Track Parameters** 140 | 141 | Another way is to set the TRACK parameters correctly. Again, we have prepared another prop file, you just have to reference to it and make sure that the location in the prop is compatible with your system. 142 | 143 | ```xml 144 | 145 | 146 | 147 | 148 | <_PropertySheetDisplayName>SDK7.1 Patch 149 | 150 | 151 | true 152 | $(WindowsSdkNetFx4ToolsDir) 153 | $(WindowsSdkNetFx4ToolsDir) 154 | $(WindowsSdkNetFx4ToolsDir) 155 | $(WindowsSdkNetFx4ToolsDir) 156 | 157 | 158 | ``` 159 | 160 | --------------------------------------------------------------------------------