msi: Load media info even if there's no file to install.

This commit is contained in:
Hans Leidekker 2011-03-08 10:08:39 +01:00 committed by Alexandre Julliard
parent 4a6c63e24a
commit be790cb0ad
4 changed files with 9 additions and 17 deletions

View File

@ -293,6 +293,13 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
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)
continue;

View File

@ -656,7 +656,7 @@ static UINT get_drive_type(const WCHAR *path)
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;
LPWSTR source_dir;
@ -803,13 +803,6 @@ UINT ready_media(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi)
if (mi->is_continuous)
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 */
if (!mi->cabinet || mi->cabinet[0] == '#')
return ERROR_SUCCESS;

View File

@ -987,6 +987,7 @@ typedef struct
} MSICABDATA;
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 BOOL msi_cabextract(MSIPACKAGE* package, MSIMEDIAINFO *mi, LPVOID data);

View File

@ -3339,11 +3339,8 @@ static void test_lastusedsource(void)
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
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(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
}
r = MsiInstallProductA("msifile0.msi", "REMOVE=ALL");
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,
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
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(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
}
r = MsiInstallProductA("msifile1.msi", "REMOVE=ALL");
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,
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
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(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
}
r = MsiInstallProductA("msifile2.msi", "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);