Louis Lenders sent the following url patch to fix bug #28065, it was rejected because it fixes the product name so even if you set other version inside winecfg the registry entry will still say "Windows XP". http://www.winehq.org/pipermail/wine-patches/2011-August/105414.html
I have made a small change to winecfg to make it save the correct ProductName based on the selected OS and would like comments. If I ever send my patch to git Louis Lenders patch will need to get in too because we would need a default ProductName setting in registry and his patch was correct because the default wine OS is XP, am I right? The patch is quite simple and it tries to never let 2 ProductName exist in different windows versions. Thanks in advance, Bruno
diff --git a/programs/winecfg/appdefaults.c b/programs/winecfg/appdefaults.c index f90607e..55dd444 100644 --- a/programs/winecfg/appdefaults.c +++ b/programs/winecfg/appdefaults.c @@ -415,11 +415,14 @@ static void on_winver_change(HWND dialog) { static const char szKeyWindNT[] = "System\\CurrentControlSet\\Control\\Windows"; static const char szKeyEnvNT[] = "System\\CurrentControlSet\\Control\\Session Manager\\Environment"; - char Buffer[40]; - + char Buffer[40] = {'M', 'i', 'c', 'r', 'o', 's', 'o', 'f', 't', ' ', '\0' }; + strcat(Buffer, win_versions[selection].szDescription); + switch (win_versions[selection].dwPlatformId) { case VER_PLATFORM_WIN32_WINDOWS: + set_reg_key(HKEY_LOCAL_MACHINE, szKeyNT, "ProductName", NULL); + set_reg_key(HKEY_LOCAL_MACHINE, szKey9x, "ProductName", Buffer); snprintf(Buffer, sizeof(Buffer), "%d.%d.%d", win_versions[selection].dwMajorVersion, win_versions[selection].dwMinorVersion, win_versions[selection].dwBuildNumber); set_reg_key(HKEY_LOCAL_MACHINE, szKey9x, "VersionNumber", Buffer); @@ -435,6 +438,8 @@ static void on_winver_change(HWND dialog) break; case VER_PLATFORM_WIN32_NT: + set_reg_key(HKEY_LOCAL_MACHINE, szKey9x, "ProductName", NULL); + set_reg_key(HKEY_LOCAL_MACHINE, szKeyNT, "ProductName", Buffer); snprintf(Buffer, sizeof(Buffer), "%d.%d", win_versions[selection].dwMajorVersion, win_versions[selection].dwMinorVersion); set_reg_key(HKEY_LOCAL_MACHINE, szKeyNT, "CurrentVersion", Buffer); @@ -453,6 +458,8 @@ static void on_winver_change(HWND dialog) break; case VER_PLATFORM_WIN32s: + set_reg_key(HKEY_LOCAL_MACHINE, szKey9x, "ProductName", NULL); + set_reg_key(HKEY_LOCAL_MACHINE, szKeyNT, "ProductName", NULL); set_reg_key(HKEY_LOCAL_MACHINE, szKeyNT, "CSDVersion", NULL); set_reg_key(HKEY_LOCAL_MACHINE, szKeyNT, "CurrentVersion", NULL); set_reg_key(HKEY_LOCAL_MACHINE, szKeyNT, "CurrentBuildNumber", NULL);