Commit 701f1480 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Clean up better when removing a product.

parent 8933013b
......@@ -5139,21 +5139,16 @@ static UINT msi_unpublish_product(MSIPACKAGE *package, WCHAR *remove)
MSIREG_DeleteUserDataProductKey(package->ProductCode);
MSIREG_DeleteUninstallKey(package);
if (package->Context == MSIINSTALLCONTEXT_MACHINE)
{
MSIREG_DeleteLocalClassesProductKey(package->ProductCode);
MSIREG_DeleteLocalClassesFeaturesKey(package->ProductCode);
}
else
{
MSIREG_DeleteUserProductKey(package->ProductCode);
MSIREG_DeleteUserFeaturesKey(package->ProductCode);
}
MSIREG_DeleteLocalClassesProductKey(package->ProductCode);
MSIREG_DeleteLocalClassesFeaturesKey(package->ProductCode);
MSIREG_DeleteUserProductKey(package->ProductCode);
MSIREG_DeleteUserFeaturesKey(package->ProductCode);
upgrade = msi_dup_property(package->db, szUpgradeCode);
if (upgrade)
{
MSIREG_DeleteUserUpgradeCodesKey(upgrade);
MSIREG_DeleteClassesUpgradeCodesKey(upgrade);
msi_free(upgrade);
}
......
......@@ -836,6 +836,7 @@ extern UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct);
extern UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct);
extern UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid);
extern UINT MSIREG_DeleteUserUpgradeCodesKey(LPCWSTR szUpgradeCode);
extern UINT MSIREG_DeleteClassesUpgradeCodesKey(LPCWSTR szUpgradeCode);
extern UINT MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL create);
extern UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode);
extern UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode);
......
......@@ -1182,6 +1182,21 @@ UINT MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL cr
return RegOpenKeyW(HKEY_CLASSES_ROOT, keypath, key);
}
UINT MSIREG_DeleteClassesUpgradeCodesKey(LPCWSTR szUpgradeCode)
{
WCHAR squished_pc[GUID_SIZE];
WCHAR keypath[0x200];
TRACE("%s\n", debugstr_w(szUpgradeCode));
if (!squash_guid(szUpgradeCode, squished_pc))
return ERROR_FUNCTION_FAILED;
TRACE("squished (%s)\n", debugstr_w(squished_pc));
sprintfW(keypath, szInstaller_ClassesUpgrade_fmt, squished_pc);
return RegDeleteTreeW(HKEY_CLASSES_ROOT, keypath);
}
/*************************************************************************
* MsiDecomposeDescriptorW [MSI.@]
*
......
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