https://bugs.winehq.org/show_bug.cgi?id=35833
Bug ID: 35833 Summary: iTunes 7 installer aborts early (automation methods HRESULT incorrectly translated to VBScript runtime Err.number) Product: Wine Version: 1.7.14 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs@winehq.org Reporter: focht@gmx.net
Hello folks,
now the VBScript runtime error object and exception handling is implemented the next thing :)
Trace log:
--- snip --- $ WINEDEBUG=+tid,+seh,+relay,+msi,+vbscript,+ole,+variant wine ./iTunesSetup7.exe >>log.txt 2>&1 ... 0039:fixme:msi:AutomationObject_GetIDsOfNames Unknown member L"DetectGEARDriverSetDeletion", clsid {000c109e-0000-0000-c000-000000000046} ... 0039:trace:msi:AutomationObject_AddRef (0x183370/0x183370) 0039:trace:vbscript:interp_errmode 1 0039:trace:vbscript:interp_short 2 0039:Call oleaut32.SysAllocString(001f3988 L"SYSTEM\CurrentControlSet\Services\GearAspiWDM") ret=f7343052 0039:trace:ole:SysAllocStringLen L"SYSTEM\CurrentControlSet\Services\GearAspiWDM" 0039:Ret oleaut32.SysAllocString() retval=001f6284 ret=f7343052 0039:trace:vbscript:interp_string 0039:Call oleaut32.SysAllocString(001f39e4 L"DeleteFlag") ret=f7343052 0039:trace:ole:SysAllocStringLen L"DeleteFlag" 0039:Ret oleaut32.SysAllocString() retval=001f97b4 ret=f7343052 0039:trace:vbscript:interp_icall ... 0039:trace:msi:AutomationObject_Invoke Method 11, L"RegistryValue" ... 0039:Call advapi32.RegOpenKeyW(80000002,001f6464 L"SYSTEM\CurrentControlSet\Services\GearAspiWDM",0064df10) ret=7ecdc24c 0039:Ret advapi32.RegOpenKeyW() retval=00000002 ret=7ecdc24c 0039:Call oleaut32.VariantClear(0064def0) ret=7ecdc67d 0039:trace:variant:VariantClear (0x64def0->(VT_I4)) 0039:Ret oleaut32.VariantClear() retval=00000000 ret=7ecdc67d 0039:Call oleaut32.VariantClear(0064dee0) ret=7ecdc68b 0039:trace:variant:VariantClear (0x64dee0->(VT_BSTR)) 0039:Ret oleaut32.VariantClear() retval=00000000 ret=7ecdc68b 0039:Call oleaut32.VariantClear(0064ded0) ret=7ecdc699 0039:trace:variant:VariantClear (0x64ded0->(VT_BSTR)) 0039:Ret oleaut32.VariantClear() retval=00000000 ret=7ecdc699 0039:Call advapi32.RegCloseKey(00000000) ret=7ecdc6a7 0039:Ret advapi32.RegCloseKey() retval=00000006 ret=7ecdc6a7 0039:Call oleaut32.SysFreeString(001f60f4 L"RegistryValue") ret=7ecd7ea6 0039:Ret oleaut32.SysFreeString() retval=00000000 ret=7ecd7ea6 0039:trace:msi:AutomationObject_Invoke Returning 0x8002000b, not ok 0039:trace:msi:AutomationObject_Release (0x185e38/0x185e38) 0039:warn:vbscript:exec_script Failed 8002000b in resume next mode 0039:trace:vbscript:exec_script unwind jmp 642 stack_off 0 ... 0039:fixme:msi:AutomationObject_GetIDsOfNames Unknown member L"Err", clsid {000c109e-0000-0000-c000-000000000046} 0039:trace:vbscript:DispatchEx_AddRef (0x1d92c8) ref=2 0039:trace:vbscript:interp_mcall 0039:trace:ole:ITypeInfo_fnGetIDsOfNames (0x1d8de0) Name L"number" cNames 1 ... 0039:trace:vbscript:Err_Number 0039:trace:vbscript:DispatchEx_Release (0x1d92c8) ref=2 0039:trace:vbscript:DispatchEx_Release (0x1d92c8) ref=1 0039:trace:vbscript:interp_short 9 0039:trace:vbscript:interp_nequal 0039:trace:vbscript:var_cmp {VT_I4: -2147352565} {VT_I2: 9} 0039:Call oleaut32.VarCmp(001f5f70,001f5f80,00000000,00000000) ret=f73439a1 ... 0039:Call oleaut32.VariantClear(001f5f70) ret=f733fecd 0039:trace:variant:VariantClear (0x1f5f70->(VT_I4)) 0039:Ret oleaut32.VariantClear() retval=00000000 ret=f733fecd 0039:Call oleaut32.VariantClear(001f5f80) ret=f733fecd 0039:trace:variant:VariantClear (0x1f5f80->(VT_I2)) 0039:Ret oleaut32.VariantClear() retval=00000000 ret=f733fecd 0039:trace:vbscript:interp_jmp_false 667 ... 0037:Call user32.MessageBoxW(00000000,001e6d38 L"Unable to install the GEAR driver set at this time. The GEARAspiWDM service use by the GEAR driver set is scheduled to be deleted during the next system reboot. Please reboot the system and run iTunes again.",7ed51b92 L"Install Failed",00000000) ret=7ecc3d83 --- snip ---
The relevant VBScript snippet:
--- snip --- Sub DetectGEARDriverSetDeletion Dim DeleteFlag
On Error Resume Next DeleteFlag = Session.Installer.RegistryValue(2,"SYSTEM\CurrentControlSet\Services\GearAspiWDM", "DeleteFlag") If Err.number <> 9 Then If IsNumeric(DeleteFlag) Then Session.Property("GEARASPIWDM_SERVICE_DELETED") = "#" + CStr(DeleteFlag) Else Session.Property("GEARASPIWDM_SERVICE_DELETED") = DeleteFlag End If End If End Sub --- snip ---
MSDN: http://msdn.microsoft.com/en-us/library/aa369471%28v=vs.85%29.aspx
--- quote --- The RegistryValue method of the Installer object reads information about a specified registry key of value. If the key or value specified does not exist, the method returns an error of 9, "Subscript out of Range." --- quote ---
Wine MSI InstallerImpl_RegistryValue() returns HRESULT = 0x8002000B (DISP_E_BADINDEX) which seems to be right. This code needs to be translated to VBScript runtime error code. The equivalent would be something like 0x800A0009 ... if one searches for "Subscript out of Range." and "VBscript".
Source: http://source.winehq.org/git/wine.git/blob/fc0ef22a44dee4f78b8784ada501bb8f0...
--- snip --- 2030 HRESULT exec_script(script_ctx_t *ctx, function_t *func, vbdisp_t *vbthis, DISPPARAMS *dp, VARIANT *res) 2031 { 2032 exec_ctx_t exec = {func->code_ctx}; 2033 vbsop_t op; 2034 HRESULT hres = S_OK; 2035 2036 exec.code = func->code_ctx; ... 2106 while(exec.instr) { 2107 op = exec.instr->op; 2108 hres = op_funcs[op](&exec); 2109 if(FAILED(hres)) { 2110 ctx->err_number = hres; 2111 2112 if(exec.resume_next) { ... --- snip ---
$ sha1sum iTunesSetup7.exe 5cdc86b2edb1411b9a022f05b1bfbe858fbcf901 iTunesSetup7.exe
$ du -sh iTunesSetup7.exe 35M iTunesSetup7.exe
$ wine --version wine-1.7.14-234-g6e7440e
Regards