Commit 23169289 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Map neutral parts of package language ids to the system default language id.

parent 8ad7d2e8
...@@ -1402,7 +1402,17 @@ static UINT validate_package( MSIPACKAGE *package ) ...@@ -1402,7 +1402,17 @@ static UINT validate_package( MSIPACKAGE *package )
} }
for (i = 0; i < package->num_langids; i++) for (i = 0; i < package->num_langids; i++)
{ {
if (!package->langids[i] || IsValidLocale( package->langids[i], LCID_INSTALLED )) LANGID langid = package->langids[i];
if (PRIMARYLANGID( langid ) == LANG_NEUTRAL)
{
langid = MAKELANGID( PRIMARYLANGID( GetSystemDefaultLangID() ), SUBLANGID( langid ) );
}
if (SUBLANGID( langid ) == SUBLANG_NEUTRAL)
{
langid = MAKELANGID( PRIMARYLANGID( langid ), SUBLANGID( GetSystemDefaultLangID() ) );
}
if (IsValidLocale( langid, LCID_INSTALLED ))
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
return ERROR_INSTALL_LANGUAGE_UNSUPPORTED; return ERROR_INSTALL_LANGUAGE_UNSUPPORTED;
......
...@@ -6057,6 +6057,23 @@ static void test_package_validation(void) ...@@ -6057,6 +6057,23 @@ static void test_package_validation(void)
ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n"); ok(!delete_pf("msitest\\maximus", TRUE), "file exists\n");
ok(!delete_pf("msitest", FALSE), "directory exists\n"); ok(!delete_pf("msitest", FALSE), "directory exists\n");
if (GetSystemDefaultLangID() == MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ))
{
DeleteFile(msifile);
create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;9");
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), 100, "Intel;1024");
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); DeleteFile(msifile);
create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel32;0"); create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel32;0");
......
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