From: Jason Overland Subject: winecfg: add all Windows versions and accompanying error message (try 5) Message-Id: <554296F6.2080900@gmail.com> Date: Thu, 30 Apr 2015 13:56:22 -0700 This supercedes winecfg: add all Windows versions and accompanying error message (try 4). Changes since try 4: Windows versions that are unavailable in 64 bit prefixes now have a different text in the combobox saying as such. They still display an error dialog if the user tries to select them. From f26da130351388e42b7582bf00a8b9377cfc022c Mon Sep 17 00:00:00 2001 From: Jason Overland Date: Thu, 30 Apr 2015 13:46:25 -0700 Subject: winecfg: add all Windows versions and accompanying error message (try 5) --- programs/winecfg/appdefaults.c | 86 +++++++++++++++++++++++++++++++++--------- programs/winecfg/resource.h | 2 + programs/winecfg/winecfg.rc | 15 ++++++++ 3 files changed, 85 insertions(+), 18 deletions(-) diff --git a/programs/winecfg/appdefaults.c b/programs/winecfg/appdefaults.c index fad9e5c..53ad4fe 100644 --- a/programs/winecfg/appdefaults.c +++ b/programs/winecfg/appdefaults.c @@ -31,9 +31,16 @@ #include "wine/unicode.h" #include "winecfg.h" #include "resource.h" +#include "shellapi.h" WINE_DEFAULT_DEBUG_CHANNEL(winecfg); +#ifdef _WIN64 + #define UNAVAILABLE_IN_64_BIT(x) x " unavailable in 64 bit" +#else + #define UNAVAILABLE_IN_64_BIT(x) x +#endif + static const struct { const char *szVersion; @@ -46,29 +53,30 @@ static const struct WORD wServicePackMajor; WORD wServicePackMinor; const char *szProductType; + BOOL bRequires32BitPrefix; } win_versions[] = { - { "win81", "Windows 8.1", 6, 3, 0x2580,VER_PLATFORM_WIN32_NT, " ", 0, 0, "WinNT"}, - { "win8", "Windows 8", 6, 2, 0x23F0,VER_PLATFORM_WIN32_NT, " ", 0, 0, "WinNT"}, - { "win2008r2", "Windows 2008 R2", 6, 1, 0x1DB1,VER_PLATFORM_WIN32_NT, "Service Pack 1", 1, 0, "ServerNT"}, - { "win7", "Windows 7", 6, 1, 0x1DB1,VER_PLATFORM_WIN32_NT, "Service Pack 1", 1, 0, "WinNT"}, - { "win2008", "Windows 2008", 6, 0, 0x1772,VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "ServerNT"}, - { "vista", "Windows Vista", 6, 0, 0x1772,VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "WinNT"}, - { "win2003", "Windows 2003", 5, 2, 0xECE, VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "ServerNT"}, + { "win81", "Windows 8.1", 6, 3, 0x2580,VER_PLATFORM_WIN32_NT, " ", 0, 0, "WinNT", FALSE}, + { "win8", "Windows 8", 6, 2, 0x23F0,VER_PLATFORM_WIN32_NT, " ", 0, 0, "WinNT", FALSE}, + { "win2008r2", "Windows 2008 R2", 6, 1, 0x1DB1,VER_PLATFORM_WIN32_NT, "Service Pack 1", 1, 0, "ServerNT", FALSE}, + { "win7", "Windows 7", 6, 1, 0x1DB1,VER_PLATFORM_WIN32_NT, "Service Pack 1", 1, 0, "WinNT", FALSE}, + { "win2008", "Windows 2008", 6, 0, 0x1772,VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "ServerNT", FALSE}, + { "vista", "Windows Vista", 6, 0, 0x1772,VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "WinNT", FALSE}, + { "win2003", "Windows 2003", 5, 2, 0xECE, VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "ServerNT", FALSE}, #ifdef _WIN64 - { "winxp64", "Windows XP", 5, 2, 0xECE, VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "WinNT"}, + { "winxp64", "Windows XP", 5, 2, 0xECE, VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "WinNT", FALSE}, #else - { "winxp", "Windows XP", 5, 1, 0xA28, VER_PLATFORM_WIN32_NT, "Service Pack 3", 3, 0, "WinNT"}, - { "win2k", "Windows 2000", 5, 0, 0x893, VER_PLATFORM_WIN32_NT, "Service Pack 4", 4, 0, "WinNT"}, - { "winme", "Windows ME", 4, 90, 0xBB8, VER_PLATFORM_WIN32_WINDOWS, " ", 0, 0, ""}, - { "win98", "Windows 98", 4, 10, 0x8AE, VER_PLATFORM_WIN32_WINDOWS, " A ", 0, 0, ""}, - { "win95", "Windows 95", 4, 0, 0x3B6, VER_PLATFORM_WIN32_WINDOWS, "", 0, 0, ""}, - { "nt40", "Windows NT 4.0", 4, 0, 0x565, VER_PLATFORM_WIN32_NT, "Service Pack 6a", 6, 0, "WinNT"}, - { "nt351", "Windows NT 3.51", 3, 51, 0x421, VER_PLATFORM_WIN32_NT, "Service Pack 5", 5, 0, "WinNT"}, - { "win31", "Windows 3.1", 3, 10, 0, VER_PLATFORM_WIN32s, "Win32s 1.3", 0, 0, ""}, - { "win30", "Windows 3.0", 3, 0, 0, VER_PLATFORM_WIN32s, "Win32s 1.3", 0, 0, ""}, - { "win20", "Windows 2.0", 2, 0, 0, VER_PLATFORM_WIN32s, "Win32s 1.3", 0, 0, ""} + { "winxp", UNAVAILABLE_IN_64_BIT("Windows XP"), 5, 1, 0xA28, VER_PLATFORM_WIN32_NT, "Service Pack 3", 3, 0, "WinNT", TRUE}, #endif + { "win2k", UNAVAILABLE_IN_64_BIT("Windows 2000"), 5, 0, 0x893, VER_PLATFORM_WIN32_NT, "Service Pack 4", 4, 0, "WinNT", TRUE}, + { "winme", UNAVAILABLE_IN_64_BIT("Windows ME"), 4, 90, 0xBB8, VER_PLATFORM_WIN32_WINDOWS, " ", 0, 0, "", TRUE}, + { "win98", UNAVAILABLE_IN_64_BIT("Windows 98"), 4, 10, 0x8AE, VER_PLATFORM_WIN32_WINDOWS, " A ", 0, 0, "", TRUE}, + { "win95", UNAVAILABLE_IN_64_BIT("Windows 95"), 4, 0, 0x3B6, VER_PLATFORM_WIN32_WINDOWS, "", 0, 0, "", TRUE}, + { "nt40", UNAVAILABLE_IN_64_BIT("Windows NT 4.0"), 4, 0, 0x565, VER_PLATFORM_WIN32_NT, "Service Pack 6a", 6, 0, "WinNT", TRUE}, + { "nt351", UNAVAILABLE_IN_64_BIT("Windows NT 3.51"), 3, 51, 0x421, VER_PLATFORM_WIN32_NT, "Service Pack 5", 5, 0, "WinNT", TRUE}, + { "win31", UNAVAILABLE_IN_64_BIT("Windows 3.1"), 3, 10, 0, VER_PLATFORM_WIN32s, "Win32s 1.3", 0, 0, "", TRUE}, + { "win30", UNAVAILABLE_IN_64_BIT("Windows 3.0"), 3, 0, 0, VER_PLATFORM_WIN32s, "Win32s 1.3", 0, 0, "", TRUE}, + { "win20", UNAVAILABLE_IN_64_BIT("Windows 2.0"), 2, 0, 0, VER_PLATFORM_WIN32s, "Win32s 1.3", 0, 0, "", TRUE} }; #define NB_VERSIONS (sizeof(win_versions)/sizeof(win_versions[0])) @@ -399,9 +407,51 @@ static void on_remove_app_click(HWND dialog) SendMessageW(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0); } +#ifdef _WIN64 +static INT_PTR WINAPI win_ver_error_dlg_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static const WCHAR openW[] = {'o','p','e','n',0}; + switch (msg) + { + case WM_INITDIALOG: + { + return TRUE; + } + case WM_NOTIFY: + switch (((NMHDR *)lParam)->code) + { + case NM_CLICK: + case NM_RETURN: + if (wParam == IDC_WIN_VER_TEXT) + ShellExecuteW( NULL, openW, ((NMLINK *)lParam)->item.szUrl, NULL, NULL, SW_SHOW ); + break; + } + break; + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDOK: + case IDCANCEL: + EndDialog(hwnd, LOWORD(wParam)); + return TRUE; + } + return TRUE; + } + return FALSE; +} +#endif + static void on_winver_change(HWND dialog) { int selection = SendDlgItemMessageW(dialog, IDC_WINVER, CB_GETCURSEL, 0, 0); +#ifdef _WIN64 + if (win_versions[selection-1].bRequires32BitPrefix) + { + DialogBoxW(GetModuleHandleW(NULL), MAKEINTRESOURCEW(IDD_WINVERERROR), dialog, win_ver_error_dlg_proc); + update_comboboxes(dialog); + return; + } +#endif if (current_app) { diff --git a/programs/winecfg/resource.h b/programs/winecfg/resource.h index 8604fb4..ee2233a 100644 --- a/programs/winecfg/resource.h +++ b/programs/winecfg/resource.h @@ -54,6 +54,7 @@ #define IDD_DLLCFG 111 #define IDD_DRIVECFG 112 #define IDD_DESKTOP_INTEGRATION 115 +#define IDD_WINVERERROR 116 #define IDC_WINVER 1012 #define IDC_DESKTOP_WIDTH 1023 #define IDC_DESKTOP_HEIGHT 1024 @@ -135,6 +136,7 @@ #define IDC_APP_LISTVIEW 1200 #define IDC_APP_ADDAPP 1201 #define IDC_APP_REMOVEAPP 1202 +#define IDC_WIN_VER_TEXT 1205 /* audio tab */ #define IDC_AUDIO_TEST 1300 diff --git a/programs/winecfg/winecfg.rc b/programs/winecfg/winecfg.rc index 221916b..b59ec87 100644 --- a/programs/winecfg/winecfg.rc +++ b/programs/winecfg/winecfg.rc @@ -161,6 +161,21 @@ BEGIN COMBOBOX IDC_WINVER,100,194,145,56,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END +IDD_WINVERERROR DIALOGEX 100, 100, 238, 95 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Error: Invalid selection" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "This Wine prefix is built to support 64 bit applications. \ + Because the Windows version you selected does not support 64 bit applications, \ + this prefix cannot be configured to mimic that version of Windows.", + IDC_STATIC,5,5,220,40 + CONTROL "Please refer to the Wine FAQ \ + for instructions on how to create a 32 bit Wine prefix.", + IDC_WIN_VER_TEXT,"SysLink",0,5,40,220,70 + DEFPUSHBUTTON "Close", IDOK, 175, 75, 60, 16, WS_TABSTOP +END + IDD_GRAPHCFG DIALOG 0, 0, 260, 220 STYLE WS_CHILD | WS_DISABLED FONT 8, "MS Shell Dlg" -- 1.9.1