Skip to content

Instantly share code, notes, and snippets.

@MBetters
Last active January 6, 2024 13:17
Show Gist options
  • Save MBetters/c6e8d176c7ab0c09eb4a6ebb4e4e2125 to your computer and use it in GitHub Desktop.
Save MBetters/c6e8d176c7ab0c09eb4a6ebb4e4e2125 to your computer and use it in GitHub Desktop.
VS2010 + Win7.1 SDK on Win10 VS2019

Getting a Clean Install of Visual Studio 2010 and the Win 7.1 SDK on Win 10 and Using It from Visual Studio 2019

I found this process extremely laborious and full of dead-ends. I had to combine several processes found on the internet into one procedure. This is probably missing a few steps. I hope it's helpful to people googling for this. If I'm missing steps please leave comments.

The Surgical Procedure

  • Uninstall any existing 2010-related packages (both x86 as well as x64) from Control Panel > Programs and Features or Add or Remove Programs. Uninstall the components in the order laid out by this MSDN docs section.
  • Recursively delete all the following registry keys, if they exist:
    • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\10.0
    • Computer\HKEY_USERS\.DEFAULT\Software\Microsoft\VisualStudio\10.0
    • Computer\HKEY_USERS\.DEFAULT\Software\Microsoft\VisualStudio\10.0_Config
    • Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\10.0
    • Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\10.0_Config
    • Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSCommon\10.0
  • Download the Visual Studio 2010 Uninstall Utility and run it from an Administrator-elevated Command Prompt by running these commands:
    • cd %USERPROFILE%\Downloads
    • VS2010_Uninstall-RTM.ENU.exe /full /netfx
  • Delete C:\Program Files (x86)\Microsoft Visual Studio 10.0 and C:\Program Files\Microsoft Visual Studio 10.0, if they exist.
  • Restart your computer.
  • Carefully follow CAM_344's instructions on this SO post, in order to change your registry Version keys related to your computer's .NET framework. This is a hackish workaround that's needed because the Win 7.1 SDK Installer checks that these registry values are in the 4.0.x range before allowing you to run it.
    • Temporarily replace the registry Version keys' values with 4.0.30319.
    • Make sure to write down the original values of the registry Version keys that you change. You'll need to revert back to the original values later.
  • Download and run the Win 7.1 SDK Installer, except make sure to uncheck any components having Visual C++ Compilers and/or Visual C++ 2010.
  • Download and run the Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows 7.1 SDK. This will installer the latest Win 7.1 Visual C++ Compilers and Visual C++ 2010 components that you intentionally unchecked in the previous step.
  • Download and run the x64 Visual C++ 2010 Redistributable Installer and x86 Visual C++ 2010 Redistributable Installer.
  • Back in RegEdit, restore the registry Version keys you changed back to their original values.
  • Restore the Client and Full registry key-paths' ownership back to the NT SYSTEM\TrustedInstaller.
    • TODO: For some reason, this doesn't work on my laptop. I probably have a corporate-level ActiveDirectory renaming of TrustedInstaller, or something like that.
  • Install Visual Studio 2010 Professional from my.visualstudio.com. Close all applications before running the installer.
  • Hit the Windows key on your keyboard then search for Check for Updates and hit Enter. This should take you to the Windows Update panel. Click the Check for Updates button. This should discover and install the Visual Studio 2010 Service Pack 1, along with other 2010-related updates. When all these updates are done, restart your computer.
  • Install the latest Visual Studio 2019 from my.visualstudio.com.
  • If the Visual Studio Installer, click the Modify button in the Visual Studio 2019 section. Install any extra components you need, like MFC, etc. for old VS2010 GUI apps.
  • Now if you open a VS solution in VS2019 and that solution contains VS2010-targeting sub-projects (they should have (Visual Studio 2010) next to their names), then you should be able to run a right-click --> Clean and right-click --> Build on that solution, and it should find all the VS2010 header files and libraries just fine, assuming all the steps above worked correctly for you.
    • If you get an error like cannot open database file vc100.pdb, one more thing to try is to move your whole solution folder to your Desktop and do another Clean and Build. Sometimes corporate or personal antivirus software prevents VS from creating and copying PDB files unless they're somewhere under your %USERPROFILE% directory, such as %USERPROFILE\Desktop.

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment