[Bug 49352] JamKazam 1.0.3744 msi installer fails at 'InstallFiles' action (incorrect handling of administrative image with compressed source files)

WineHQ Bugzilla wine-bugs at winehq.org
Tue Jun 9 10:46:49 CDT 2020


https://bugs.winehq.org/show_bug.cgi?id=49352

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |focht at gmx.net
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |download, Installer
            Summary|JamKazam msi installer      |JamKazam 1.0.3744 msi
                   |fails at copy               |installer fails at
                   |                            |'InstallFiles' action
                   |                            |(incorrect handling of
                   |                            |administrative image with
                   |                            |compressed source files)
     Ever confirmed|0                           |1
                URL|                            |https://www.jamkazam.com/do
                   |                            |wnloads

--- Comment #1 from Anastasius Focht <focht at gmx.net> ---
Hello folks,

confirming.

https://d34f55ppvvtgi3.cloudfront.net/artifacts/JamClient/Win32/1.0.3744/JamKazam-1.0.3744.msi

--- snip ---
$ WINEDEBUG=+msi wine msiexec -i JamKazam-1.0.3744.msi >>log.txt 2>&1
...
0178:warn:msidb:read_stream_data open stream failed r = 80030002 - empty table?
0178:trace:msi:msi_get_suminfo 00EDA7F0, 0
0178:trace:msi:load_summary_info 00EFBB20 00EFAFE0
0178:trace:msi:parse_suminfo version: 405
0178:trace:msi:parse_suminfo template:
L"Intel;0,1033,4,1029,1030,1031,1034,1036,1040,1041,1043,1044,1045,1049,1053,31748"
0178:trace:msi:msiobj_release object 00EFBB20 destroyed
0178:trace:msi:msi_set_property 00EDA960 L"DATABASE"
L"C:\\windows\\Installer\\a041.msi" -1
0178:trace:msi:msi_get_property 00EDA960 L"DATABASE" 00000000 0031F6FC 
...
0178:trace:msi:msi_schedule_action Scheduling action L"InstallFiles" in script
2
0178:trace:msi:ACTION_PerformAction Performing action (L"InstallFiles")
...
0178:trace:msi:msi_get_property returning L"Z:\\home\\focht\\Downloads\\" for
property L"SOURCEDIR"
0178:trace:msi:calculate_install_state installing L"avcodec_56.dll" (missing)
0178:trace:msi:calculate_install_state installing L"avdevice_56.dll" (missing)
0178:trace:msi:calculate_install_state installing L"avfilter_5.dll" (missing)
...
0178:trace:msi:msi_get_property returning
L"Z:\\home\\focht\\Downloads\\JamKazam-1.0.3744.msi" for property
L"OriginalDatabase"
0178:trace:msi:msi_load_media_info sequence 1 -> cabinet L"#JamKazam.cab" disk
id 1
0178:trace:msi:msi_resolve_file_source Working to resolve source of file
L"avcodec_56.dll"
0178:trace:msi:msi_resolve_source_folder working to resolve L"INSTALLDIR"
0178:trace:msi:msi_resolve_source_folder  ! parent is L"ProgramFilesFolder"
0178:trace:msi:msi_resolve_source_folder working to resolve
L"ProgramFilesFolder"
0178:trace:msi:msi_resolve_source_folder  ! parent is L"TARGETDIR"
0178:trace:msi:msi_resolve_source_folder working to resolve L"TARGETDIR"
...
0178:trace:msi:msi_get_property returning
L"Z:\\home\\focht\\Downloads\\JamKazam-1.0.3744.msi" for property
L"OriginalDatabase"
0178:trace:msi:msi_load_media_info sequence 1 -> cabinet L"#JamKazam.cab" disk
id 1
0178:trace:msi:msi_resolve_file_source Working to resolve source of file
L"avcodec_56.dll"
0178:trace:msi:msi_resolve_source_folder working to resolve L"INSTALLDIR"
0178:trace:msi:msi_resolve_source_folder  ! parent is L"ProgramFilesFolder"
0178:trace:msi:msi_resolve_source_folder working to resolve
L"ProgramFilesFolder"
0178:trace:msi:msi_resolve_source_folder  ! parent is L"TARGETDIR"
0178:trace:msi:msi_resolve_source_folder working to resolve L"TARGETDIR" 
...
0178:trace:msi:msi_get_property returning L"Z:\\home\\focht\\Downloads\\" for
property L"SourceDir"
0178:trace:msi:msi_resolve_source_folder -> L"Z:\\home\\focht\\Downloads\\"
0178:trace:msi:msi_resolve_file_source file L"avcodec_56.dll" source resolves
to L"Z:\\home\\focht\\Downloads\\avcodec-56.dll"
0178:trace:msi:ACTION_InstallFiles copying
L"Z:\\home\\focht\\Downloads\\avcodec-56.dll" to L"C:\\Program Files
(x86)\\JamKazam\\avcodec-56.dll"
0178:trace:msi:copy_install_file Copying
L"Z:\\home\\focht\\Downloads\\avcodec-56.dll" to L"C:\\Program Files
(x86)\\JamKazam\\avcodec-56.dll"
0178:err:msi:ACTION_InstallFiles Failed to copy
L"Z:\\home\\focht\\Downloads\\avcodec-56.dll" to L"C:\\Program Files
(x86)\\JamKazam\\avcodec-56.dll" (2) 
...
0178:err:msi:execute_script Execution of script 0 halted; action
L"InstallFiles" returned 1603
--- snip ---

