This commit is contained in:
Michael Friedrich 2026-02-03 15:08:19 +01:00 committed by GitHub
commit a66a87d70a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 59 additions and 27 deletions

View file

@ -25,18 +25,12 @@
<application>
<!-- A list of all Windows versions that this application is designed to work with.
Windows will automatically select the most compatible environment.-->
<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>-->
<!-- If your application is designed to work with Windows 8.1, uncomment the following supportedOS node-->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>-->
<!-- Windows 10 -->
<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>

View file

@ -2,6 +2,7 @@
if(MSVC)
set(WindowsSources icinga.rc)
list(APPEND icinga_app_SOURCES app.manifest)
else()
set(WindowsSources "")
endif()

19
icinga-app/app.manifest Normal file
View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="Icinga 2"/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with.
Windows will automatically select the most compatible environment.-->
<!-- Windows 10 -->
<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>
</asmv1:assembly>

View file

@ -1631,21 +1631,39 @@ static bool ReleaseHelper(String *platformName, String *platformVersion)
*platformName = "Windows";
if (platformVersion) {
*platformVersion = "Vista";
if (IsWindowsVistaSP1OrGreater())
*platformVersion = "Vista SP1";
if (IsWindowsVistaSP2OrGreater())
*platformVersion = "Vista SP2";
if (IsWindows7OrGreater())
*platformVersion = "7";
if (IsWindows7SP1OrGreater())
*platformVersion = "7 SP1";
if (IsWindows8OrGreater())
*platformVersion = "8";
if (IsWindows8Point1OrGreater())
*platformVersion = "8.1 or greater";
if (IsWindowsServer())
*platformVersion += " (Server)";
// https://stackoverflow.com/questions/53393150/c-how-to-detect-windows-server-2019
// https://techthoughts.info/windows-version-numbers/
if (IsWindowsServer()) {
// 2019 Server +
if (IsWindowsVersionOrGreater(10, 0, 1803)) {
*platformVersion = "Server 2019 or greater";
// 2016 Server
} else if (IsWindowsVersionOrGreater(10, 0, 1607)) {
*platformVersion = "Server 2016";
// 2012 R2
} else if (IsWindowsVersionOrGreater(6, 3, 0)) {
*platformVersion = "Server 2012 R2";
// 2012
} else if (IsWindowsVersionOrGreater(6, 2, 0)) {
*platformVersion = "Server 2012";
} else {
*platformVersion = "Server 2008";
}
} else {
if (IsWindows10OrGreater())
*platformVersion = "10 or greater";
else if (IsWindows8Point1OrGreater())
*platformVersion = "8.1";
else if (IsWindows8OrGreater())
*platformVersion = "8";
else if (IsWindows7SP1OrGreater())
*platformVersion = "7 SP1";
else if (IsWindows7OrGreater())
*platformVersion = "7";
else
*platformVersion = "Vista";
}
}
return true;