msi: Handle more than one patch per file.
This commit is contained in:
parent
e583f8806e
commit
aeb7d70ffd
|
@ -684,18 +684,6 @@ MSIFILE *msi_get_loaded_file( MSIPACKAGE *package, const WCHAR *key )
|
|||
return NULL;
|
||||
}
|
||||
|
||||
MSIFILEPATCH *msi_get_loaded_filepatch( MSIPACKAGE *package, const WCHAR *key )
|
||||
{
|
||||
MSIFILEPATCH *patch;
|
||||
|
||||
/* FIXME: There might be more than one patch */
|
||||
LIST_FOR_EACH_ENTRY( patch, &package->filepatches, MSIFILEPATCH, entry )
|
||||
{
|
||||
if (!strcmpW( key, patch->File->File )) return patch;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MSIFOLDER *msi_get_loaded_folder( MSIPACKAGE *package, const WCHAR *dir )
|
||||
{
|
||||
MSIFOLDER *folder;
|
||||
|
|
|
@ -443,6 +443,17 @@ static void unload_mspatch(void)
|
|||
FreeLibrary(hmspatcha);
|
||||
}
|
||||
|
||||
static MSIFILEPATCH *get_next_filepatch( MSIPACKAGE *package, const WCHAR *key )
|
||||
{
|
||||
MSIFILEPATCH *patch;
|
||||
|
||||
LIST_FOR_EACH_ENTRY( patch, &package->filepatches, MSIFILEPATCH, entry )
|
||||
{
|
||||
if (!patch->IsApplied && !strcmpW( key, patch->File->File )) return patch;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static BOOL patchfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
|
||||
LPWSTR *path, DWORD *attrs, PVOID user)
|
||||
{
|
||||
|
@ -455,12 +466,8 @@ static BOOL patchfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
|
|||
if (temp_folder[0] == '\0')
|
||||
GetTempPathW(MAX_PATH, temp_folder);
|
||||
|
||||
p = msi_get_loaded_filepatch(package, file);
|
||||
if (!p)
|
||||
{
|
||||
TRACE("unknown file in cabinet (%s)\n", debugstr_w(file));
|
||||
return FALSE;
|
||||
}
|
||||
if (!(p = get_next_filepatch(package, file))) return FALSE;
|
||||
|
||||
GetTempFileNameW(temp_folder, NULL, 0, patch_path);
|
||||
|
||||
*path = strdupW(patch_path);
|
||||
|
|
|
@ -1018,7 +1018,6 @@ extern void msi_reset_folders( MSIPACKAGE *package, BOOL source ) DECLSPEC_HIDDE
|
|||
extern MSICOMPONENT *msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component) DECLSPEC_HIDDEN;
|
||||
extern MSIFEATURE *msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature) DECLSPEC_HIDDEN;
|
||||
extern MSIFILE *msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *file) DECLSPEC_HIDDEN;
|
||||
extern MSIFILEPATCH *msi_get_loaded_filepatch(MSIPACKAGE* package, const WCHAR *key) DECLSPEC_HIDDEN;
|
||||
extern MSIFOLDER *msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir) DECLSPEC_HIDDEN;
|
||||
extern int msi_track_tempfile(MSIPACKAGE *package, const WCHAR *path) DECLSPEC_HIDDEN;
|
||||
extern void msi_free_action_script(MSIPACKAGE *package, UINT script) DECLSPEC_HIDDEN;
|
||||
|
|
Loading…
Reference in New Issue