Bug 1354845 - Add IA2Marshal and AccessibleHandler to SeaMonkey. r=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Mon, 31 Jul 2017 22:26:28 +0200
changeset 28527 da7456b68187d2b8d145ee05b892f1e0f2fb21ff
parent 28526 3e3a3b2bdf4721995914e0f6a4e470011eab3878
child 28528 33bf974fa8f86d492b9a9f0015bd93728c1b610f
push id1986
push userclokep@gmail.com
push dateWed, 02 Aug 2017 14:43:31 +0000
treeherdercomm-beta@b51c9adf2c9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN
bugs1354845, 1275731, 1288841, 1354208, 1355968, 1357194
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
suite/installer/windows/nsis/defines.nsi.in
suite/installer/windows/nsis/installer.nsi
suite/installer/windows/nsis/shared.nsh
suite/installer/windows/nsis/uninstaller.nsi
--- a/suite/installer/package-manifest.in
+++ b/suite/installer/package-manifest.in
@@ -155,17 +155,20 @@
 #else
 @BINPATH@/@DLL_PREFIX@qipcap@DLL_SUFFIX@
 #endif
 #endif
 
 ; [Components]
 #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/alerts.xpt
 @RESPATH@/components/appshell.xpt
 @RESPATH@/components/appstartup.xpt
 @RESPATH@/components/autocomplete.xpt
 @RESPATH@/components/autoconfig.xpt
--- a/suite/installer/windows/nsis/defines.nsi.in
+++ b/suite/installer/windows/nsis/defines.nsi.in
@@ -24,16 +24,36 @@
 !define MinSupportedVer "Microsoft Windows 7 x64"
 #else
 !define ARCH "x86"
 !define MinSupportedVer "Microsoft Windows 7"
 #endif
 
 !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}"
 VIAddVersionKey "CompanyName"     "${CompanyName}"
 VIAddVersionKey "LegalTrademarks" "${BrandShortName} is a Trademark of The Mozilla Foundation."
 VIAddVersionKey "LegalCopyright"  "${CompanyName}"
 VIAddVersionKey "FileVersion"     "${AppVersion}"
 VIAddVersionKey "ProductVersion"  "${AppVersion}"
--- a/suite/installer/windows/nsis/installer.nsi
+++ b/suite/installer/windows/nsis/installer.nsi
@@ -294,39 +294,49 @@ Section "-Application" APP_IDX
   ${LogUninstall} "File: \mozMapi32_InUse.dll"
 
   ; Register DLLs
   ; XXXrstrong - AccessibleMarshal.dll can be used by multiple applications but
   ; is only registered for the last application installed. When the last
   ; 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 **"
   ${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"
   ${LogUninstall} "File: \install_status.log"
   ${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 == ""
     StrCpy $AddStartMenuSC "1"
   ${EndIf}
 
 ; Default for creating Task Bar shortcuts
   ; (1 = create, 0 = don't create)
--- a/suite/installer/windows/nsis/shared.nsh
+++ b/suite/installer/windows/nsis/shared.nsh
@@ -70,16 +70,19 @@
   ; Add Software\Mozilla\ registry entries
   ${SetAppKeys}
 
   ${FixClassKeys}
 
   ; 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"
 
 !macro SetAsDefaultAppUser
   SetShellVarContext current
 
   ; It is only possible to set this installation of the application as the
   ; handler for the various types if those types were added to the respective
@@ -750,16 +753,21 @@
   ${IsHandlerForInstallDir} "nntp" $R9
   ${If} "$R9" == "true"
     ${AddHandlerValues} "SOFTWARE\Classes\nntp" "$2" "$8,0" "" "" ""
   ${EndIf}
 !macroend
 !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"
   ; Remove support for launching gopher urls from the shell during install or
   ; update if the DefaultIcon is from seamonkey.exe.
   ${RegCleanAppHandler} "gopher"
   
   ; Remove support for launching chrome urls from the shell during install or
@@ -977,17 +985,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/suite/installer/windows/nsis/uninstaller.nsi
+++ b/suite/installer/windows/nsis/uninstaller.nsi
@@ -346,16 +346,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