skip to Main Content

I downloaded driver which targets Windows 7 (has option "TargetVersion" == "Windows 7" in ".vcxproj"). Also I installed Visual Studio 2022 Community, the latest SDK and DDK (for Windows 11) to compile it.

When I press "Build solution", I get error:

Windows7 is not a supported OS Version

I’m going to open file:

C:Program Files (x86)Windows Kits10build10.0.22621.0WindowsDriver.Common.targets

and comment the following line:

<Error Text=" '$(TargetVersion)' is not a supported OS Version"
           Condition="'$(WindowsTargetPlatformVersion)' &gt; '$(TargetPlatformVersion_CO)' and '$(TargetVersion)' !='$(LatestTargetVersion)' " />

Then trying to compile again.. and voila – everything works. Meaning driver works well for all operation systems up to Windows 10.

I do understand I’m doing wrong. So, my questions are:

  1. Why don’t Visual Studio developers let us build drivers for Windows 7 if everything works?
  2. What is the correct way to build drivers for all operating systems, starting with Windows 7?

Added later:

I think maybe, for example, latest WDK has more API functions which are missing in Windows 7. It turns out that if we code carefully, checking all calls for compatibility, then there should be no problems with compilation.

2

Answers


  1. Per this page:

    To target Windows 8.1, Windows 8, and Windows 7, you will need to
    install an older WDK and an older version of Visual Studio either on
    the same machine or on a separate machine. For links to older kits,
    see Other WDK downloads.

    Login or Signup to reply.
  2. Question #1 – you better ask Microsoft.
    Question #2 – you can install multiple SDK and WDK versions side by side. To target Windows 7, install Windows 8.1 SDK and WDK.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search