Skip to content

Commit

Permalink
fix: add manifest file to correctly determine Windows version (#21953)
Browse files Browse the repository at this point in the history
In Windows 8.1 and later, GetVersionEx does not automatically give the
correct information if a manifest file doesn't explicitly mention we
support that version. This will enable further detection for Windows 8.1
and Windows 10/11 when using windowsversion(), with an easy way to add
future versions. A list of all operating system versions can be found
here:
https://learn.microsoft.com/en-us/windows/win32/sysinfo/operating-system-version
  • Loading branch information
dundargoc committed Jan 23, 2023
1 parent f08051c commit 5a94d24
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/nvim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ if(MSVC)
# Disable warnings that give too many false positives.
target_compile_options(main_lib INTERFACE -wd4311 -wd4146)
target_compile_definitions(main_lib INTERFACE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_DEPRECATE)

target_sources(main_lib INTERFACE ${CMAKE_CURRENT_LIST_DIR}/os/nvim.manifest)
else()
target_compile_options(main_lib INTERFACE -Wall -Wextra -pedantic -Wno-unused-parameter
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
Expand Down
20 changes: 20 additions & 0 deletions src/nvim/os/nvim.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity
processorArchitecture="*"
version="0.9.0.0"
type="win32"
name="Neovim"
/>
<description>Neovim</description>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 and Windows 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
</application>
</compatibility>
</assembly>

0 comments on commit 5a94d24

Please sign in to comment.