msi: Don't publish the upgrade key to an invalid location.

This commit is contained in:
James Hawkins 2008-06-19 00:34:52 -05:00 committed by Alexandre Julliard
parent 2194889d5d
commit b635e3170f
3 changed files with 9 additions and 6 deletions

View File

@ -4125,11 +4125,6 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
squash_guid(package->ProductCode,squashed);
msi_reg_set_val_str( hkey2, squashed, NULL );
RegCloseKey(hkey2);
MSIREG_OpenUserUpgradeCodesKey(upgrade_code, &hkey2, TRUE);
squash_guid(package->ProductCode,squashed);
msi_reg_set_val_str( hkey2, squashed, NULL );
RegCloseKey(hkey2);
msi_free(upgrade_code);
}

View File

@ -2298,7 +2298,10 @@ static void test_Installer_InstallProduct(void)
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
res = RegDeleteKeyA(hkey, "UpgradeCodes\\D8E760ECA1E276347B43E42BDBDA5656");
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
todo_wine
{
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
}
RegCloseKey(hkey);

View File

@ -2235,6 +2235,8 @@ static void test_publish_registerproduct(void)
"\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
static const CHAR ugkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
"\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
static const CHAR userugkey[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
"\\51AAE0C44620A5E4788506E91F249BD2";
get_user_sid(&usersid);
get_date_str(date);
@ -2253,6 +2255,9 @@ static void test_publish_registerproduct(void)
ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
ok(delete_pf("msitest", FALSE), "File not installed\n");
res = RegOpenKeyA(HKEY_CURRENT_USER, userugkey, &hkey);
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
res = RegOpenKeyA(HKEY_LOCAL_MACHINE, uninstall, &hkey);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);