Module: wine Branch: master Commit: 6ae7061645eb245e49dacb4757b329b6783a10e5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6ae7061645eb245e49dacb4757...
Author: Hans Leidekker hans@codeweavers.com Date: Thu Sep 15 11:48:15 2011 +0200
msi: Improve parsing of the package platform.
---
dlls/msi/package.c | 5 +++++ dlls/msi/tests/install.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 1025607..4b59425 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -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) { diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 04c709f..b1db7e4 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -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);