Bug 1354845 - Add IA2Marshal and AccessibleHandler to TB. f=mhowell, r=jorgk
authorRichard Marti <richard.marti@gmail.com>
Sat, 08 Apr 2017 23:10:20 +0200
changeset 52563 873ddce7e8e6f9b9272789154752207cb6556652
parent 52560 a6a1279292d055c75b9554b01dab78b1cd9f27de
child 52564 414ec37453f447f583b2785a282403b475b14a84
child 52566 3d02c8cb88d610d4edd1febbc8fc970a81821bf6
child 52568 b197529fac6e9c626d7b239ce4640d04d531717e
child 52569 e46033d5c834c48804a2821b2dc2f8db24b50550
child 52571 f55d2d1ba03e9659d728d5b2a5612e1a8c04e9a1
child 52789 979bdae64d82b1d4a0657f49a023cf1f72ce0105
child 52791 c349820af8e16ccde454d5dac9c9fdf571cc1cdb
push id4666
push usermozilla@hocat.ca
push dateTue, 11 Jul 2017 16:58:11 +0000
treeherdertry-comm-central@915f309b28d0 [default view] [failures only]
reviewersjorgk
bugs1354845, 1275731, 1288841, 1354208, 1355968, 1357194
Bug 1354845 - Add IA2Marshal and AccessibleHandler to TB. f=mhowell, r=jorgk Bug 1275731 - Add IA2Marshal.dll to package and installer Bug 1288841 - Add a typelib containing info for IServiceProvider and IEnumVARIANT Bug 1354208 - Add AccessibleHandler.dll to installer Bug 1355968 - Ensure AccessibleHandler.dll is registered in PostUpdate Bug 1357194 - Use MOZ_UPDATE_CHANNEL to distinguish between local/nightly and beta/release builds for AccessibleHandler CLSIDs
mail/installer/package-manifest.in
mail/installer/windows/nsis/defines.nsi.in
mail/installer/windows/nsis/installer.nsi
mail/installer/windows/nsis/shared.nsh
mail/installer/windows/nsis/uninstaller.nsi
--- a/mail/installer/package-manifest.in
+++ b/mail/installer/package-manifest.in
@@ -391,17 +391,20 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; Base Package Files
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 @RESPATH@/components/alerts.xpt
 ; accessibility (out of process API support)
 #ifdef ACCESSIBILITY
 #ifdef XP_WIN32
+@BINPATH@/Accessible.tlb
+@BINPATH@/AccessibleHandler.dll
 @BINPATH@/AccessibleMarshal.dll
+@BINPATH@/IA2Marshal.dll
 #endif
 @RESPATH@/components/accessibility.xpt
 #endif
 @RESPATH@/components/appshell.xpt
 @RESPATH@/components/appstartup.xpt
 @RESPATH@/components/autocomplete.xpt
 @RESPATH@/components/browser-element.xpt
 ; caps (JavaScript security)
--- a/mail/installer/windows/nsis/defines.nsi.in
+++ b/mail/installer/windows/nsis/defines.nsi.in
@@ -34,16 +34,36 @@
 # (e.g. Alpha X, Beta X, etc.) to prevent finding a non-default installation
 # directory in the registry and using that as the default. This prevents
 # Beta releases built with official branding from finding an existing install
 # of an official release and defaulting to its installation directory.
 !if "@PRE_RELEASE_SUFFIX@" != ""
 !define NO_INSTDIR_FROM_REG
 !endif
 
+# 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
+
 # ARCH is used when it is necessary to differentiate the x64 registry keys from
 # the x86 registry keys (e.g. the uninstall registry key).
 #ifdef HAVE_64BIT_BUILD
 !define HAVE_64BIT_BUILD
 !define ARCH "x64"
 !define MinSupportedVer "Microsoft Windows 7 x64"
 #else
 !define MinSupportedVer "Microsoft Windows 7"
--- a/mail/installer/windows/nsis/installer.nsi
+++ b/mail/installer/windows/nsis/installer.nsi
@@ -313,16 +313,26 @@ Section "-Application" APP_IDX
   ${RegisterDLL} "$INSTDIR\AccessibleMarshal.dll"
   ${If} ${Errors}
     ${LogMsg} "** ERROR Registering: $INSTDIR\AccessibleMarshal.dll **"
   ${Else}
     ${LogUninstall} "DLLReg: \AccessibleMarshal.dll"
     ${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
   ; parent directories will be removed.
   ${LogUninstall} "File: \components\compreg.dat"
   ${LogUninstall} "File: \components\xpti.dat"
   ${LogUninstall} "File: \active-update.xml"
   ${LogUninstall} "File: \install.log"
--- a/mail/installer/windows/nsis/shared.nsh
+++ b/mail/installer/windows/nsis/shared.nsh
@@ -77,16 +77,19 @@
 
   ${SetAppKeys}
   ${SetUninstallKeys}
 
   ; 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}
+
 !ifdef MOZ_MAINTENANCE_SERVICE
   Call IsUserAdmin
   Pop $R0
   ${If} $R0 == "true"
   ; Only proceed if we have HKLM write access
   ${AndIf} $TmpVal == "HKLM"
     ; We check to see if the maintenance service install was already attempted.
     ; Since the Maintenance service can be installed either x86 or x64,
@@ -645,16 +648,21 @@
     ClearErrors
   ${EndIf}
   ; Restore the previously used value back
   Pop $R0
 !macroend
 !define AddMaintCertKeys "!insertmacro AddMaintCertKeys"
 !endif
 
+!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"
 
   ; remove DI and SOC from the .eml class if it exists and contains
   ; thunderbird.exe
   ClearErrors
   ReadRegStr $1 HKLM "$0\.eml\shell\open\command" ""
@@ -972,17 +980,19 @@
 ; required message is displayed. All files must be located in the $INSTDIR
 ; directory.
 !macro PushFilesToCheck
   ; The first string to be pushed onto the stack MUST be "end" to indicate
   ; that there are no more files to check in $INSTDIR and the last string
   ; 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"
   Push "nssdbm3.dll"
   Push "sqlite3.dll"
   Push "mozsqlite3.dll"
   Push "xpcom.dll"
   Push "crashreporter.exe"
--- a/mail/installer/windows/nsis/uninstaller.nsi
+++ b/mail/installer/windows/nsis/uninstaller.nsi
@@ -370,16 +370,28 @@ Section "Uninstall"
   ${If} ${FileExists} "$INSTDIR\mozMapi32_InUse.dll"
     Delete /REBOOTOK "$INSTDIR\mozMapi32_InUse.dll"
   ${EndIf}
 
   ; Remove files that may be left behind by the application in the
   ; 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}
 
   ; Remove the uninstall directory that we control
   RmDir /r /REBOOTOK "$INSTDIR\uninstall"
 
   ; Remove the installation directory if it is empty