msi: Handle the package context when unpublishing the product.

This commit is contained in:
James Hawkins 2008-07-28 18:46:32 -05:00 committed by Alexandre Julliard
parent 2e25db0409
commit 38106ac230
3 changed files with 47 additions and 2 deletions

View File

@ -4229,11 +4229,20 @@ static UINT msi_unpublish_product(MSIPACKAGE *package)
goto done;
MSIREG_DeleteProductKey(package->ProductCode);
MSIREG_DeleteUserProductKey(package->ProductCode);
MSIREG_DeleteUserDataProductKey(package->ProductCode);
MSIREG_DeleteUserFeaturesKey(package->ProductCode);
MSIREG_DeleteUninstallKey(package->ProductCode);
if (package->Context == MSIINSTALLCONTEXT_MACHINE)
{
MSIREG_DeleteLocalClassesProductKey(package->ProductCode);
MSIREG_DeleteLocalClassesFeaturesKey(package->ProductCode);
}
else
{
MSIREG_DeleteUserProductKey(package->ProductCode);
MSIREG_DeleteUserFeaturesKey(package->ProductCode);
}
upgrade = msi_dup_property(package, szUpgradeCode);
if (upgrade)
{

View File

@ -790,6 +790,8 @@ extern UINT MSIREG_DeleteLocalUserDataComponentKey(LPCWSTR szComponent);
extern UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent);
extern UINT MSIREG_DeleteUserUpgradeCodesKey(LPCWSTR szUpgradeCode);
extern UINT MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL create);
extern UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode);
extern UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode);
extern LPWSTR msi_reg_get_val_str( HKEY hkey, LPCWSTR name );
extern BOOL msi_reg_get_val_dword( HKEY hkey, LPCWSTR name, DWORD *val);

View File

@ -1088,6 +1088,23 @@ UINT MSIREG_OpenLocalClassesProductKey(LPCWSTR szProductCode, HKEY *key, BOOL cr
return RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key);
}
UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode)
{
WCHAR squished_pc[GUID_SIZE];
WCHAR keypath[0x200];
TRACE("%s\n", debugstr_w(szProductCode));
if (!squash_guid(szProductCode, squished_pc))
return ERROR_FUNCTION_FAILED;
TRACE("squished (%s)\n", debugstr_w(squished_pc));
sprintfW(keypath, szInstaller_LocalClassesProd_fmt, squished_pc);
return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath);
}
UINT MSIREG_OpenLocalClassesFeaturesKey(LPCWSTR szProductCode, HKEY *key, BOOL create)
{
WCHAR squished_pc[GUID_SIZE];
@ -1108,6 +1125,23 @@ UINT MSIREG_OpenLocalClassesFeaturesKey(LPCWSTR szProductCode, HKEY *key, BOOL c
return RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key);
}
UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode)
{
WCHAR squished_pc[GUID_SIZE];
WCHAR keypath[0x200];
TRACE("%s\n", debugstr_w(szProductCode));
if (!squash_guid(szProductCode, squished_pc))
return ERROR_FUNCTION_FAILED;
TRACE("squished (%s)\n", debugstr_w(squished_pc));
sprintfW(keypath, szInstaller_LocalClassesFeat_fmt, squished_pc);
return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath);
}
UINT MSIREG_OpenLocalManagedProductKey(LPCWSTR szProductCode, HKEY *key, BOOL create)
{
WCHAR squished_pc[GUID_SIZE];