msi: Load media info even if there's no file to install.
This commit is contained in:
parent
4a6c63e24a
commit
be790cb0ad
|
@ -293,6 +293,13 @@ 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 );
|
||||||
|
if (rc != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
ERR("Unable to load media info for %s (%u)\n", debugstr_w(file->File), rc);
|
||||||
|
return ERROR_FUNCTION_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
if (file->state != msifs_missing && !mi->is_continuous && file->state != msifs_overwrite)
|
if (file->state != msifs_missing && !mi->is_continuous && file->state != msifs_overwrite)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -656,7 +656,7 @@ static UINT get_drive_type(const WCHAR *path)
|
||||||
return GetDriveTypeW(root);
|
return GetDriveTypeW(root);
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi)
|
UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi)
|
||||||
{
|
{
|
||||||
MSIRECORD *row;
|
MSIRECORD *row;
|
||||||
LPWSTR source_dir;
|
LPWSTR source_dir;
|
||||||
|
@ -803,13 +803,6 @@ UINT ready_media(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi)
|
||||||
if (mi->is_continuous)
|
if (mi->is_continuous)
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
rc = msi_load_media_info(package, file, mi);
|
|
||||||
if (rc != ERROR_SUCCESS)
|
|
||||||
{
|
|
||||||
ERR("Unable to load media info %u\n", rc);
|
|
||||||
return ERROR_FUNCTION_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* cabinet is internal, no checks needed */
|
/* cabinet is internal, no checks needed */
|
||||||
if (!mi->cabinet || mi->cabinet[0] == '#')
|
if (!mi->cabinet || mi->cabinet[0] == '#')
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
|
|
|
@ -987,6 +987,7 @@ typedef struct
|
||||||
} MSICABDATA;
|
} MSICABDATA;
|
||||||
|
|
||||||
extern UINT ready_media(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi);
|
extern UINT ready_media(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi);
|
||||||
|
extern UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, 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);
|
||||||
|
|
||||||
|
|
|
@ -3339,11 +3339,8 @@ static void test_lastusedsource(void)
|
||||||
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
|
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
|
||||||
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
|
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
|
||||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||||
todo_wine
|
|
||||||
{
|
|
||||||
ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
|
ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
|
||||||
ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
|
ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
|
||||||
}
|
|
||||||
|
|
||||||
r = MsiInstallProductA("msifile0.msi", "REMOVE=ALL");
|
r = MsiInstallProductA("msifile0.msi", "REMOVE=ALL");
|
||||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||||
|
@ -3368,11 +3365,8 @@ static void test_lastusedsource(void)
|
||||||
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
|
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
|
||||||
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
|
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
|
||||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||||
todo_wine
|
|
||||||
{
|
|
||||||
ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
|
ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
|
||||||
ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
|
ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
|
||||||
}
|
|
||||||
|
|
||||||
r = MsiInstallProductA("msifile1.msi", "REMOVE=ALL");
|
r = MsiInstallProductA("msifile1.msi", "REMOVE=ALL");
|
||||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||||
|
@ -3396,11 +3390,8 @@ static void test_lastusedsource(void)
|
||||||
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
|
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
|
||||||
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
|
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
|
||||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||||
todo_wine
|
|
||||||
{
|
|
||||||
ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
|
ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
|
||||||
ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
|
ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
|
||||||
}
|
|
||||||
|
|
||||||
r = MsiInstallProductA("msifile2.msi", "REMOVE=ALL");
|
r = MsiInstallProductA("msifile2.msi", "REMOVE=ALL");
|
||||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||||
|
|
Loading…
Reference in New Issue