From 153063b5ed78e1eefa6cef817bb28ad0caef2482 Mon Sep 17 00:00:00 2001 From: Frank-Rainer Grahl Date: Mon, 31 Jul 2017 22:26:28 +0200 Subject: [PATCH] Bug 1354845 - Add IA2Marshal and AccessibleHandler to SeaMonkey. r=IanN Port Bug 1275731 [Add IA2Marshal.dll to package and installer] Port Bug 1288841 [Add a typelib containing info for IServiceProvider and IEnumVARIANT] Port Bug 1354208 [Add AccessibleHandler.dll to installer] Port Bug 1355968 [Ensure AccessibleHandler.dll is registered in PostUpdate] Port Bug 1357194 [Use MOZ_UPDATE_CHANNEL to distinguish between local/nightly and beta/release builds for AccessibleHandler CLSIDs] --- suite/installer/package-manifest.in | 3 +++ suite/installer/windows/nsis/defines.nsi.in | 20 ++++++++++++++++++++ suite/installer/windows/nsis/installer.nsi | 14 ++++++++++++-- suite/installer/windows/nsis/shared.nsh | 10 ++++++++++ suite/installer/windows/nsis/uninstaller.nsi | 12 ++++++++++++ 5 files changed, 57 insertions(+), 2 deletions(-) diff --git a/suite/installer/package-manifest.in b/suite/installer/package-manifest.in index f20ed3806b..0399abc281 100644 --- a/suite/installer/package-manifest.in +++ b/suite/installer/package-manifest.in @@ -160,7 +160,10 @@ ; [Components] #ifdef ACCESSIBILITY #ifdef XP_WIN32 +@BINPATH@/Accessible.tlb +@BINPATH@/AccessibleHandler.dll @BINPATH@/AccessibleMarshal.dll +@BINPATH@/IA2Marshal.dll #endif @RESPATH@/components/accessibility.xpt #endif diff --git a/suite/installer/windows/nsis/defines.nsi.in b/suite/installer/windows/nsis/defines.nsi.in index 75bc282e16..010caa2884 100644 --- a/suite/installer/windows/nsis/defines.nsi.in +++ b/suite/installer/windows/nsis/defines.nsi.in @@ -29,6 +29,26 @@ !define MinSupportedCPU "SSE2" +# AccessibleHandler.dll uses a different CLSID depending on release channel. +# These defines must match HANDLER_CLSID defined in +# accessible/ipc/win/handler/HandlerData.idl + +!if "@MOZ_UPDATE_CHANNEL@" == "default" +#ifdef DEBUG +!define AccessibleHandlerCLSID "{398FFD8D-5382-48F7-9E3B-19012762D39A}" +#else +!define AccessibleHandlerCLSID "{CE573FAF-7815-4FC2-A031-B092268ACE9E}" +#endif +!else if "@MOZ_UPDATE_CHANNEL@" == "nightly" +!define AccessibleHandlerCLSID "{4629216B-8753-41BF-9527-5BFF51401671}" +!else if "@MOZ_UPDATE_CHANNEL@" == "beta" +!define AccessibleHandlerCLSID "{21E9F98D-A6C9-4CB5-B288-AE2FD2A96C58}" +!else if "@MOZ_UPDATE_CHANNEL@" == "release" +!define AccessibleHandlerCLSID "{1BAA303D-B4B9-45E5-9CCB-E3FCA3E274B6}" +!else +!define AccessibleHandlerCLSID "{4A195748-DCA2-45FB-9295-0A139E76A9E7}" +!endif + # File details shared by both the installer and uninstaller VIProductVersion "1.0.0.0" VIAddVersionKey "ProductName" "${BrandShortName}" diff --git a/suite/installer/windows/nsis/installer.nsi b/suite/installer/windows/nsis/installer.nsi index 09c5007229..47d0dcc05a 100644 --- a/suite/installer/windows/nsis/installer.nsi +++ b/suite/installer/windows/nsis/installer.nsi @@ -299,7 +299,9 @@ Section "-Application" APP_IDX ; application installed is uninstalled AccessibleMarshal.dll will no longer be ; registered. bug 338878 ${LogHeader} "DLL Registration" + ClearErrors + ${RegisterDLL} "$INSTDIR\AccessibleMarshal.dll" ${If} ${Errors} ${LogMsg} "** ERROR Registering: $INSTDIR\AccessibleMarshal.dll **" @@ -308,6 +310,16 @@ Section "-Application" APP_IDX ${LogMsg} "Registered: $INSTDIR\AccessibleMarshal.dll" ${EndIf} + ClearErrors + + ${RegisterDLL} "$INSTDIR\AccessibleHandler.dll" + ${If} ${Errors} + ${LogMsg} "** ERROR Registering: $INSTDIR\AccessibleHandler.dll **" + ${Else} + ${LogUninstall} "DLLReg: \AccessibleHandler.dll" + ${LogMsg} "Registered: $INSTDIR\AccessibleHandler.dll" + ${EndIf} + ; Write extra files created by the application to the uninstall log so they ; will be removed when the application is uninstalled. To remove an empty ; directory write a bogus filename to the deepest directory and all empty @@ -320,8 +332,6 @@ Section "-Application" APP_IDX ${LogUninstall} "File: \install_wizard.log" ${LogUninstall} "File: \updates.xml" - ClearErrors - ; Default for creating Start Menu folder and shortcuts ; (1 = create, 0 = don't create) ${If} $AddStartMenuSC == "" diff --git a/suite/installer/windows/nsis/shared.nsh b/suite/installer/windows/nsis/shared.nsh index 388de989f5..6a40b363d5 100644 --- a/suite/installer/windows/nsis/shared.nsh +++ b/suite/installer/windows/nsis/shared.nsh @@ -75,6 +75,9 @@ ; Remove files that may be left behind by the application in the ; VirtualStore directory. ${CleanVirtualStore} + + ; Register AccessibleHandler.dll with COM (this writes to HKLM) + ${RegisterAccessibleHandler} !macroend !define PostUpdate "!insertmacro PostUpdate" @@ -755,6 +758,11 @@ !define UpdateProtocolHandlers "!insertmacro UpdateProtocolHandlers" !insertmacro RegCleanAppHandler +!macro RegisterAccessibleHandler + ${RegisterDLL} "$INSTDIR\AccessibleHandler.dll" +!macroend +!define RegisterAccessibleHandler "!insertmacro RegisterAccessibleHandler" + ; Removes various registry entries for reasons noted below (does not use SHCTX). !macro RemoveDeprecatedKeys StrCpy $0 "SOFTWARE\Classes" @@ -982,7 +990,9 @@ ; should be ${FileMainEXE} so if it is in use the CheckForFilesInUse macro ; returns after the first check. Push "end" + Push "AccessibleHandler.dll" Push "AccessibleMarshal.dll" + Push "IA2Marshal.dll" Push "freebl3.dll" Push "nssckbi.dll" Push "nspr4.dll" diff --git a/suite/installer/windows/nsis/uninstaller.nsi b/suite/installer/windows/nsis/uninstaller.nsi index 0269d8fd99..8a6a312e59 100644 --- a/suite/installer/windows/nsis/uninstaller.nsi +++ b/suite/installer/windows/nsis/uninstaller.nsi @@ -351,6 +351,18 @@ Section "Uninstall" ; VirtualStore directory. ${un.CleanVirtualStore} + ; Only unregister the dll if the registration points to this installation + ReadRegStr $R1 HKCR "CLSID\{0D68D6D0-D93D-4D08-A30D-F00DD1F45B24}\InProcServer32" "" + ${If} "$INSTDIR\AccessibleMarshal.dll" == "$R1" + ${UnregisterDLL} "$INSTDIR\AccessibleMarshal.dll" + ${EndIf} + + ; Only unregister the dll if the registration points to this installation + ReadRegStr $R1 HKCR "CLSID\${AccessibleHandlerCLSID}\InProcHandler32" "" + ${If} "$INSTDIR\AccessibleHandler.dll" == "$R1" + ${UnregisterDLL} "$INSTDIR\AccessibleHandler.dll" + ${EndIf} + ; Parse the uninstall log to unregister dll's and remove all installed ; files / directories this install is responsible for. ${un.ParseUninstallLog}