Skip to content

Commit 5bfb66d

Browse files
committed
detect windows 10 w manifest. cleanup stuff related to old versions (XP etc)
1 parent 0eadea0 commit 5bfb66d

File tree

3 files changed

+9
-87
lines changed

3 files changed

+9
-87
lines changed

openscad.manifest

-28
This file was deleted.

openscad_win32.rc

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# endif
66

77
#include "winuser.h"
8-
1 RT_MANIFEST "openscad.manifest"
8+
1 RT_MANIFEST "scripts/winmanifest.xml"
99

1010
VS_VERSION_INFO VERSIONINFO
1111
FILEVERSION 0,0,0,0

src/PlatformUtils-win.cc

+8-58
Original file line numberDiff line numberDiff line change
@@ -121,56 +121,6 @@ static BOOL IsWow64()
121121
return bIsWow64;
122122
}
123123

124-
std::string platformid_sysinfo(OSVERSIONINFOEX &osinfo)
125-
{
126-
std::string result("");
127-
unsigned int version = osinfo.dwMajorVersion * 1000 + osinfo.dwMinorVersion;
128-
switch (version) {
129-
case 5000:
130-
result += "Windows 2000";
131-
break;
132-
case 5001:
133-
result += "Windows XP";
134-
break;
135-
case 5002:
136-
result += "Windows Server 2003";
137-
break;
138-
case 6000:
139-
result += (osinfo.wProductType == VER_NT_WORKSTATION ? "Windows Vista" : "Windows Server 2008");
140-
break;
141-
case 6001:
142-
result += (osinfo.wProductType == VER_NT_WORKSTATION ? "Windows 7" : "Windows Server 2008 R2");
143-
break;
144-
case 6002:
145-
result += (osinfo.wProductType == VER_NT_WORKSTATION ? "Windows 8" : "Windows Server 2012");
146-
break;
147-
case 6003:
148-
// For applications that have been manifested for Windows 8.1.
149-
result += (osinfo.wProductType == VER_NT_WORKSTATION ? "Windows 8.1" : "Windows Server 2012 R2");
150-
break;
151-
default:
152-
result += "Unknown Windows";
153-
break;
154-
}
155-
156-
if (osinfo.wServicePackMajor > 0) {
157-
boost::format fmtServicePack;
158-
if (osinfo.wServicePackMinor == 0) {
159-
fmtServicePack = boost::format(" SP%d");
160-
fmtServicePack % osinfo.wServicePackMajor;
161-
} else {
162-
fmtServicePack = boost::format(" SP%d.%d");
163-
fmtServicePack % osinfo.wServicePackMajor % osinfo.wServicePackMinor;
164-
}
165-
result += fmtServicePack.str();
166-
}
167-
168-
boost::format fmt(" (v%d.%d.%d.%d)");
169-
fmt % osinfo.dwMajorVersion % osinfo.dwMinorVersion % osinfo.wServicePackMajor % osinfo.wServicePackMinor;
170-
result += fmt.str();
171-
return result;
172-
}
173-
174124
std::string PlatformUtils::sysinfo(bool extended)
175125
{
176126
std::string result;
@@ -179,15 +129,15 @@ std::string PlatformUtils::sysinfo(bool extended)
179129
osinfo.dwOSVersionInfoSize = sizeof(osinfo);
180130

181131
if (GetVersionExEx(&osinfo) == 0) {
182-
result += "Unknown Windows";
132+
result += "Unknown Windows(TM)";
183133
} else {
184-
if (osinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) {
185-
result += platformid_sysinfo( osinfo );
186-
} else {
187-
boost::format fmt("Unknown Windows (dwPlatformId = %d, dwMajorVersion = %d, dwMinorVersion = %d");
188-
fmt % osinfo.dwPlatformId % osinfo.dwMajorVersion % osinfo.dwMinorVersion;
189-
result += fmt.str();
190-
}
134+
boost::format fmt("Windows(TM) %d.%d SP %d.%d");
135+
fmt % osinfo.dwMajorVersion % osinfo.dwMinorVersion
136+
% osinfo.wServicePackMajor % osinfo.wServicePackMinor;
137+
result += fmt.str();
138+
if (osinfo.wProductType == VER_NT_WORKSTATION)
139+
result += " NT_WORKSTATION";
140+
result += " (MSDN 724833)";
191141
}
192142

193143
SYSTEM_INFO systeminfo;

0 commit comments

Comments
 (0)