Commit 18973df9 authored by David Hedberg's avatar David Hedberg Committed by Alexandre Julliard

msi: Generalize media helpers a bit.

parent fed6e521
...@@ -302,7 +302,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -302,7 +302,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry ) LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
{ {
rc = msi_load_media_info( package, file, mi ); rc = msi_load_media_info( package, file->Sequence, mi );
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
{ {
ERR("Unable to load media info for %s (%u)\n", debugstr_w(file->File), rc); ERR("Unable to load media info for %s (%u)\n", debugstr_w(file->File), rc);
...@@ -310,7 +310,8 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -310,7 +310,8 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
} }
if (!file->Component->Enabled) continue; if (!file->Component->Enabled) continue;
if (file->state != msifs_hashmatch && (rc = ready_media( package, file, mi ))) if (file->state != msifs_hashmatch &&
(rc = ready_media( package, file->Sequence, file->IsCompressed, mi )))
{ {
ERR("Failed to ready media for %s\n", debugstr_w(file->File)); ERR("Failed to ready media for %s\n", debugstr_w(file->File));
goto done; goto done;
......
...@@ -656,7 +656,7 @@ static UINT get_drive_type(const WCHAR *path) ...@@ -656,7 +656,7 @@ static UINT get_drive_type(const WCHAR *path)
return GetDriveTypeW(root); return GetDriveTypeW(root);
} }
UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi) UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
{ {
MSIRECORD *row; MSIRECORD *row;
LPWSTR source_dir; LPWSTR source_dir;
...@@ -669,7 +669,7 @@ UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi) ...@@ -669,7 +669,7 @@ UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi)
'`','L','a','s','t','S','e','q','u','e','n','c','e','`',' ','>','=',' ','%','i', '`','L','a','s','t','S','e','q','u','e','n','c','e','`',' ','>','=',' ','%','i',
' ','O','R','D','E','R',' ','B','Y',' ','`','D','i','s','k','I','d','`',0}; ' ','O','R','D','E','R',' ','B','Y',' ','`','D','i','s','k','I','d','`',0};
row = MSI_QueryGetRecord(package->db, query, file->Sequence); row = MSI_QueryGetRecord(package->db, query, Sequence);
if (!row) if (!row)
{ {
TRACE("Unable to query row\n"); TRACE("Unable to query row\n");
...@@ -815,7 +815,7 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi) ...@@ -815,7 +815,7 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
} }
UINT ready_media(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi) UINT ready_media(MSIPACKAGE *package, UINT Sequence, BOOL IsCompressed, MSIMEDIAINFO *mi)
{ {
UINT rc = ERROR_SUCCESS; UINT rc = ERROR_SUCCESS;
WCHAR *cabinet_file; WCHAR *cabinet_file;
...@@ -831,7 +831,7 @@ UINT ready_media(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi) ...@@ -831,7 +831,7 @@ UINT ready_media(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi)
cabinet_file = get_cabinet_filename(mi); cabinet_file = get_cabinet_filename(mi);
/* package should be downloaded */ /* package should be downloaded */
if (file->IsCompressed && if (IsCompressed &&
GetFileAttributesW(cabinet_file) == INVALID_FILE_ATTRIBUTES && GetFileAttributesW(cabinet_file) == INVALID_FILE_ATTRIBUTES &&
package->BaseURL && UrlIsW(package->BaseURL, URLIS_URL)) package->BaseURL && UrlIsW(package->BaseURL, URLIS_URL))
{ {
...@@ -874,7 +874,7 @@ UINT ready_media(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi) ...@@ -874,7 +874,7 @@ UINT ready_media(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi)
} }
} }
if (file->IsCompressed && if (IsCompressed &&
GetFileAttributesW(cabinet_file) == INVALID_FILE_ATTRIBUTES) GetFileAttributesW(cabinet_file) == INVALID_FILE_ATTRIBUTES)
{ {
rc = find_published_source(package, mi); rc = find_published_source(package, mi);
......
...@@ -990,8 +990,8 @@ typedef struct ...@@ -990,8 +990,8 @@ typedef struct
PVOID user; PVOID user;
} MSICABDATA; } MSICABDATA;
extern UINT ready_media(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi); extern UINT ready_media(MSIPACKAGE *package, UINT Sequence, BOOL IsCompressed, MSIMEDIAINFO *mi);
extern UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi); extern UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi);
extern void msi_free_media_info(MSIMEDIAINFO *mi); extern void msi_free_media_info(MSIMEDIAINFO *mi);
extern BOOL msi_cabextract(MSIPACKAGE* package, MSIMEDIAINFO *mi, LPVOID data); extern BOOL msi_cabextract(MSIPACKAGE* package, MSIMEDIAINFO *mi, LPVOID data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment