Hans Leidekker : msi: Implement the UnregisterProgIdInfo standard action.
Alexandre Julliard
julliard at winehq.org
Fri Apr 2 10:17:12 CDT 2010
Module: wine
Branch: master
Commit: 3bdfa1f6248ebc86c5d734f53aa220b3cf4c2bae
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3bdfa1f6248ebc86c5d734f53aa220b3cf4c2bae
Author: Hans Leidekker <hans at codeweavers.com>
Date: Fri Apr 2 10:38:57 2010 +0200
msi: Implement the UnregisterProgIdInfo standard action.
---
dlls/msi/action.c | 12 ------------
dlls/msi/classes.c | 37 ++++++++++++++++++++++++++++++++++++-
dlls/msi/font.c | 5 -----
dlls/msi/msipriv.h | 4 ++++
4 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 2b729ec..4f1be9a 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -124,8 +124,6 @@ static const WCHAR szPublishComponents[] =
{'P','u','b','l','i','s','h','C','o','m','p','o','n','e','n','t','s',0};
static const WCHAR szRegisterComPlus[] =
{'R','e','g','i','s','t','e','r','C','o','m','P','l','u','s',0};
-static const WCHAR szRegisterFonts[] =
- {'R','e','g','i','s','t','e','r','F','o','n','t','s',0};
static const WCHAR szRegisterUser[] =
{'R','e','g','i','s','t','e','r','U','s','e','r',0};
static const WCHAR szRemoveEnvironmentStrings[] =
@@ -162,12 +160,8 @@ static const WCHAR szUnregisterComPlus[] =
{'U','n','r','e','g','i','s','t','e','r','C','o','m','P','l','u','s',0};
static const WCHAR szUnregisterExtensionInfo[] =
{'U','n','r','e','g','i','s','t','e','r','E','x','t','e','n','s','i','o','n','I','n','f','o',0};
-static const WCHAR szUnregisterFonts[] =
- {'U','n','r','e','g','i','s','t','e','r','F','o','n','t','s',0};
static const WCHAR szUnregisterMIMEInfo[] =
{'U','n','r','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0};
-static const WCHAR szUnregisterProgIdInfo[] =
- {'U','n','r','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n','f','o',0};
static const WCHAR szUnregisterTypeLibraries[] =
{'U','n','r','e','g','i','s','t','e','r','T','y','p','e','L','i','b','r','a','r','i','e','s',0};
static const WCHAR szValidateProductID[] =
@@ -6967,12 +6961,6 @@ static UINT ACTION_UnregisterMIMEInfo( MSIPACKAGE *package )
return msi_unimplemented_action_stub( package, "UnregisterMIMEInfo", table );
}
-static UINT ACTION_UnregisterProgIdInfo( MSIPACKAGE *package )
-{
- static const WCHAR table[] = { 'P','r','o','g','I','d',0 };
- return msi_unimplemented_action_stub( package, "UnregisterProgIdInfo", table );
-}
-
typedef UINT (*STANDARDACTIONHANDLER)(MSIPACKAGE*);
static const struct
diff --git a/dlls/msi/classes.c b/dlls/msi/classes.c
index 7d4f1a0..d6e8808 100644
--- a/dlls/msi/classes.c
+++ b/dlls/msi/classes.c
@@ -25,7 +25,7 @@
* RegisterExtensionInfo
* RegisterMIMEInfo
* UnRegisterClassInfo
- * UnRegisterProgIdInfo (TODO)
+ * UnRegisterProgIdInfo
* UnRegisterExtensionInfo (TODO)
* UnRegisterMIMEInfo (TODO)
*/
@@ -1105,6 +1105,41 @@ UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package)
return ERROR_SUCCESS;
}
+UINT ACTION_UnregisterProgIdInfo( MSIPACKAGE *package )
+{
+ MSIPROGID *progid;
+ MSIRECORD *uirow;
+ LONG res;
+
+ load_classes_and_such( package );
+
+ LIST_FOR_EACH_ENTRY( progid, &package->progids, MSIPROGID, entry )
+ {
+ /* check if this progid is to be removed */
+ if (progid->Class && !progid->Class->Installed)
+ progid->InstallMe = FALSE;
+
+ if (progid->InstallMe)
+ {
+ TRACE("progid %s not scheduled to be removed\n", debugstr_w(progid->ProgID));
+ continue;
+ }
+
+ TRACE("Unregistering progid %s\n", debugstr_w(progid->ProgID));
+
+ res = RegDeleteTreeW( HKEY_CLASSES_ROOT, progid->ProgID );
+ if (res != ERROR_SUCCESS)
+ WARN("Failed to delete progid key %d\n", res);
+
+ uirow = MSI_CreateRecord( 1 );
+ MSI_RecordSetStringW( uirow, 1, progid->ProgID );
+ ui_actiondata( package, szUnregisterProgIdInfo, uirow );
+ msiobj_release( &uirow->hdr );
+ }
+
+ return ERROR_SUCCESS;
+}
+
static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid,
MSICOMPONENT* component, const MSIEXTENSION* extension,
MSIVERB* verb, INT* Sequence )
diff --git a/dlls/msi/font.c b/dlls/msi/font.c
index 1b2c3c7..1d99a4c 100644
--- a/dlls/msi/font.c
+++ b/dlls/msi/font.c
@@ -64,11 +64,6 @@ typedef struct _tagTT_NAME_RECORD {
#define SWAPWORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x))
#define SWAPLONG(x) MAKELONG(SWAPWORD(HIWORD(x)), SWAPWORD(LOWORD(x)))
-static const WCHAR szRegisterFonts[] =
- {'R','e','g','i','s','t','e','r','F','o','n','t','s',0};
-static const WCHAR szUnregisterFonts[] =
- {'U','n','r','e','g','i','s','t','e','r','F','o','n','t','s',0};
-
static const WCHAR regfont1[] =
{'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index d5a81a4..e81237c 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -964,6 +964,7 @@ extern UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package);
extern UINT ACTION_RegisterFonts(MSIPACKAGE *package);
extern UINT ACTION_UnregisterClassInfo(MSIPACKAGE *package);
extern UINT ACTION_UnregisterFonts(MSIPACKAGE *package);
+extern UINT ACTION_UnregisterProgIdInfo(MSIPACKAGE *package);
/* Helpers */
extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
@@ -1086,6 +1087,9 @@ static const WCHAR szAppSearch[] = {'A','p','p','S','e','a','r','c','h',0};
static const WCHAR szMoveFiles[] = {'M','o','v','e','F','i','l','e','s',0};
static const WCHAR szCCPSearch[] = {'C','C','P','S','e','a','r','c','h',0};
static const WCHAR szUnregisterClassInfo[] = {'U','n','r','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0};
+static const WCHAR szUnregisterProgIdInfo[] = {'U','n','r','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n','f','o',0};
+static const WCHAR szRegisterFonts[] = {'R','e','g','i','s','t','e','r','F','o','n','t','s',0};
+static const WCHAR szUnregisterFonts[] = {'U','n','r','e','g','i','s','t','e','r','F','o','n','t','s',0};
static const WCHAR szCLSID[] = {'C','L','S','I','D',0};
static const WCHAR szProgID[] = {'P','r','o','g','I','D',0};
static const WCHAR szVIProgID[] = {'V','e','r','s','i','o','n','I','n','d','e','p','e','n','d','e','n','t','P','r','o','g','I','D',0};
More information about the wine-cvs
mailing list