The msi package contains compressed source file image. Inspecting the package
with Orca:

Dump of 'Media' table:

--- snip ---
DiskId    LastSequence    DiskPrompt    Cabinet    VolumeLabel    Source
i2    i4    L64    S255    S32    S72
Media    DiskId
1    72        #JamKazam.cab        
--- snip ---

Dump of 'Directory' table:

--- snip ---
Directory    Directory_Parent    DefaultDir
s72    S72    l255

INSTALLDIR    ProgramFilesFolder    JamKazam
ApplicationProgramsFolder    ProgramMenuFolder    JamKazam
QtPluginIconEnginesFolder    QtPluginFolder    nncozvrx|iconengines
QtPluginImageFormatsFolder    QtPluginFolder    9r98ozmh|imageformats
QtPluginPlatformsFolder    QtPluginFolder    i312mgxh|platforms
QtPluginMediaFolder    QtPluginFolder    nyau_krp|mediaservice
QtPluginCryptoFolder    QtPluginFolder    crypto
FfmpegFolder    INSTALLDIR    ffmpeg
ProgramFilesFolder    TARGETDIR    .
TARGETDIR        SourceDir
DesktopFolder    TARGETDIR    .
ProgramMenuFolder    TARGETDIR    .
SqlDrivers    INSTALLDIR    ynwaszq3|sqldrivers
QtPluginFolder    INSTALLDIR    uwwhlcsh|QtPlugins
SystemFolder_x86_VC.194841A2_D0F2_3B96_9F71_05BA91BEA0FA    SystemFolder    .
SystemFolder    ProgramFilesFolder    Sys|System
--- snip ---

TARGETDIR -> DefaultDir -> SourceDir (source is location of original msi)

Dump of 'File' table:

--- snip ---
File    Component_    FileName    FileSize    Version    Language    Attributes
   Sequence
s72    s72    l255    i4    S72    S20    I2    i4

avcodec_56.dll    avcodec_56.dll    nwy83ssc.dll|avcodec-56.dll    10287104   
56.60.100.0    1033    512    1
...
zlib1.dll    zlib1.dll    zlib1.dll    75264    1.2.3.2027    1033    512    72
--- snip ---

I've reordered the entries by sequence number. All files are compressed and
provided with the #JamKazam.cab stream (media table sequence numbers 1..72).
This means none of the file entries need 'msidbFileAttributesCompressed'
(0x4000) or 'msidbFileAttributesNoncompressed' (0x2000) set in 'Attributes'.
The compression state is determinated by 'Word Count' summary property.

https://docs.microsoft.com/en-us/windows/win32/msi/compressed-and-uncompressed-sources

--- quote ---
Compressed Sources

A source consisting entirely of compressed files should include the compressed
flag bit in the Word Count Summary Property. The compressed source files must
be stored in cabinet files located in a data stream inside the .msi file or in
a separate cabinet file located at the root of the source tree. All of the
cabinets in the source must be listed in the Media table.
--- quote ---

https://docs.microsoft.com/en-us/windows/win32/msi/word-count-summary

--- quote ---
Bit 1     0 2
    Source is uncompressed. Source is compressed.
Bit 2     0 4
    Source is original media. Source is a administrative image created by an
administrative installation. 
--- quote ---

Unfortunately Wine's MSI isn't verbose about some important summary information
properties. Adding some trace info helps.

In this case the summary info 'Word Count' property value is 0x6 ->
msidbSumInfoSourceTypeAdminImage | msidbSumInfoSourceTypeCompressed

Apparently Wine doesn't handle this combination properly.

Wine source:

