https://bugs.winehq.org/show_bug.cgi?id=38740
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Summary|Mathearbeit installer hangs |Mathearbeit installer hangs |during installation |during installation | |(ShellFolder attributes for | |virtual folder | |'CLSID_Printers', clsid | |'{2227a280-3aea-1069-a2de-0 | |8002b30309d}' missing in | |registry) CC| |focht@gmx.net Component|-unknown |shell32
--- Comment #10 from Anastasius Focht focht@gmx.net --- Hello folks,
confirming.
Relevant part of trace log:
--- snip --- $ WINEDEBUG=+seh,+relay,+shell wine ./setupgs5_6.exe >>log.txt 2>&1 ... 002b:Call KERNEL32.CreateProcessW(00000000,0033eb48 L""C:\users\focht\Temp\_ZupSfx0\setup.exe"",00000000,00000000,00000000,00000410,00000000,00000000,0033e620,0033e610) ret=7d759922 ... 002d:Ret KERNEL32.__wine_kernel_init() retval=7b46ec28 ret=7bc6e36d 002b:Ret KERNEL32.CreateProcessW() retval=00000001 ret=7d759922 ... 002d:Call shell32.SHGetSpecialFolderLocation(00000000,00000004,0032ef84) ret=004d50bf ... 002d:trace:shell:SHGetFolderLocation -- (new pidl 0xae7c60) 002d:Ret shell32.SHGetSpecialFolderLocation() retval=00000000 ret=004d50bf 002d:Call shell32.SHGetPathFromIDListA(00ae7c60,0167c00c) ret=004d50e7 002d:trace:shell:SHGetPathFromIDListEx (pidl=0xae7c60,0x32ed04,260,0) 002d:trace:shell:SHBindToParent pidl=0xae7c60 002d:trace:shell:SHGetDesktopFolder (0x32ead0) ... 002d:trace:shell:SHGetDesktopFolder -- 0x32ead0->(0x1afec0) 0x00000000 ... 002d:trace:shell:ISF_Desktop_fnBindToObject (0x1afec0)->(pidl=0xaf4a60,(nil),{000214e6-0000-0000-c000-000000000046} (IID_IShellFolder),0x32ec54) 002d:trace:shell:SHELL32_BindToChild (0x1afee8 L"C:\users\focht\Desktop" 0xaf4a60 {000214e6-0000-0000-c000-000000000046} 0x32ec54) ... 002d:trace:shell:DllGetClassObject CLSID:{20d04fe0-3aea-1069-a2d8-08002b30309d} (My Computer),IID:{00000001-0000-0000-c000-000000000046} (IID_IClassFactory) ... 002d:trace:shell:SHBindToParent -- psf=0xae7cb8 pidl=0xae7c74 ret=0x00000000 002d:trace:shell:ISF_MyComputer_fnGetAttributesOf (0xae7cb8)->(cidl=1 apidl=0x32ec58 mask=0x32ec50 (0x40000000)) 002d:trace:shell:SHELL32_GetItemAttributes 0x40000000 002d:trace:shell:HCR_GetFolderAttributes (pidlFolder=0xae7c74, pdwAttributes=0x32ea8c) ... 002d:Call advapi32.RegOpenKeyExW(80000000,0032e676 L"CLSID\{2227A280-3AEA-1069-A2DE-08002B30309D}\ShellFolder",00000000,00020019,0032e6f4) ret=7d70e132 002d:Ret advapi32.RegOpenKeyExW() retval=00000002 ret=7d70e132 002d:trace:shell:ISF_MyComputer_fnGetDisplayNameOf (0xae7cb8)->(pidl=0xae7c74,0x00008000,0x32e77c) ... 002d:Call shlwapi.SHGetValueW(80000000,0032e634 L"CLSID\{2227a280-3aea-1069-a2de-08002b30309d}\shellfolder",7d7991c0 L"WantsForParsing",00000000,00000000,00000000) ret=7d757936 002d:trace:shell:SHGetValueW (hkey=0x80000000,L"CLSID\{2227a280-3aea-1069-a2de-08002b30309d}\shellfolder",L"WantsForParsing",(nil),(nil),(nil)) 002d:Call advapi32.RegOpenKeyExW(80000000,0032e634 L"CLSID\{2227a280-3aea-1069-a2de-08002b30309d}\shellfolder",00000000,00000001,0032e590) ret=7d6903ac 002d:Ret advapi32.RegOpenKeyExW() retval=00000002 ret=7d6903ac 002d:Ret shlwapi.SHGetValueW() retval=00000002 ret=7d757936 ... 002d:trace:shell:ISF_MyComputer_fnGetDisplayNameOf -- (0xae7cb8)->(L"::{20d04fe0-3aea-1069-a2d8-08002b30309d}\::{2227a280-3aea-1069-a2de-08002b30309d}") ... 002d:trace:shell:SHELL32_GetItemAttributes -- 0x40000177 002d:trace:shell:ISF_MyComputer_fnGetAttributesOf -- result=0x40000177 002d:trace:shell:ISF_MyComputer_fnGetDisplayNameOf (0xae7cb8)->(pidl=0xae7c74,0x00008000,0x32eb48) ... 002d:Call shlwapi.SHGetValueW(80000000,0032ea04 L"CLSID\{2227a280-3aea-1069-a2de-08002b30309d}\shellfolder",7d7991c0 L"WantsForParsing",00000000,00000000,00000000) ret=7d757936 002d:trace:shell:SHGetValueW (hkey=0x80000000,L"CLSID\{2227a280-3aea-1069-a2de-08002b30309d}\shellfolder",L"WantsForParsing",(nil),(nil),(nil)) 002d:Call advapi32.RegOpenKeyExW(80000000,0032ea04 L"CLSID\{2227a280-3aea-1069-a2de-08002b30309d}\shellfolder",00000000,00000001,0032e960) ret=7d6903ac 002d:Ret advapi32.RegOpenKeyExW() retval=00000002 ret=7d6903ac 002d:Ret shlwapi.SHGetValueW() retval=00000002 ret=7d757936 ... 002d:trace:shell:ISF_MyComputer_fnGetDisplayNameOf -- (0xae7cb8)->(L"::{20d04fe0-3aea-1069-a2d8-08002b30309d}\::{2227a280-3aea-1069-a2de-08002b30309d}") 002d:trace:shell:ISF_MyComputer_fnRelease (0xae7cb8)->(count=1) 002d:trace:shell:ISF_MyComputer_fnRelease -- destroying IShellFolder(0xae7cb8) ... 002d:trace:shell:SHGetPathFromIDListEx -- L"::{20d04fe0-3aea-1069-a2d8-08002b30309d}\::{2227a280-3aea-1069-a2de-08002b30309d}", 0x00000000 ... 002d:Ret shell32.SHGetPathFromIDListA() retval=00000001 ret=004d50e7 --- snip ---
The app installer issues a number of 'shell32.SHGetPathFromIDListA()' calls for various special folders.
The problematic one is '{2227a280-3aea-1069-a2de-08002b30309d}' -> 'Printers and Faxes' virtual folder.
https://source.winehq.org/git/wine.git/blob/48e6f8f99dfb11d0f0a15f55665afd8a...
--- snip --- 373 /*********************************************************************** 374 * SHELL32_GetItemAttributes 375 * 376 * NOTES 377 * Observed values: 378 * folder: 0xE0000177 FILESYSTEM | HASSUBFOLDER | FOLDER 379 * file: 0x40000177 FILESYSTEM 380 * drive: 0xf0000144 FILESYSTEM | HASSUBFOLDER | FOLDER | FILESYSANCESTOR 381 * mycomputer: 0xb0000154 HASSUBFOLDER | FOLDER | FILESYSANCESTOR 382 * (seems to be default for shell extensions if no registry entry exists) 383 * 384 * win2k: 385 * folder: 0xF0400177 FILESYSTEM | HASSUBFOLDER | FOLDER | FILESYSANCESTOR | CANMONIKER 386 * file: 0x40400177 FILESYSTEM | CANMONIKER 387 * drive 0xF0400154 FILESYSTEM | HASSUBFOLDER | FOLDER | FILESYSANCESTOR | CANMONIKER | CANRENAME (LABEL) 388 * 389 * According to the MSDN documentation this function should not set flags. It claims only to reset flags when necessary. 390 * However it turns out the native shell32.dll _sets_ flags in several cases - so do we. 391 */ 392 HRESULT SHELL32_GetItemAttributes (IShellFolder2 *psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes) 393 { 394 DWORD dwAttributes; 395 BOOL has_guid; 396 static const DWORD dwSupportedAttr= 397 SFGAO_CANCOPY | /*0x00000001 */ 398 SFGAO_CANMOVE | /*0x00000002 */ 399 SFGAO_CANLINK | /*0x00000004 */ 400 SFGAO_CANRENAME | /*0x00000010 */ 401 SFGAO_CANDELETE | /*0x00000020 */ 402 SFGAO_HASPROPSHEET | /*0x00000040 */ 403 SFGAO_DROPTARGET | /*0x00000100 */ 404 SFGAO_LINK | /*0x00010000 */ 405 SFGAO_READONLY | /*0x00040000 */ 406 SFGAO_HIDDEN | /*0x00080000 */ 407 SFGAO_FILESYSANCESTOR | /*0x10000000 */ 408 SFGAO_FOLDER | /*0x20000000 */ 409 SFGAO_FILESYSTEM | /*0x40000000 */ 410 SFGAO_HASSUBFOLDER; /*0x80000000 */ 411 412 TRACE ("0x%08x\n", *pdwAttributes); 413 414 if (*pdwAttributes & ~dwSupportedAttr) 415 { 416 WARN ("attributes 0x%08x not implemented\n", (*pdwAttributes & ~dwSupportedAttr)); 417 *pdwAttributes &= dwSupportedAttr; 418 } 419 420 has_guid = _ILGetGUIDPointer(pidl) != NULL; 421 422 dwAttributes = *pdwAttributes; 423 424 if (_ILIsDrive (pidl)) { 425 *pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FILESYSTEM|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR| 426 SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANLINK; 427 } else if (has_guid && HCR_GetFolderAttributes(pidl, &dwAttributes)) { 428 *pdwAttributes = dwAttributes; 429 } else if (_ILGetDataPointer (pidl)) { 430 dwAttributes = _ILGetFileAttributes (pidl, NULL, 0); 431 432 if (!dwAttributes && has_guid) { 433 WCHAR path[MAX_PATH]; 434 STRRET strret; 435 436 /* File attributes are not present in the internal PIDL structure, so get them from the file system. */ 437 438 HRESULT hr = IShellFolder2_GetDisplayNameOf(psf, pidl, SHGDN_FORPARSING, &strret); 439 if (SUCCEEDED(hr)) { 440 hr = StrRetToBufW(&strret, pidl, path, MAX_PATH); 441 442 /* call GetFileAttributes() only for file system paths, not for parsing names like "::{...}" */ 443 if (SUCCEEDED(hr) && path[0]!=':') 444 dwAttributes = GetFileAttributesW(path); 445 } 446 } 447 448 /* Set common attributes */ 449 *pdwAttributes |= SFGAO_FILESYSTEM | SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANDELETE | 450 SFGAO_CANRENAME | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANCOPY; 451 452 if (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) 453 *pdwAttributes |= (SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR); 454 else 455 *pdwAttributes &= ~(SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR); 456 457 if (dwAttributes & FILE_ATTRIBUTE_HIDDEN) 458 *pdwAttributes |= SFGAO_HIDDEN; 459 else 460 *pdwAttributes &= ~SFGAO_HIDDEN; 461 462 if (dwAttributes & FILE_ATTRIBUTE_READONLY) 463 *pdwAttributes |= SFGAO_READONLY; 464 else 465 *pdwAttributes &= ~SFGAO_READONLY; 466 467 if (SFGAO_LINK & *pdwAttributes) { 468 char ext[MAX_PATH]; 469 470 if (!_ILGetExtension(pidl, ext, MAX_PATH) || lstrcmpiA(ext, "lnk")) 471 *pdwAttributes &= ~SFGAO_LINK; 472 } 473 } else { 474 *pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME|SFGAO_CANLINK; 475 } 476 TRACE ("-- 0x%08x\n", *pdwAttributes); 477 return S_OK; 478 } --- snip ---
Due to missing ShellFolder attributes registry value for this special virtual folder, the default attributes 'SFGAO_FILESYSTEM | xxx' are taken. The app installer is told this folder is filesystem-backed which doesn't make sense.
This leads to an endless loop in the installer later while trying to break down/validate all path elements.
--- snip --- ... 002d:Call shell32.SHGetFileInfoA(0162c1bc "::{20d04fe0-3aea-1069-a2d8-08002b30309d}\::{2227a280-3aea-1069-a2de-08002b30309d}",00000000,0032db94,00000160,00000200) ret=004d3f94 ... 002d:trace:shell:SHGetFileInfoW icon=0xf7ba00f5 index=0x00000000 attr=0x32363189 name=L"Printers and Faxes" type=L"" ret=0x00000001 ... 002d:Ret shell32.SHGetFileInfoA() retval=00000001 ret=004d3f94 ... 002d:Call KERNEL32.GetFileAttributesA(015c9608 "::{20d04fe0-3aea-1069-a2d8-08002b30309d}\::") ret=004707c0 002d:Ret KERNEL32.GetFileAttributesA() retval=ffffffff ret=004707c0 002d:Call shell32.SHGetFileInfoA(015c9608 "::{20d04fe0-3aea-1069-a2d8-08002b30309d}\::",00000000,0032db94,00000160,00000200) ret=004d3f94 ... 002d:Ret shell32.SHGetFileInfoA() retval=00000001 ret=004d3f94 002d:Call KERNEL32.GetFileAttributesA(015c9a70 "::{20d04fe0-3aea-1069-a2d8-08002b30309d}\::") ret=004707c0 002d:Ret KERNEL32.GetFileAttributesA() retval=ffffffff ret=004707c0 002d:Call shell32.SHGetFileInfoA(015c9a70 "::{20d04fe0-3aea-1069-a2d8-08002b30309d}\::",00000000,0032db94,00000160,00000200) ret=004d3f94 ... <repeats endlessly> --- snip ---
https://docs.microsoft.com/en-us/windows/desktop/shell/sfgao
You might want to register the special folder (CLSID_Printers) with proper attributes in registry. At least 'SFGAO_FOLDER'.
https://source.winehq.org/git/wine.git/blob/48e6f8f99dfb11d0f0a15f55665afd8a...
--- snip --- 4618 /****************************************************************************** 4619 * set_folder_attributes 4620 * 4621 * Set the various folder attributes registry keys. 4622 */ 4623 static HRESULT set_folder_attributes(void) 4624 { 4625 static const WCHAR clsidW[] = {'C','L','S','I','D','\',0 }; 4626 static const WCHAR shellfolderW[] = {'\','S','h','e','l','l','F','o','l','d','e','r', 0 }; 4627 static const WCHAR wfparsingW[] = {'W','a','n','t','s','F','O','R','P','A','R','S','I','N','G',0}; 4628 static const WCHAR wfdisplayW[] = {'W','a','n','t','s','F','O','R','D','I','S','P','L','A','Y',0}; 4629 static const WCHAR hideasdeleteW[] = {'H','i','d','e','A','s','D','e','l','e','t','e','P','e','r','U','s','e','r',0}; 4630 static const WCHAR cfattributesW[] = {'C','a','l','l','F','o','r','A','t','t','r','i','b','u','t','e','s',0}; 4631 static const WCHAR emptyW[] = {0}; 4632 4633 static const struct 4634 { 4635 const CLSID *clsid; 4636 BOOL wfparsing : 1; 4637 BOOL wfdisplay : 1; 4638 BOOL hideasdel : 1; 4639 DWORD attr; 4640 DWORD call_for_attr; 4641 } folders[] = 4642 { 4643 { &CLSID_UnixFolder, TRUE, FALSE, FALSE }, 4644 { &CLSID_UnixDosFolder, TRUE, FALSE, FALSE, 4645 SFGAO_FILESYSANCESTOR|SFGAO_FOLDER|SFGAO_HASSUBFOLDER, SFGAO_FILESYSTEM }, 4646 { &CLSID_FolderShortcut, FALSE, FALSE, FALSE, 4647 SFGAO_FILESYSTEM|SFGAO_FOLDER|SFGAO_LINK, 4648 SFGAO_HASSUBFOLDER|SFGAO_FILESYSTEM|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR }, 4649 { &CLSID_MyDocuments, TRUE, FALSE, FALSE, 4650 SFGAO_FILESYSANCESTOR|SFGAO_FOLDER|SFGAO_HASSUBFOLDER, SFGAO_FILESYSTEM }, 4651 { &CLSID_RecycleBin, FALSE, FALSE, FALSE, 4652 SFGAO_FOLDER|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET }, 4653 { &CLSID_ControlPanel, FALSE, TRUE, TRUE, 4654 SFGAO_FOLDER|SFGAO_HASSUBFOLDER } 4655 }; ... --- snip ---
With that one fixed, the installer runs to completion.
$ sha1sum setupgs5_6.exe fbbbae71ce4214e3848ae29399fa3b271bd6763f setupgs5_6.exe
$ du -sh setupgs5_6.exe 5.8M setupgs5_6.exe
$ wine --version wine-4.2
Regards