Commit 6ae70616 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Improve parsing of the package platform.

parent de77f064
......@@ -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)
{
......
......@@ -6111,6 +6111,44 @@ static void test_package_validation(void)
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");
r = MsiInstallProductA(msifile, NULL);
......
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