https://source.winehq.org/git/wine.git/blob/17529582402ebe27ef975fc7dcb8353f4f95e629:/dlls/msi/action.c#l1182

--- snip ---
1182 static UINT load_file(MSIRECORD *row, LPVOID param)
1183 {
1184     MSIPACKAGE* package = param;
1185     LPCWSTR component;
1186     MSIFILE *file;
1187 
1188     /* fill in the data */
1189 
1190     file = msi_alloc_zero( sizeof (MSIFILE) );
1191     if (!file)
1192         return ERROR_NOT_ENOUGH_MEMORY;
1193  
1194     file->File = msi_dup_record_field( row, 1 );
1195 
1196     component = MSI_RecordGetString( row, 2 );
1197     file->Component = msi_get_loaded_component( package, component );
1198 
1199     if (!file->Component)
1200     {
1201         WARN("Component not found: %s\n", debugstr_w(component));
1202         msi_free(file->File);
1203         msi_free(file);
1204         return ERROR_SUCCESS;
1205     }
1206 
1207     file->FileName = msi_dup_record_field( row, 3 );
1208     msi_reduce_to_long_filename( file->FileName );
1209 
1210     file->ShortName = msi_dup_record_field( row, 3 );
1211     file->LongName = strdupW( folder_split_path(file->ShortName, '|'));
1212     
1213     file->FileSize = MSI_RecordGetInteger( row, 4 );
1214     file->Version = msi_dup_record_field( row, 5 );
1215     file->Language = msi_dup_record_field( row, 6 );
1216     file->Attributes = MSI_RecordGetInteger( row, 7 );
1217     file->Sequence = MSI_RecordGetInteger( row, 8 );
1218 
1219     file->state = msifs_invalid;
1220 
1221     /* if the compressed bits are not set in the file attributes,
1222      * then read the information from the package word count property
1223      */
1224     if (package->WordCount & msidbSumInfoSourceTypeAdminImage)
1225     {
1226         file->IsCompressed = FALSE;
1227     }
1228     else if (file->Attributes &
1229              (msidbFileAttributesCompressed |
msidbFileAttributesPatchAdded))
1230     {
1231         file->IsCompressed = TRUE;
1232     }
1233     else if (file->Attributes & msidbFileAttributesNoncompressed)
1234     {
1235         file->IsCompressed = FALSE;
1236     }
1237     else
1238     {
1239         file->IsCompressed = package->WordCount &
msidbSumInfoSourceTypeCompressed;
1240     }
1241 
1242     load_file_hash(package, file);
1243     load_file_disk_id(package, file);
1244 
1245     TRACE("File loaded (file %s sequence %u)\n", debugstr_w(file->File),
file->Sequence);
1246 
1247     list_add_tail( &package->files, &file->entry );
1248  
1249     return ERROR_SUCCESS;
1250 }
--- snip ---

With 'WordCount' property 'msidbSumInfoSourceTypeAdminImage' bit set, all files
will be treated as 'uncompressed' although 'msidbSumInfoSourceTypeCompressed'
bit is set as well.

Microsoft docs, showing the combinations of "Word Count":

https://docs.microsoft.com/en-us/windows/win32/msi/word-count-summary

--- quote ---
These are combined to give the Word Count Summary property one of the following
values that indicate a type of source file image.

Table 2

Value     Type
0     Original source using long file names. Matches tree in Directory Table.
Elevated privileges can be required to install this package.

1     Original source using short file names. Matches tree in Directory Table.
Elevated privileges can be required to install this package.

2     Compressed source files using long file names. Matches cabinets and files
in the Media Table. Elevated privileges can be required to install this
package.

3     Compressed source files using short file names. Matches cabinets and
files in the Media Table. Elevated privileges can be required to install this
package.

4     Administrative image using long file names. Matches tree in Directory
Table. Elevated privileges can be required to install this package.

5     Administrative image using short file names. Matches tree in Directory
Table. Elevated privileges can be required to install this package.

8     Elevated privileges are not required to install this package. Use this
value when Authoring Packages without the UAC Dialog Box.Available starting
with Windows Installer version 4.0 and Windows Vista or Windows Server 2008.
--- quote ---

Value 6 is not mentioned for whatever reason.

$ sha1sum JamKazam-1.0.3744.msi 
d2f7ea5c83846cf035cff88a6d078ca367a9f3220  JamKazam-1.0.3744.msi

$ du -sh JamKazam-1.0.3744.msi 
76M    JamKazam-1.0.3744.msi

$ wine --version
wine-5.10-39-g1752958240

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