[Libreoffice-commits] .: Branch 'libreoffice-3-4' - patches/dev300
Tor Lillqvist
tml at kemper.freedesktop.org
Tue Apr 5 06:38:28 PDT 2011
patches/dev300/apply | 5
patches/dev300/win32-restore-associations.diff | 210 -------------------------
2 files changed, 215 deletions(-)
New commits:
commit 36bf9a2a50c3307315c25a3fa01938d192a56cc5
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Tue Apr 5 16:37:17 2011 +0300
win32-restore-associations.diff is integrated
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 0a743e9..3283732 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -1319,11 +1319,6 @@ ooop-updatable-sameversion.diff
#Always use default iconset
always_default_iconset.diff
-[ Win32Only ]
-# Save old associations for MS doc types when installing OOo, and then
-# restore them if still relevant when uninstalling OOo
-win32-restore-associations.diff, n#530872, tml
-
[ Fixes ]
#sc-xclimpchangetrack-discard-bogus-formula-size.diff, n#355304, tml
diff --git a/patches/dev300/win32-restore-associations.diff b/patches/dev300/win32-restore-associations.diff
deleted file mode 100644
index 8d037c3..0000000
--- a/patches/dev300/win32-restore-associations.diff
+++ /dev/null
@@ -1,210 +0,0 @@
---- scp2/source/ooo/windowscustomaction_ooo.scp
-+++ scp2/source/ooo/windowscustomaction_ooo.scp
-@@ -56,6 +56,15 @@
- Inbinarytable = 1;
- Assignment1 = ("InstallExecuteSequence", "Not REMOVE=\"ALL\" And Not PATCH And _IsSetupTypeMin<>\"Custom\"", "CostFinalize");
- End
-+
-+WindowsCustomAction gid_Customaction_Restoreregallmsdocdll
-+ Name = "Restoreregallmsdocdll";
-+ Typ = "65";
-+ Source = "reg4allmsdoc.dll";
-+ Target = "RestoreRegAllMSDoc";
-+ Inbinarytable = 1;
-+ Assignment1 = ("InstallExecuteSequence", "REMOVE=\"ALL\" And Not PATCH", "end");
-+End
-
- WindowsCustomAction gid_Customaction_Regactivexdll1
- Name = "Regactivexdll1";
---- setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx
-+++ setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx
-@@ -191,6 +191,9 @@
- return rc;
- }
-
-+// Unused
-+#if 0
-+
- //----------------------------------------------------------
- static BOOL RemoveExtensionInRegistry( LPCSTR lpSubKey )
- {
-@@ -241,6 +244,8 @@
- return ( ERROR_SUCCESS == lResult );
- }
-
-+#endif
-+
- //----------------------------------------------------------
- bool GetMsiProp( MSIHANDLE handle, LPCSTR name, /*out*/std::string& value )
- {
-@@ -268,11 +273,59 @@
- }
-
- //----------------------------------------------------------
-+static void saveOldRegistration( LPCSTR lpSubKey )
-+{
-+ BOOL bRet = false;
-+ HKEY hKey = NULL;
-+ LONG lResult = RegOpenKeyExA( HKEY_CLASSES_ROOT, lpSubKey, 0,
-+ KEY_QUERY_VALUE|KEY_SET_VALUE, &hKey );
-+
-+ if ( ERROR_SUCCESS == lResult )
-+ {
-+ CHAR szBuffer[1024];
-+ DWORD nSize = sizeof( szBuffer );
-+
-+ lResult = RegQueryValueExA( hKey, "", NULL, NULL, (LPBYTE)szBuffer, &nSize );
-+ if ( ERROR_SUCCESS == lResult )
-+ {
-+ szBuffer[nSize] = '\0';
-+
-+ // No need to save assocations for our own types
-+ if ( strncmp( szBuffer, "OpenOffice.org.", 15 ) != 0 )
-+ {
-+ // Save the old association
-+ RegSetValueExA( hKey, "OOoBackupAssociation", 0,
-+ REG_SZ, (LPBYTE)szBuffer, nSize );
-+ // Also save what the old association means, just so we can try to verify
-+ // if/when restoring it that the old application still exists
-+ HKEY hKey2 = NULL;
-+ lResult = RegOpenKeyExA( HKEY_CLASSES_ROOT, szBuffer, 0,
-+ KEY_QUERY_VALUE, &hKey2 );
-+ if ( ERROR_SUCCESS == lResult )
-+ {
-+ nSize = sizeof( szBuffer );
-+ lResult = RegQueryValueExA( hKey2, "", NULL, NULL, (LPBYTE)szBuffer, &nSize );
-+ if ( ERROR_SUCCESS == lResult )
-+ {
-+ RegSetValueExA( hKey, "OOoBackupAssociationDeref", 0,
-+ REG_SZ, (LPBYTE)szBuffer, nSize );
-+ }
-+ RegCloseKey( hKey2 );
-+ }
-+ }
-+ }
-+ RegCloseKey( hKey );
-+ }
-+}
-+
-+//----------------------------------------------------------
- static void registerForExtensions( MSIHANDLE handle, BOOL bRegisterAll )
- { // Check all file extensions
- int nIndex = 0;
- while ( g_Extensions[nIndex] != 0 )
- {
-+ saveOldRegistration( g_Extensions[nIndex] );
-+
- BOOL bRegister = bRegisterAll || CheckExtensionInRegistry( g_Extensions[nIndex] );
- if ( bRegister )
- registerForExtension( handle, nIndex, true );
-@@ -290,6 +346,10 @@
- }
-
- //----------------------------------------------------------
-+//
-+// This is the (slightly misleadinly named) entry point for the
-+// custom action called Regallmsdocdll.
-+//
- extern "C" UINT __stdcall FindRegisteredExtensions( MSIHANDLE handle )
- {
- if ( IsSetMsiProp( handle, "FILETYPEDIALOGUSED" ) )
-@@ -309,7 +369,12 @@
- return ERROR_SUCCESS;
- }
-
-+#if 0
-+
- //----------------------------------------------------------
-+//
-+// This entry is not called for any custom action.
-+//
- extern "C" UINT __stdcall DeleteRegisteredExtensions( MSIHANDLE /*handle*/ )
- {
- OutputDebugStringFormat( "DeleteRegisteredExtensions\n" );
-@@ -324,5 +389,79 @@
-
- return ERROR_SUCCESS;
- }
-+
-+#endif
-+
-+//----------------------------------------------------------
-+static void restoreOldRegistration( LPCSTR lpSubKey )
-+{
-+ BOOL bRet = false;
-+ HKEY hKey = NULL;
-+ LONG lResult = RegOpenKeyExA( HKEY_CLASSES_ROOT, lpSubKey, 0,
-+ KEY_QUERY_VALUE|KEY_SET_VALUE, &hKey );
-+
-+ if ( ERROR_SUCCESS == lResult )
-+ {
-+ CHAR szBuffer[1024];
-+ DWORD nSize = sizeof( szBuffer );
-+
-+ lResult = RegQueryValueExA( hKey, "OOoBackupAssociation", NULL, NULL,
-+ (LPBYTE)szBuffer, &nSize );
-+ if ( ERROR_SUCCESS == lResult )
-+ {
-+ HKEY hKey2 = NULL;
-+ lResult = RegOpenKeyExA( HKEY_CLASSES_ROOT, szBuffer, 0,
-+ KEY_QUERY_VALUE, &hKey2 );
-+ if ( ERROR_SUCCESS == lResult )
-+ {
-+ CHAR szBuffer2[1024];
-+ DWORD nSize2 = sizeof( szBuffer2 );
-+
-+ lResult = RegQueryValueExA( hKey2, "", NULL, NULL, (LPBYTE)szBuffer2, &nSize2 );
-+ if ( ERROR_SUCCESS == lResult )
-+ {
-+ CHAR szBuffer3[1024];
-+ DWORD nSize3 = sizeof( szBuffer3 );
-+
-+ // Try to verify that the old association is OK to restore
-+ lResult = RegQueryValueExA( hKey, "OOoBackupAssociationDeref", NULL, NULL,
-+ (LPBYTE)szBuffer3, &nSize3 );
-+ if ( ERROR_SUCCESS == lResult )
-+ {
-+ if ( nSize2 == nSize3 && strcmp (szBuffer2, szBuffer3) == 0)
-+ {
-+ // Yep. So restore it
-+ RegSetValueExA( hKey, "", 0, REG_SZ, (LPBYTE)szBuffer, nSize );
-+ }
-+ }
-+ }
-+ RegCloseKey( hKey2 );
-+ }
-+ RegDeleteValueA( hKey, "OOoBackupAssociation" );
-+ }
-+ RegDeleteValueA( hKey, "OOoBackupAssociationDeref" );
-+ RegCloseKey( hKey );
-+ }
-+}
-+
-+//----------------------------------------------------------
-+//
-+// This function is not in OO.o. We call this from the
-+// Restoreregallmsdocdll custom action.
-+//
-+extern "C" UINT __stdcall RestoreRegAllMSDoc( MSIHANDLE /*handle*/ )
-+{
-+ OutputDebugStringFormat( "RestoreRegAllMSDoc\n" );
-+
-+ int nIndex = 0;
-+ while ( g_Extensions[nIndex] != 0 )
-+ {
-+ restoreOldRegistration( g_Extensions[nIndex] );
-+ ++nIndex;
-+ }
-+
-+
-+ return ERROR_SUCCESS;
-+}
-
- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
---- setup_native/source/win32/customactions/reg4allmsdoc/exports.dxp
-+++ setup_native/source/win32/customactions/reg4allmsdoc/exports.dxp
-@@ -1,3 +1,4 @@
- FindRegisteredExtensions
- LookForRegisteredExtensions
- RegisterSomeExtensions
-+RestoreRegAllMSDoc
More information about the Libreoffice-commits
mailing list