http://bugs.winehq.org/show_bug.cgi?id=4286
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net
--- Comment #23 from Anastasius Focht focht@gmx.net 2009-04-04 17:57:04 --- Hello,
required prerequisites: clean WINEPREFIX
winetricks msxml3 mdac25 gecko
Native msxml3 because the app requests the free threaded version of DOMDocument (MSXML2.FreeThreadedDOMDocument.3.0) which Wine doesn't provide. MDAC 2.x can be any current version, not limited to 2.5 Gecko engine is needed later for embedded DHTML stuff.
--- quote --- There's a difference in the Windows XP and Wine installs. A folder named "eBay" appears in ~/.wine/drive_c/ when installed with Wine, but under Windows XP this folder appears under C:\Documents and Settings\All Users. According to "wine cmd" the environment variable is set to "ALLUSERSPROFILE=C:\windows\profiles\All Users", but c:\windows\profiles isn't even created during install.
Could it be that the files simply aren't being copied to the correct place? The installer is failing to do it's job? --- quote ---
Yes, it's Wine msi bug.
Dumping directory table with ORCA:
--- snip orca dump --- Directory Directory_Parent DefaultDir s72 S72 l255 TARGETDIR SourceDir ALLUSERSPROFILE TARGETDIR .:ALLUSE~1|All Users ... --- snip orca dump ---
Initial:
--- snip msi trace --- 0022:trace:msi:load_folder L"TARGETDIR" ... 0022:trace:msi:load_folder TargetDefault = L"SourceDir" 0022:trace:msi:load_folder SourceLong = L"SourceDir" 0022:trace:msi:load_folder SourceShort = L"SourceDir"
... 0022:trace:msi:load_folder L"ALLUSERSPROFILE" ... 0022:trace:msi:load_folder TargetDefault = L"" 0022:trace:msi:load_folder SourceLong = L"All Users" 0022:trace:msi:load_folder SourceShort = L"ALLUSE~1" --- snip msi trace ---
The installer executes custom actions to initialize 'USERPROFILE' and 'ALLUSERSPROFILE' properties from environment variables.
--- snip msi trace --- 0022:trace:msi:ACTION_CustomAction Handling custom action L"setUserProfileNT" (33 L"USERPROFILE" L"[%USERPROFILE]") 0022:trace:msidb:MSI_CreateRecord 1 0022:trace:msidb:MSI_RecordSetStringW 0x1b9a10 0 L"[%USERPROFILE]" ... 0022:trace:msi:MSI_FormatRecordW (L"[%USERPROFILE]") ... 0022:trace:msi:MSI_SetPropertyW 0x16cc60 L"USERPROFILE" L"C:\users\focht" 0022:trace:msidb:MSI_CreateRecord 1 ...
0022:trace:msi:ACTION_CustomAction Handling custom action L"setAllUsersProfile2K" (33 L"ALLUSERSPROFILE" L"[%ALLUSERSPROFILE]") 0022:trace:msidb:MSI_CreateRecord 1 0022:trace:msidb:MSI_RecordSetStringW 0x1b7f70 0 L"[%ALLUSERSPROFILE]" ... 0022:trace:msi:MSI_FormatRecordW (L"[%ALLUSERSPROFILE]") 0022:trace:msi:MSI_SetPropertyW 0x16cc60 L"ALLUSERSPROFILE" L"C:\users\Public" --- snip msi trace ---
'ALLUSERSPROFILE' folder gets properly resolved in CostFinalizeDirectories action:
--- snip msi trace --- 0022:trace:msi:ITERATE_CostFinalizeDirectories Dir L"ALLUSERSPROFILE" ... 0022:trace:msi:resolve_folder Working to resolve L"ALLUSERSPROFILE" ... 0022:trace:msi:MSI_GetPropertyW returning L"C:\users\Public" for property L"ALLUSERSPROFILE" 0022:trace:msi:resolve_folder property set to L"C:\users\Public" 0022:trace:msi:ITERATE_CostFinalizeDirectories resolves to L"C:\users\Public" --- snip msi trace ---
and is used later to build various installer paths:
--- snip msi trace --- 0022:trace:msi:MSI_GetPropertyW returning L"C:\users\Public" for property L"ALLUSERSPROFILE" 0022:trace:msi:resolve_folder property set to L"C:\users\Public" ... 0022:trace:msi:MSI_GetPropertyW property L"eBayTLData" not found 0022:trace:msi:resolve_folder ! Parent is L"ALLUSERSPROFILE" 0022:trace:msi:resolve_folder Working to resolve L"ALLUSERSPROFILE" 0022:trace:msi:resolve_folder already resolved to L"C:\users\Public" 0022:trace:msi:resolve_folder TargetDefault = L"eBay" 0022:trace:msi:resolve_folder target -> L"C:\users\Public\eBay\" 0022:trace:msi:MSI_SetPropertyW 0x16cc60 L"eBayTLData" L"C:\users\Public\eBay\" 0022:trace:msidb:MSI_CreateRecord 1 0022:trace:msidb:MSI_RecordSetStringW 0x1785c8 1 L"eBayTLData" --- snip msi trace ---
Some time later ... surprise!
--- snip msi trace --- 0022:trace:msi:MSI_GetPropertyW returning L"C:\" for property L"TARGETDIR" 0022:trace:msi:resolve_folder already resolved to L"C:\" 0022:trace:msi:resolve_folder Working to resolve L"ALLUSERSPROFILE" 0022:trace:msi:resolve_folder ! Parent is L"TARGETDIR" 0022:trace:msi:resolve_folder Working to resolve L"TARGETDIR" 0022:trace:msi:resolve_folder already resolved to L"C:\" 0022:trace:msi:resolve_folder TargetDefault = L"" 0022:trace:msi:resolve_folder target -> L"C:\" 0022:trace:msi:MSI_SetPropertyW 0x16cc60 L"ALLUSERSPROFILE" L"C:\" 0022:trace:msidb:MSI_CreateRecord 1 0022:trace:msidb:MSI_RecordSetStringW 0x17cd88 1 L"ALLUSERSPROFILE" --- snip msi trace ---
'ALLUSERSPROFILE' property is reset to "C:\" which leads to problem that some installation files are put in wrong location.
The reset of resolved target happens in MSI_SetTargetPathW().
--- snip --- 0022:trace:msi:MSI_SetTargetPathW 0x16cc30 L"USERPROFILE" L"C:\users\focht" 0022:trace:msi:resolve_folder Working to resolve L"USERPROFILE" ... --- snip ---
--- snip dlls/msi/install.c --- UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolderPath) { DWORD attrib; LPWSTR path = NULL; LPWSTR path2 = NULL; MSIFOLDER *folder; MSIFILE *file;
... path = resolve_folder(package,szFolder,FALSE,FALSE,FALSE,&folder); if (!path) return ERROR_DIRECTORY;
msi_free(folder->Property); folder->Property = build_directory_name(2, szFolderPath, NULL);
if (lstrcmpiW(path, folder->Property) == 0) { /* * Resolved Target has not really changed, so just * set this folder and do not recalculate everything. */ ... } else { MSIFOLDER *f;
LIST_FOR_EACH_ENTRY( f, &package->folders, MSIFOLDER, entry ) { msi_free(f->ResolvedTarget); f->ResolvedTarget=NULL; } ... } ... } --- snip dlls/msi/install.c ---
Both paths refer to same location ("C:\users\focht\" -> '%USERPROFILE%') but the resolved path taken from property is missing the terminating backslash.
build_directory_name(2, szFolderPath, NULL) will always add terminating backslash -> "C:\users\focht\" resolve_folder(package,szFolder,FALSE,FALSE,FALSE,&folder) will not -> "C:\users\focht"
The path comparison fails and all resolved targets in the package are thrown away to be re-resolved. This renders previous custom actions which set specific path properties useless.
You might want to fix resolve_folder() to have resolved target backslash-terminated when loading from property.
With that problem fixed, the app overcomes the "first user" problem and starts successfully.
Regards