Properly detect Windows 8, now that Qt supports it officially.

This commit is contained in:
LoRd_MuldeR 2013-10-16 18:23:53 +02:00
parent 8b0d60dbeb
commit 33e04007fb
2 changed files with 9 additions and 14 deletions

View File

@ -34,7 +34,7 @@
#define VER_LAMEXP_MINOR_LO 9 #define VER_LAMEXP_MINOR_LO 9
#define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 2 #define VER_LAMEXP_PATCH 2
#define VER_LAMEXP_BUILD 1388 #define VER_LAMEXP_BUILD 1390
#define VER_LAMEXP_CONFG 1348 #define VER_LAMEXP_CONFG 1348
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -1140,7 +1140,6 @@ bool lamexp_init_qt(int argc, char* argv[])
{ {
SetDllDirectoryProc pSetDllDirectory = (SetDllDirectoryProc) kernel32.resolve("SetDllDirectoryW"); SetDllDirectoryProc pSetDllDirectory = (SetDllDirectoryProc) kernel32.resolve("SetDllDirectoryW");
if(pSetDllDirectory != NULL) pSetDllDirectory(L""); if(pSetDllDirectory != NULL) pSetDllDirectory(L"");
kernel32.unload();
} }
//Extract executable name from argv[] array //Extract executable name from argv[] array
@ -1185,11 +1184,8 @@ bool lamexp_init_qt(int argc, char* argv[])
{ {
case 0: case 0:
case QSysInfo::WV_NT: case QSysInfo::WV_NT:
qFatal("%s", QApplication::tr("Executable '%1' requires Windows 2000 or later.").arg(executableName).toLatin1().constData());
break;
case QSysInfo::WV_2000: case QSysInfo::WV_2000:
qDebug("Running on Windows 2000 (not officially supported!).\n"); qFatal("%s", QApplication::tr("Executable '%1' requires Windows XP or later.").arg(executableName).toLatin1().constData());
lamexp_check_compatibility_mode("GetNativeSystemInfo", executableName);
break; break;
case QSysInfo::WV_XP: case QSysInfo::WV_XP:
qDebug("Running on Windows XP.\n"); qDebug("Running on Windows XP.\n");
@ -1207,21 +1203,20 @@ bool lamexp_init_qt(int argc, char* argv[])
qDebug("Running on Windows 7 or Windows Server 2008 R2.\n"); qDebug("Running on Windows 7 or Windows Server 2008 R2.\n");
lamexp_check_compatibility_mode("CreateFile2", executableName); lamexp_check_compatibility_mode("CreateFile2", executableName);
break; break;
case QSysInfo::WV_WINDOWS8:
qDebug("Running on Windows 8 or Windows Server 2012.\n");
lamexp_check_compatibility_mode(NULL, executableName);
break;
default: default:
{ {
const lamexp_os_version_t *osVersionNo = lamexp_get_os_version(); const lamexp_os_version_t *osVersionNo = lamexp_get_os_version();
if(osVersionNo->versionMajor < 5) if(LAMEXP_MAX_OS_VER(osVersionNo, 5, 0))
{ {
qFatal("%s", QApplication::tr("Executable '%1' requires Windows 2000 or later.").arg(executableName).toLatin1().constData()); qFatal("%s", QApplication::tr("Executable '%1' requires Windows XP or later.").arg(executableName).toLatin1().constData());
}
else if(LAMEXP_EQL_OS_VER(osVersionNo, 6, 2))
{
qDebug("Running on Windows 8 or Windows Server 2012\n");
lamexp_check_compatibility_mode(NULL, executableName);
} }
else else
{ {
qWarning("Running on an unknown/untested WinNT-based OS (v%u.%u).\n", osVersionNo->versionMajor, osVersionNo->versionMinor); qWarning("Running on an unknown/untested WindowsNT-based OS (v%u.%u).\n", osVersionNo->versionMajor, osVersionNo->versionMinor);
} }
} }
break; break;