msi: Delete the uninstall key when the product is removed.
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index ec2bbea..3066308 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -4039,6 +4039,7 @@
     MSIREG_DeleteUserProductKey(package->ProductCode);
     MSIREG_DeleteUserDataProductKey(package->ProductCode);
     MSIREG_DeleteUserFeaturesKey(package->ProductCode);
+    MSIREG_DeleteUninstallKey(package->ProductCode);
 
 done:
     msi_free(remove);
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index 8c416b8..4c7565b 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -729,6 +729,7 @@
 extern BOOL encode_base85_guid(GUID *,LPWSTR);
 extern BOOL decode_base85_guid(LPCWSTR,GUID*);
 extern UINT MSIREG_OpenUninstallKey(LPCWSTR szProduct, HKEY* key, BOOL create);
+extern UINT MSIREG_DeleteUninstallKey(LPCWSTR szProduct);
 extern UINT MSIREG_OpenUserProductsKey(LPCWSTR szProduct, HKEY* key, BOOL create);
 extern UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create);
 extern UINT MSIREG_OpenFeatures(HKEY* key);
diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c
index 9a88aea..beaecae 100644
--- a/dlls/msi/registry.c
+++ b/dlls/msi/registry.c
@@ -504,6 +504,16 @@
     return rc;
 }
 
+UINT MSIREG_DeleteUninstallKey(LPCWSTR szProduct)
+{
+    WCHAR keypath[0x200];
+    TRACE("%s\n",debugstr_w(szProduct));
+
+    sprintfW(keypath,szUninstall_fmt,szProduct);
+
+    return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath);
+}
+
 UINT MSIREG_OpenUserProductsKey(LPCWSTR szProduct, HKEY* key, BOOL create)
 {
     UINT rc;