msi: Improve parsing of the package platform.

This commit is contained in:
Hans Leidekker 2011-09-15 11:48:15 +02:00 committed by Alexandre Julliard
parent de77f0648e
commit 6ae7061645
2 changed files with 43 additions and 0 deletions

View File

@ -1280,6 +1280,7 @@ static UINT msi_parse_summary( MSISUMMARYINFO *si, MSIPACKAGE *package )
return ERROR_PATCH_PACKAGE_INVALID;
}
*p = 0;
if ((q = strchrW( template, ',' ))) *q = 0;
if (!template[0] || !strcmpW( template, szIntel ))
package->platform = PLATFORM_INTEL;
else if (!strcmpW( template, szIntel64 ))
@ -1329,6 +1330,10 @@ static UINT validate_package( MSIPACKAGE *package )
BOOL is_wow64;
UINT i;
if (package->platform == PLATFORM_INTEL64)
{
return ERROR_INSTALL_PLATFORM_UNSUPPORTED;
}
IsWow64Process( GetCurrentProcess(), &is_wow64 );
if (package->platform == PLATFORM_X64)
{

View File

@ -6110,6 +6110,44 @@ static void test_package_validation(void)
ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
ok(delete_pf("msitest", FALSE), "directory does not exist\n");
DeleteFile(msifile);
create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel,9999;9999");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_LANGUAGE_UNSUPPORTED, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r);
DeleteFile(msifile);
create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel,1033;9999");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_LANGUAGE_UNSUPPORTED, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r);
DeleteFile(msifile);
create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel,9999;1033");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
ok(delete_pf("msitest", FALSE), "directory does not exist\n");
DeleteFile(msifile);
create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel64,9999;1033");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
DeleteFile(msifile);
create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel32,1033;1033");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
DeleteFile(msifile);
create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel32,9999;1033");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
DeleteFile(msifile);
create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;9999");