detect windows 10 w manifest. cleanup stuff related to old versions (XP etc)
This commit is contained in:
parent
0eadea0b71
commit
5bfb66d0e5
3 changed files with 9 additions and 87 deletions
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||
<description>OpenSCAD</description>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel
|
||||
level="asInvoker"
|
||||
uiAccess="false"
|
||||
/>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- Windows 10 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
<!-- Windows 8.1 -->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<!-- Windows Vista -->
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||
<!-- Windows 7 -->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
<!-- Windows 8 -->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
# endif
|
||||
|
||||
#include "winuser.h"
|
||||
1 RT_MANIFEST "openscad.manifest"
|
||||
1 RT_MANIFEST "scripts/winmanifest.xml"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,0,0,0
|
||||
|
|
|
|||
|
|
@ -121,56 +121,6 @@ static BOOL IsWow64()
|
|||
return bIsWow64;
|
||||
}
|
||||
|
||||
std::string platformid_sysinfo(OSVERSIONINFOEX &osinfo)
|
||||
{
|
||||
std::string result("");
|
||||
unsigned int version = osinfo.dwMajorVersion * 1000 + osinfo.dwMinorVersion;
|
||||
switch (version) {
|
||||
case 5000:
|
||||
result += "Windows 2000";
|
||||
break;
|
||||
case 5001:
|
||||
result += "Windows XP";
|
||||
break;
|
||||
case 5002:
|
||||
result += "Windows Server 2003";
|
||||
break;
|
||||
case 6000:
|
||||
result += (osinfo.wProductType == VER_NT_WORKSTATION ? "Windows Vista" : "Windows Server 2008");
|
||||
break;
|
||||
case 6001:
|
||||
result += (osinfo.wProductType == VER_NT_WORKSTATION ? "Windows 7" : "Windows Server 2008 R2");
|
||||
break;
|
||||
case 6002:
|
||||
result += (osinfo.wProductType == VER_NT_WORKSTATION ? "Windows 8" : "Windows Server 2012");
|
||||
break;
|
||||
case 6003:
|
||||
// For applications that have been manifested for Windows 8.1.
|
||||
result += (osinfo.wProductType == VER_NT_WORKSTATION ? "Windows 8.1" : "Windows Server 2012 R2");
|
||||
break;
|
||||
default:
|
||||
result += "Unknown Windows";
|
||||
break;
|
||||
}
|
||||
|
||||
if (osinfo.wServicePackMajor > 0) {
|
||||
boost::format fmtServicePack;
|
||||
if (osinfo.wServicePackMinor == 0) {
|
||||
fmtServicePack = boost::format(" SP%d");
|
||||
fmtServicePack % osinfo.wServicePackMajor;
|
||||
} else {
|
||||
fmtServicePack = boost::format(" SP%d.%d");
|
||||
fmtServicePack % osinfo.wServicePackMajor % osinfo.wServicePackMinor;
|
||||
}
|
||||
result += fmtServicePack.str();
|
||||
}
|
||||
|
||||
boost::format fmt(" (v%d.%d.%d.%d)");
|
||||
fmt % osinfo.dwMajorVersion % osinfo.dwMinorVersion % osinfo.wServicePackMajor % osinfo.wServicePackMinor;
|
||||
result += fmt.str();
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string PlatformUtils::sysinfo(bool extended)
|
||||
{
|
||||
std::string result;
|
||||
|
|
@ -179,15 +129,15 @@ std::string PlatformUtils::sysinfo(bool extended)
|
|||
osinfo.dwOSVersionInfoSize = sizeof(osinfo);
|
||||
|
||||
if (GetVersionExEx(&osinfo) == 0) {
|
||||
result += "Unknown Windows";
|
||||
result += "Unknown Windows(TM)";
|
||||
} else {
|
||||
if (osinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) {
|
||||
result += platformid_sysinfo( osinfo );
|
||||
} else {
|
||||
boost::format fmt("Unknown Windows (dwPlatformId = %d, dwMajorVersion = %d, dwMinorVersion = %d");
|
||||
fmt % osinfo.dwPlatformId % osinfo.dwMajorVersion % osinfo.dwMinorVersion;
|
||||
result += fmt.str();
|
||||
}
|
||||
boost::format fmt("Windows(TM) %d.%d SP %d.%d");
|
||||
fmt % osinfo.dwMajorVersion % osinfo.dwMinorVersion
|
||||
% osinfo.wServicePackMajor % osinfo.wServicePackMinor;
|
||||
result += fmt.str();
|
||||
if (osinfo.wProductType == VER_NT_WORKSTATION)
|
||||
result += " NT_WORKSTATION";
|
||||
result += " (MSDN 724833)";
|
||||
}
|
||||
|
||||
SYSTEM_INFO systeminfo;
|
||||
|
|
|
|||
Loading…
Reference in a new issue