[Bug 50580] iTunes 12.11.0.26 installer doesn't recognize WinVer 'Windows 10' setting (WMI 'Win32_OperatingSystem' class uses 'GetVersionEx' API to retrieve OS version info, a deprecated API in Windows 10)
WineHQ Bugzilla
wine-bugs at winehq.org
Fri Jan 29 05:14:34 CST 2021
https://bugs.winehq.org/show_bug.cgi?id=50580
Anastasius Focht <focht at gmx.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |download, Installer
Ever confirmed|0 |1
CC| |focht at gmx.net
Status|UNCONFIRMED |NEW
Component|msi |wmi&wbemprox
Summary|iTunes 12.11.0.26 - |iTunes 12.11.0.26 installer
|installer doesn't recognize |doesn't recognize WinVer
|Windows 10 |'Windows 10' setting (WMI
| |'Win32_OperatingSystem'
| |class uses 'GetVersionEx'
| |API to retrieve OS version
| |info, a deprecated API in
| |Windows 10)
--- Comment #2 from Anastasius Focht <focht at gmx.net> ---
Hello folks,
confirming.
--- snip ---
...
013c:trace:msi:ACTION_LaunchConditions Checking launch conditions
...
013c:trace:msi:ACTION_CustomAction Handling custom action L"WinOSVersion" (141
L"iTunes_CustomActions.dll" L"WinOSVersion")
...
013c:trace:msi:HANDLE_CustomType1 Calling function L"WinOSVersion" from
L"C:\\users\\focht\\Temp\\msi5132.tmp"
...
013c:trace:msi:wait_thread_handle waiting for L"WinOSVersion"
...
0160:Call KERNEL32.LoadLibraryW(000a2590
L"C:\\users\\focht\\Temp\\msi5132.tmp") ret=180025153
...
0160:Ret KERNEL32.LoadLibraryW() retval=014a0000 ret=180025153
0160:Call KERNEL32.GetProcAddress(014a0000,000a4750 "WinOSVersion")
ret=18002516d
0160:Ret KERNEL32.GetProcAddress() retval=014a3450 ret=18002516d
...
0160:Call oleaut32.SysAllocString(015ef790 L"SELECT * FROM
Win32_OperatingSystem") ret=014a6dbc
...
0160:Call KERNEL32.GetVersionExW(015ef4c8) ret=0161842c
...
0160:Call KERNEL32.GetVersionExW(015ef4c8) ret=0161842c
...
0160:Call KERNEL32.GetProductInfo(00000006,00000000,00000000,00000000,015ef418)
ret=01618a46
...
0160:Ret KERNEL32.GetProductInfo() retval=00000001 ret=01618a46
0160:Call KERNEL32.GetNativeSystemInfo(015ef418) ret=01618a63
...
0160:Ret KERNEL32.GetNativeSystemInfo() retval=7b09a958 ret=01618a63
....
0160:Call advapi32.RegOpenKeyExW(ffffffff80000002,01634072
L"Software\\Microsoft\\Windows NT\\CurrentVersion",00000000,00020019,015ef418)
ret=01618adb
...
0160:Call KERNEL32.WideCharToMultiByte(00000000,00000000,000abd38
L"6.2.9200",00000009,00000000,00000000,00000000,00000000) ret=014a6c03
0160:Ret KERNEL32.WideCharToMultiByte() retval=00000009 ret=014a6c03
...
0160:Call msi.MsiRecordSetStringW(00000002,00000000,015cf7f0 L"Operating System
Version number is: 6") ret=014a147a
...
0160:Call msi.MsiSetPropertyW(00000001,014ba550 L"BUSEROSVERSION",015ef8f8
L"6") ret=014a3880
...
0158:trace:msi:msi_set_property 00000000000AA950 L"BUSEROSVERSION" L"6" -1
...
0160:Ret msi.MsiSetPropertyW() retval=00000000 ret=014a3880
...
0160:Call msi.MsiRecordSetStringW(00000002,00000000,015cf7f0 L"Operating System
BuildVersion number is: 9200") ret=014a147a
...
0160:Call msi.MsiSetPropertyW(00000001,014ba5e8 L"BUSEROSBUILDVERSION",015ef8f8
L"9200") ret=014a390f
...
0160:Ret msi.MsiSetPropertyW() retval=00000000 ret=014a390f
...
013c:trace:msi:msi_get_property returning L"6" for property L"BUSEROSVERSION"
...
0024:trace:msi:msi_get_property property L"DISABLE_OS_VERSION_CHECK" not found
0024:trace:msi:MSI_EvaluateConditionW 0 <- L"Installed OR (VersionNT>=603 AND
BUSEROSVERSION AND BUSEROSVERSION>=10) OR DISABLE_OS_VERSION_CHECK"
0024:trace:msi:MSI_FormatRecordW 0017A288 001B8C50 00000000 0031F748
0024:trace:msi:msi_get_property 00157E18 L"ProductName" 00000000 0031F690
0024:trace:msi:MSI_DatabaseOpenViewW L"SELECT `Value` FROM `_Property` WHERE
`_Property`=?" 0031F600
0024:trace:msi:MSI_ParseSQL Parse returned 0
...
013c:Call user32.MessageBoxW(00000000,016db3e0 L"iTunes requires that your
computer is running Windows 10.",18009f418 L"Install Failed",00000000)
ret=18000f47e
--- snip ---
The installer custom action 'WinOSVersion' uses WMI to query for OS version
properties. Wine WMI implementation uses 'GetVersionEx' to retrieve the version
info. GetVersionEx is deprecated starting with Windows 10. Calling
'GetVersionEx' will always return major/minor of 6.2 for backwards
compatibility reasons.
Here is a small vbscript to demonstrate the current Wine behaviour.
Call it 'osversion.vbs':
--- snip ---
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_OperatingSystem",,48)
For Each objItem in colItems
Wscript.Echo "BuildNumber: " & objItem.BuildNumber
Wscript.Echo "BuildType: " & objItem.BuildType
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "CSCreationClassName: " & objItem.CSCreationClassName
Wscript.Echo "CSDVersion: " & objItem.CSDVersion
Wscript.Echo "CSName: " & objItem.CSName
Wscript.Echo "Version: " & objItem.Version
Next
--- snip ---
For testing with different 'WinVer' values use the following scriptlet:
--- snip ---
$ for ver in win7 win8 win81 win10 ; do \
( \
export WINEDEBUG=-all
echo "======" && \
winecfg -v $ver && \
winecfg -v | tee && \
wine cscript osversion.vbs \
) ; done
--- snip ---
NOTE: 'tee' is used to work around console bug, forcing 'winecfg' output.
Output:
--- snip ---
======
win7
BuildNumber: 7601
Caption: Microsoft Windows 7 Professional
CSDVersion: Service Pack 1
CSName: LINUX
Version: 6.1.7601
======
win8
BuildNumber: 9200
Caption: Microsoft Windows 8.1 Pro
CSDVersion:
CSName: LINUX
Version: 6.2.9200
======
win81
BuildNumber: 9200
Caption: Microsoft Windows 8.1 Pro
CSDVersion:
CSName: LINUX
Version: 6.2.9200
======
win10
BuildNumber: 9200
Caption: Microsoft Windows 8.1 Pro
CSDVersion:
CSName: LINUX
Version: 6.2.9200
--- snip ---
Wine source:
https://source.winehq.org/git/wine.git/blob/f72ef20e88fba67254caf0124ab8713e3d15fa2a:/dlls/wbemprox/builtin.c#l3513
--- snip ---
3513 static enum fill_status fill_operatingsystem( struct table *table, const
struct expr *cond )
3514 {
3515 struct record_operatingsystem *rec;
3516 enum fill_status status = FILL_STATUS_UNFILTERED;
3517 OSVERSIONINFOEXW ver;
3518 UINT row = 0;
3519
3520 if (!resize_table( table, 1, sizeof(*rec) )) return
FILL_STATUS_FAILED;
3521
3522 ver.dwOSVersionInfoSize = sizeof(ver);
3523 GetVersionExW( (OSVERSIONINFOW *)&ver );
3524
3525 rec = (struct record_operatingsystem *)table->data;
3526 rec->buildnumber = get_osbuildnumber( &ver );
3527 rec->caption = get_oscaption( &ver );
3528 rec->codeset = get_codeset();
3529 rec->countrycode = get_countrycode();
3530 rec->csdversion = ver.szCSDVersion[0] ? heap_strdupW(
ver.szCSDVersion ) : NULL;
3531 rec->csname = get_computername();
3532 rec->currenttimezone = get_currenttimezone();
3533 rec->freephysicalmemory = get_available_physical_memory() / 1024;
3534 rec->installdate = L"20140101000000.000000+000";
3535 rec->lastbootuptime = get_lastbootuptime();
3536 rec->localdatetime = get_localdatetime();
3537 rec->locale = get_locale();
3538 rec->manufacturer = L"The Wine Project";
3539 rec->name = get_osname( rec->caption );
3540 rec->operatingsystemsku = get_operatingsystemsku();
3541 rec->osarchitecture = get_osarchitecture();
3542 rec->oslanguage = GetSystemDefaultLangID();
3543 rec->osproductsuite = 2461140; /* Windows XP Professional */
3544 rec->ostype = 18; /* WINNT */
3545 rec->primary = -1;
3546 rec->serialnumber = get_osserialnumber();
3547 rec->servicepackmajor = ver.wServicePackMajor;
3548 rec->servicepackminor = ver.wServicePackMinor;
3549 rec->suitemask = 272; /* Single User + Terminal */
3550 rec->systemdirectory = get_systemdirectory();
3551 rec->systemdrive = get_systemdrive();
3552 rec->totalvirtualmemorysize = get_total_physical_memory() / 1024;
3553 rec->totalvisiblememorysize = rec->totalvirtualmemorysize;
3554 rec->version = get_osversion( &ver );
3555 if (!match_row( table, row, cond, &status )) free_row_values( table,
row );
3556 else row++;
3557
3558 TRACE("created %u rows\n", row);
3559 table->num_rows = row;
3560 return status;
3561 }
--- snip ---
This obviously can't work for 'Windows 10' setting.
@winetaste:
--- quote ---
Deleting the second condition fixes this problem and after more testing:
--- quote ---
There is no need for that. You can simply take advantage of the fact there are
'OR' conditions. To bypass the OS version requirement:
--- snip ---
$ wine msiexec -i iTunes64.msi DISABLE_OS_VERSION_CHECK=1
--- snip ---
$ sha1sum iTunes64Setup.exe
f9f299710993b5ea5c7bd430afc451bc908b7208 iTunes64Setup.exe
$ du -sh iTunes64Setup.exe
192M iTunes64Setup.exe
$ wine --version
wine-6.0-293-gf72ef20e88f
Regards
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
More information about the wine-bugs
mailing list