Browse Source

Remove conditional MOZ_MAINTENANCE_SERVICE code

Tag #145
pull/1/head
wolfbeast 3 years ago committed by Roy Tam
parent
commit
03821e0bfc
  1. 3
      application/basilisk/Makefile.in
  2. 5
      application/basilisk/app/profile/basilisk.js
  3. 19
      application/basilisk/components/preferences/in-content/advanced.js
  4. 13
      application/basilisk/components/preferences/in-content/advanced.xul
  5. 4
      application/basilisk/confvars.sh
  6. 7
      application/basilisk/installer/package-manifest.in
  7. 6
      application/basilisk/installer/windows/Makefile.in
  8. 4
      application/basilisk/installer/windows/nsis/defines.nsi.in
  9. 100
      application/basilisk/installer/windows/nsis/installer.nsi
  10. 335
      application/basilisk/installer/windows/nsis/maintenanceservice_installer.nsi
  11. 93
      application/basilisk/installer/windows/nsis/shared.nsh
  12. 18
      application/basilisk/installer/windows/nsis/uninstaller.nsi
  13. 1
      application/palemoon/confvars.sh
  14. 17
      application/palemoon/installer/windows/Makefile.in
  15. 4
      application/palemoon/installer/windows/nsis/defines.nsi.in
  16. 100
      application/palemoon/installer/windows/nsis/installer.nsi
  17. 332
      application/palemoon/installer/windows/nsis/maintenanceservice_installer.nsi
  18. 93
      application/palemoon/installer/windows/nsis/shared.nsh
  19. 18
      application/palemoon/installer/windows/nsis/uninstaller.nsi
  20. 4
      application/xulrunner/confvars.sh
  21. 18
      old-configure.in
  22. 7
      toolkit/modules/AppConstants.jsm
  23. 13
      toolkit/moz.build
  24. 7
      toolkit/mozapps/installer/windows/nsis/makensis.mk
  25. 5
      toolkit/mozapps/update/common/moz.build
  26. 9
      toolkit/mozapps/update/common/sources.mozbuild
  27. 111
      toolkit/mozapps/update/nsUpdateService.js
  28. 10
      toolkit/mozapps/update/tests/TestAUSHelper.cpp
  29. 6
      toolkit/mozapps/update/tests/moz.build
  30. 62
      toolkit/mozapps/update/updater/updater.cpp

3
application/basilisk/Makefile.in

@ -10,7 +10,4 @@ ifdef MAKENSISU
# uninstaller is included with the application for mar file generation.
libs::
$(MAKE) -C installer/windows uninstaller
ifdef MOZ_MAINTENANCE_SERVICE
$(MAKE) -C installer/windows maintenanceservice_installer
endif
endif

5
application/basilisk/app/profile/basilisk.js

@ -153,11 +153,6 @@ pref("app.update.url", "https://aus5.mozilla.org/update/6/%PRODUCT%/%VERSION%/%B
// Show the Update Checking/Ready UI when the user was idle for x seconds
pref("app.update.idletime", 60);
// Whether or not to attempt using the service for updates.
#ifdef MOZ_MAINTENANCE_SERVICE
pref("app.update.service.enabled", true);
#endif
// Symmetric (can be overridden by individual extensions) update preferences.
// e.g.
// extensions.{GUID}.update.enabled

19
application/basilisk/components/preferences/in-content/advanced.js

@ -670,25 +670,6 @@ var gAdvancedPane = {
// or the binary platform or OS version is not known.
// A locked pref is sufficient to disable the radiogroup.
radiogroup.disabled = !canCheck || enabledPref.locked || autoPref.locked;
if (AppConstants.MOZ_MAINTENANCE_SERVICE) {
// Check to see if the maintenance service is installed.
// If it is don't show the preference at all.
var installed;
try {
var wrk = Components.classes["@mozilla.org/windows-registry-key;1"]
.createInstance(Components.interfaces.nsIWindowsRegKey);
wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
"SOFTWARE\\Mozilla\\MaintenanceService",
wrk.ACCESS_READ | wrk.WOW64_64);
installed = wrk.readIntValue("Installed");
wrk.close();
} catch (e) {
}
if (installed != 1) {
document.getElementById("useService").hidden = true;
}
}
}
},

13
application/basilisk/components/preferences/in-content/advanced.xul

@ -79,12 +79,6 @@
<preference id="app.update.disable_button.showUpdateHistory"
name="app.update.disable_button.showUpdateHistory"
type="bool"/>
#ifdef MOZ_MAINTENANCE_SERVICE
<preference id="app.update.service.enabled"
name="app.update.service.enabled"
type="bool"/>
#endif
#endif
<preference id="browser.search.update"
@ -331,13 +325,6 @@
accesskey="&updateHistory.accesskey;"
preference="app.update.disable_button.showUpdateHistory"/>
</hbox>
#ifdef MOZ_MAINTENANCE_SERVICE
<checkbox id="useService"
label="&useService.label;"
accesskey="&useService.accesskey;"
preference="app.update.service.enabled"/>
#endif
</groupbox>
#endif
<groupbox id="updateOthers" align="start">

4
application/basilisk/confvars.sh

@ -15,10 +15,6 @@ if test "$OS_ARCH" = "WINNT" -o \
MOZ_BUNDLED_FONTS=1
fi
if test "$OS_ARCH" = "WINNT"; then
MOZ_MAINTENANCE_SERVICE=
fi
# For Basilisk we want to use 52.9.YYYY.MM.DD as MOZ_APP_VERSION in release
# builds so add-on developers have something to target while maintaining
# Firefox compatiblity.

7
application/basilisk/installer/package-manifest.in

@ -742,13 +742,6 @@ bin/libfreebl_32int64_3.so
#endif
#endif
; [MaintenanceService]
;
#ifdef MOZ_MAINTENANCE_SERVICE
@BINPATH@/maintenanceservice.exe
@BINPATH@/maintenanceservice_installer.exe
#endif
@RESPATH@/components/dom_audiochannel.xpt
; Shutdown Terminator

6
application/basilisk/installer/windows/Makefile.in

@ -14,12 +14,6 @@ INSTALLER_FILES = \
nsis/shared.nsh \
$(NULL)
ifdef MOZ_MAINTENANCE_SERVICE
INSTALLER_FILES += \
nsis/maintenanceservice_installer.nsi \
$(NULL)
endif
BRANDING_FILES = \
branding.nsi \
appname.bmp \

4
application/basilisk/installer/windows/nsis/defines.nsi.in

@ -51,10 +51,6 @@
!define MinSupportedCPU "SSE2"
#ifdef MOZ_MAINTENANCE_SERVICE
!define MOZ_MAINTENANCE_SERVICE
#endif
# File details shared by both the installer and uninstaller
VIProductVersion "1.0.0.0"
VIAddVersionKey "ProductName" "${BrandShortName}"

100
application/basilisk/installer/windows/nsis/installer.nsi

@ -165,11 +165,6 @@ Page custom preOptions leaveOptions
!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
!insertmacro MUI_PAGE_DIRECTORY
; Custom Components Page
!ifdef MOZ_MAINTENANCE_SERVICE
Page custom preComponents leaveComponents
!endif
; Custom Shortcuts Page
Page custom preShortcuts leaveShortcuts
@ -427,41 +422,6 @@ Section "-Application" APP_IDX
${EndIf}
${EndIf}
!ifdef MOZ_MAINTENANCE_SERVICE
; If the maintenance service page was displayed then a value was already
; explicitly selected for installing the maintenance service and
; and so InstallMaintenanceService will already be 0 or 1.
; If the maintenance service page was not displayed then
; InstallMaintenanceService will be equal to "".
${If} $InstallMaintenanceService == ""
Call IsUserAdmin
Pop $R0
${If} $R0 == "true"
; Only proceed if we have HKLM write access
${AndIf} $TmpVal == "HKLM"
; On Windows < XP SP3 we do not install the maintenance service.
${If} ${IsWinXP}
${AndIf} ${AtMostServicePack} 2
StrCpy $InstallMaintenanceService "0"
${Else}
; The user is an admin, so we should default to installing the service.
StrCpy $InstallMaintenanceService "1"
${EndIf}
${Else}
; The user is not admin, so we can't install the service.
StrCpy $InstallMaintenanceService "0"
${EndIf}
${EndIf}
${If} $InstallMaintenanceService == "1"
; The user wants to install the maintenance service, so execute
; the pre-packaged maintenance service installer.
; This option can only be turned on if the user is an admin so there
; is no need to use ExecShell w/ verb runas to enforce elevated.
nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\""
${EndIf}
!endif
; These need special handling on uninstall since they may be overwritten by
; an install into a different location.
StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\App Paths\${FileMainEXE}"
@ -578,13 +538,6 @@ Section "-Application" APP_IDX
${EndIf}
${EndUnless}
${EndIf}
!ifdef MOZ_MAINTENANCE_SERVICE
${If} $TmpVal == "HKLM"
; Add the registry keys for allowed certificates.
${AddMaintCertKeys}
${EndIf}
!endif
SectionEnd
; Cleanup operations to perform at the end of the installation.
@ -948,59 +901,6 @@ Function leaveShortcuts
${EndIf}
FunctionEnd
!ifdef MOZ_MAINTENANCE_SERVICE
Function preComponents
; If the service already exists, don't show this page
ServicesHelper::IsInstalled "MozillaMaintenance"
Pop $R9
${If} $R9 == 1
; The service already exists so don't show this page.
Abort
${EndIf}
; On Windows < XP SP3 we do not install the maintenance service.
${If} ${IsWinXP}
${AndIf} ${AtMostServicePack} 2
Abort
${EndIf}
; Don't show the custom components page if the
; user is not an admin
Call IsUserAdmin
Pop $R9
${If} $R9 != "true"
Abort
${EndIf}
; Only show the maintenance service page if we have write access to HKLM
ClearErrors
WriteRegStr HKLM "Software\Mozilla" \
"${BrandShortName}InstallerTest" "Write Test"
${If} ${Errors}
ClearErrors
Abort
${Else}
DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest"
${EndIf}
StrCpy $PageName "Components"
${CheckCustomCommon}
!insertmacro MUI_HEADER_TEXT "$(COMPONENTS_PAGE_TITLE)" "$(COMPONENTS_PAGE_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "components.ini"
FunctionEnd
Function leaveComponents
${MUI_INSTALLOPTIONS_READ} $0 "components.ini" "Settings" "State"
${If} $0 != 0
Abort
${EndIf}
${MUI_INSTALLOPTIONS_READ} $InstallMaintenanceService "components.ini" "Field 2" "State"
${If} $InstallType == ${INSTALLTYPE_CUSTOM}
Call CheckExistingInstall
${EndIf}
FunctionEnd
!endif
Function preSummary
StrCpy $PageName "Summary"
; Setup the summary.ini file for the Custom Summary Page

335
application/basilisk/installer/windows/nsis/maintenanceservice_installer.nsi

@ -1,335 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
; Set verbosity to 3 (e.g. no script) to lessen the noise in the build logs
!verbose 3
; 7-Zip provides better compression than the lzma from NSIS so we add the files
; uncompressed and use 7-Zip to create a SFX archive of it
SetDatablockOptimize on
SetCompress off
CRCCheck on
RequestExecutionLevel admin
; The commands inside this ifdef require NSIS 3.0a2 or greater so the ifdef can
; be removed after we require NSIS 3.0a2 or greater.
!ifdef NSIS_PACKEDVERSION
Unicode true
ManifestSupportedOS all
ManifestDPIAware true
!endif
!addplugindir ./
; Variables
Var TempMaintServiceName
Var BrandFullNameDA
Var BrandFullName
; Other included files may depend upon these includes!
; The following includes are provided by NSIS.
!include FileFunc.nsh
!include LogicLib.nsh
!include MUI.nsh
!include WinMessages.nsh
!include WinVer.nsh
!include WordFunc.nsh
!insertmacro GetOptions
!insertmacro GetParameters
!insertmacro GetSize
; The test slaves use this fallback key to run tests.
; And anyone that wants to run tests themselves should already have
; this installed.
!define FallbackKey \
"SOFTWARE\Mozilla\MaintenanceService\3932ecacee736d366d6436db0f55bce4"
!define CompanyName "Mozilla Corporation"
!define BrandFullNameInternal ""
; The following includes are custom.
!include defines.nsi
; We keep defines.nsi defined so that we get other things like
; the version number, but we redefine BrandFullName
!define MaintFullName "Mozilla Maintenance Service"
!undef BrandFullName
!define BrandFullName "${MaintFullName}"
!include common.nsh
!include locales.nsi
VIAddVersionKey "FileDescription" "${MaintFullName} Installer"
VIAddVersionKey "OriginalFilename" "maintenanceservice_installer.exe"
Name "${MaintFullName}"
OutFile "maintenanceservice_installer.exe"
; Get installation folder from registry if available
InstallDirRegKey HKLM "Software\Mozilla\MaintenanceService" ""
SetOverwrite on
; serviceinstall.cpp also uses this key, in case the path is changed, update
; there too.
!define MaintUninstallKey \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\MozillaMaintenanceService"
; Always install into the 32-bit location even if we have a 64-bit build.
; This is because we use only 1 service for all Basilisk channels.
; Allow either x86 and x64 builds to exist at this location, depending on
; what is the latest build.
InstallDir "$PROGRAMFILES32\${MaintFullName}\"
ShowUnInstDetails nevershow
################################################################################
# Modern User Interface - MUI
!define MUI_ICON setup.ico
!define MUI_UNICON setup.ico
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_UNWELCOMEFINISHPAGE_BITMAP wizWatermark.bmp
;Interface Settings
!define MUI_ABORTWARNING
; Uninstaller Pages
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
################################################################################
# Language
!insertmacro MOZ_MUI_LANGUAGE 'baseLocale'
!verbose push
!verbose 3
!include "overrideLocale.nsh"
!include "customLocale.nsh"
!verbose pop
; Set this after the locale files to override it if it is in the locale
; using " " for BrandingText will hide the "Nullsoft Install System..." branding
BrandingText " "
Function .onInit
; Remove the current exe directory from the search order.
; This only effects LoadLibrary calls and not implicitly loaded DLLs.
System::Call 'kernel32::SetDllDirectoryW(w "")'
SetSilent silent
; On Windows 2000 we do not install the maintenance service.
; We won't run this installer from the parent installer, but just in case
; someone tries to execute it on Windows 2000...
${Unless} ${AtLeastWinXP}
Abort
${EndUnless}
FunctionEnd
Function un.onInit
; Remove the current exe directory from the search order.
; This only effects LoadLibrary calls and not implicitly loaded DLLs.
System::Call 'kernel32::SetDllDirectoryW(w "")'
; The commands inside this ifndef are needed prior to NSIS 3.0a2 and can be
; removed after we require NSIS 3.0a2 or greater.
!ifndef NSIS_PACKEDVERSION
${If} ${AtLeastWinVista}
System::Call 'user32::SetProcessDPIAware()'
${EndIf}
!endif
StrCpy $BrandFullNameDA "${MaintFullName}"
StrCpy $BrandFullName "${MaintFullName}"
FunctionEnd
Section "MaintenanceService"
AllowSkipFiles off
CreateDirectory $INSTDIR
SetOutPath $INSTDIR
; If the service already exists, then it will be stopped when upgrading it
; via the maintenanceservice_tmp.exe command executed below.
; The maintenanceservice_tmp.exe command will rename the file to
; maintenanceservice.exe if maintenanceservice_tmp.exe is newer.
; If the service does not exist yet, we install it and drop the file on
; disk as maintenanceservice.exe directly.
StrCpy $TempMaintServiceName "maintenanceservice.exe"
IfFileExists "$INSTDIR\maintenanceservice.exe" 0 skipAlreadyExists
StrCpy $TempMaintServiceName "maintenanceservice_tmp.exe"
skipAlreadyExists:
; We always write out a copy and then decide whether to install it or
; not via calling its 'install' cmdline which works by version comparison.
CopyFiles "$EXEDIR\maintenanceservice.exe" "$INSTDIR\$TempMaintServiceName"
; The updater.ini file is only used when performing an install or upgrade,
; and only if that install or upgrade is successful. If an old updater.ini
; happened to be copied into the maintenance service installation directory
; but the service was not newer, the updater.ini file would be unused.
; It is used to fill the description of the service on success.
CopyFiles "$EXEDIR\updater.ini" "$INSTDIR\updater.ini"
; Install the application maintenance service.
; If a service already exists, the command line parameter will stop the
; service and only install itself if it is newer than the already installed
; service. If successful it will remove the old maintenanceservice.exe
; and replace it with maintenanceservice_tmp.exe.
ClearErrors
${GetParameters} $0
${GetOptions} "$0" "/Upgrade" $0
${If} ${Errors}
ExecWait '"$INSTDIR\$TempMaintServiceName" install'
${Else}
; The upgrade cmdline is the same as install except
; It will fail if the service isn't already installed.
ExecWait '"$INSTDIR\$TempMaintServiceName" upgrade'
${EndIf}
WriteUninstaller "$INSTDIR\Uninstall.exe"
WriteRegStr HKLM "${MaintUninstallKey}" "DisplayName" "${MaintFullName}"
WriteRegStr HKLM "${MaintUninstallKey}" "UninstallString" \
'"$INSTDIR\uninstall.exe"'
WriteRegStr HKLM "${MaintUninstallKey}" "DisplayIcon" \
"$INSTDIR\Uninstall.exe,0"
WriteRegStr HKLM "${MaintUninstallKey}" "DisplayVersion" "${AppVersion}"
WriteRegStr HKLM "${MaintUninstallKey}" "Publisher" "Mozilla"
WriteRegStr HKLM "${MaintUninstallKey}" "Comments" "${BrandFullName}"
WriteRegDWORD HKLM "${MaintUninstallKey}" "NoModify" 1
${GetSize} "$INSTDIR" "/S=0K" $R2 $R3 $R4
WriteRegDWORD HKLM "${MaintUninstallKey}" "EstimatedSize" $R2
; Write out that a maintenance service was attempted.
; We do this because on upgrades we will check this value and we only
; want to install once on the first upgrade to maintenance service.
; Also write out that we are currently installed, preferences will check
; this value to determine if we should show the service update pref.
; Since the Maintenance service can be installed either x86 or x64,
; always use the 64-bit registry for checking if an attempt was made.
${If} ${RunningX64}
SetRegView 64
${EndIf}
WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1
WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Installed" 1
DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled"
; Included here for debug purposes only.
; These keys are used to bypass the installation dir is a valid installation
; check from the service so that tests can be run.
; WriteRegStr HKLM "${FallbackKey}\0" "name" "Mozilla Corporation"
; WriteRegStr HKLM "${FallbackKey}\0" "issuer" "DigiCert SHA2 Assured ID Code Signing CA"
${If} ${RunningX64}
SetRegView lastused
${EndIf}
SectionEnd
; By renaming before deleting we improve things slightly in case
; there is a file in use error. In this case a new install can happen.
Function un.RenameDelete
Pop $9
; If the .moz-delete file already exists previously, delete it
; If it doesn't exist, the call is ignored.
; We don't need to pass /REBOOTOK here since it was already marked that way
; if it exists.
Delete "$9.moz-delete"
Rename "$9" "$9.moz-delete"
${If} ${Errors}
Delete /REBOOTOK "$9"
${Else}
Delete /REBOOTOK "$9.moz-delete"
${EndIf}
ClearErrors
FunctionEnd
Section "Uninstall"
; Delete the service so that no updates will be attempted
ExecWait '"$INSTDIR\maintenanceservice.exe" uninstall'
Push "$INSTDIR\updater.ini"
Call un.RenameDelete
Push "$INSTDIR\maintenanceservice.exe"
Call un.RenameDelete
Push "$INSTDIR\maintenanceservice_tmp.exe"
Call un.RenameDelete
Push "$INSTDIR\maintenanceservice.old"
Call un.RenameDelete
Push "$INSTDIR\Uninstall.exe"
Call un.RenameDelete
Push "$INSTDIR\update\updater.ini"
Call un.RenameDelete
Push "$INSTDIR\update\updater.exe"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-1.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-2.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-3.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-4.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-5.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-6.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-7.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-8.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-9.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-10.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-install.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-uninstall.log"
Call un.RenameDelete
SetShellVarContext all
Push "$APPDATA\Mozilla\logs\maintenanceservice.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-1.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-2.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-3.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-4.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-5.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-6.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-7.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-8.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-9.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-10.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-install.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-uninstall.log"
Call un.RenameDelete
RMDir /REBOOTOK "$APPDATA\Mozilla\logs"
RMDir /REBOOTOK "$APPDATA\Mozilla"
RMDir /REBOOTOK "$INSTDIR\logs"
RMDir /REBOOTOK "$INSTDIR\update"
RMDir /REBOOTOK "$INSTDIR"
DeleteRegKey HKLM "${MaintUninstallKey}"
${If} ${RunningX64}
SetRegView 64
${EndIf}
DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "Installed"
DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled"
DeleteRegKey HKLM "${FallbackKey}\"
${If} ${RunningX64}
SetRegView lastused
${EndIf}
SectionEnd

93
application/basilisk/installer/windows/nsis/shared.nsh

@ -124,51 +124,6 @@
${FixDistributionsINI}
RmDir /r /REBOOTOK "$INSTDIR\${TO_BE_DELETED}"
!ifdef MOZ_MAINTENANCE_SERVICE
Call IsUserAdmin
Pop $R0
${If} $R0 == "true"
; Only proceed if we have HKLM write access
${AndIf} $TmpVal == "HKLM"
; On Windows 2000 we do not install the maintenance service.
${AndIf} ${AtLeastWinXP}
; We check to see if the maintenance service install was already attempted.
; Since the Maintenance service can be installed either x86 or x64,
; always use the 64-bit registry for checking if an attempt was made.
${If} ${RunningX64}
SetRegView 64
${EndIf}
ReadRegDWORD $5 HKLM "Software\Mozilla\MaintenanceService" "Attempted"
ClearErrors
${If} ${RunningX64}
SetRegView lastused
${EndIf}
; Add the registry keys for allowed certificates.
${AddMaintCertKeys}
; If the maintenance service is already installed, do nothing.
; The maintenance service will launch:
; maintenanceservice_installer.exe /Upgrade to upgrade the maintenance
; service if necessary. If the update was done from updater.exe without
; the service (i.e. service is failing), updater.exe will do the update of
; the service. The reasons we do not do it here is because we don't want
; to have to prompt for limited user accounts when the service isn't used
; and we currently call the PostUpdate twice, once for the user and once
; for the SYSTEM account. Also, this would stop the maintenance service
; and we need a return result back to the service when run that way.
${If} $5 == ""
; An install of maintenance service was never attempted.
; We know we are an Admin and that we have write access into HKLM
; based on the above checks, so attempt to just run the EXE.
; In the worst case, in case there is some edge case with the
; IsAdmin check and the permissions check, the maintenance service
; will just fail to be attempted to be installed.
nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\""
${EndIf}
${EndIf}
!endif
!macroend
!define PostUpdate "!insertmacro PostUpdate"
@ -720,54 +675,6 @@
!macroend
!define UpdateProtocolHandlers "!insertmacro UpdateProtocolHandlers"
!ifdef MOZ_MAINTENANCE_SERVICE
; Adds maintenance service certificate keys for the install dir.
; For the cert to work, it must also be signed by a trusted cert for the user.
!macro AddMaintCertKeys
Push $R0
; Allow main Mozilla cert information for updates
; This call will push the needed key on the stack
ServicesHelper::PathToUniqueRegistryPath "$INSTDIR"
Pop $R0
${If} $R0 != ""
; More than one certificate can be specified in a different subfolder
; for example: $R0\1, but each individual binary can be signed
; with at most one certificate. A fallback certificate can only be used
; if the binary is replaced with a different certificate.
; We always use the 64bit registry for certs.
${If} ${RunningX64}
SetRegView 64
${EndIf}
; PrefetchProcessName was originally used to experiment with deleting
; Windows prefetch as a speed optimization. It is no longer used though.
DeleteRegValue HKLM "$R0" "prefetchProcessName"
; Setting the Attempted value will ensure that a new Maintenance Service
; install will never be attempted again after this from updates. The value
; is used only to see if updates should attempt new service installs.
WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1
; These values associate the allowed certificates for the current
; installation.
WriteRegStr HKLM "$R0\0" "name" "${CERTIFICATE_NAME}"
WriteRegStr HKLM "$R0\0" "issuer" "${CERTIFICATE_ISSUER}"
; These values associate the allowed certificates for the previous
; installation, so that we can update from it cleanly using the
; old updater.exe (which will still have this signature).
WriteRegStr HKLM "$R0\1" "name" "${CERTIFICATE_NAME_PREVIOUS}"
WriteRegStr HKLM "$R0\1" "issuer" "${CERTIFICATE_ISSUER_PREVIOUS}"
${If} ${RunningX64}
SetRegView lastused
${EndIf}
ClearErrors
${EndIf}
; Restore the previously used value back
Pop $R0
!macroend
!define AddMaintCertKeys "!insertmacro AddMaintCertKeys"
!endif
; Removes various registry entries for reasons noted below (does not use SHCTX).
!macro RemoveDeprecatedKeys
StrCpy $0 "SOFTWARE\Classes"

18
application/basilisk/installer/windows/nsis/uninstaller.nsi

@ -450,24 +450,6 @@ Section "Uninstall"
; uninstalls of Basilisk-release with reinstalls of Basilisk-release, for example.
WriteRegStr HKCU "Software\Mozilla\Basilisk" "Uninstalled-${UpdateChannel}" "True"
!ifdef MOZ_MAINTENANCE_SERVICE
; Get the path the allowed cert is at and remove it
; Keep this block of code last since it modfies the reg view
ServicesHelper::PathToUniqueRegistryPath "$INSTDIR"
Pop $MaintCertKey
${If} $MaintCertKey != ""
; Always use the 64bit registry for certs on 64bit systems.
${If} ${RunningX64}
SetRegView 64
${EndIf}
DeleteRegKey HKLM "$MaintCertKey"
${If} ${RunningX64}
SetRegView lastused
${EndIf}
${EndIf}
Call un.UninstallServiceIfNotUsed
!endif
${un.IsFirewallSvcRunning}
Pop $0
${If} "$0" == "true"

1
application/palemoon/confvars.sh

@ -99,7 +99,6 @@ if test "$OS_ARCH" = "WINNT" -o \
fi
# Short-circuit a few services to be removed
MOZ_MAINTENANCE_SERVICE=
MOZ_SERVICES_HEALTHREPORT=
MOZ_ADDON_SIGNING=0
MOZ_REQUIRE_SIGNING=0

17
application/palemoon/installer/windows/Makefile.in

@ -14,12 +14,6 @@ INSTALLER_FILES = \
nsis/shared.nsh \
$(NULL)
ifdef MOZ_MAINTENANCE_SERVICE
INSTALLER_FILES += \
nsis/maintenanceservice_installer.nsi \
$(NULL)
endif
BRANDING_FILES = \
branding.nsi \
appname.bmp \
@ -58,17 +52,6 @@ uninstaller::
--preprocess-locale $(topsrcdir) \
$(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
# For building the maintenanceservice installer
ifdef MOZ_MAINTENANCE_SERVICE
maintenanceservice_installer::
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--preprocess-locale $(topsrcdir) \
$(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
endif
$(CONFIG_DIR)/setup.exe::
$(RM) -r $(CONFIG_DIR)
$(MKDIR) $(CONFIG_DIR)

4
application/palemoon/installer/windows/nsis/defines.nsi.in

@ -51,10 +51,6 @@
!define MinSupportedCPU "SSE2"
#ifdef MOZ_MAINTENANCE_SERVICE
!define MOZ_MAINTENANCE_SERVICE
#endif
# File details shared by both the installer and uninstaller
VIProductVersion "1.0.0.0"
VIAddVersionKey "ProductName" "${BrandShortName}"

100
application/palemoon/installer/windows/nsis/installer.nsi

@ -165,11 +165,6 @@ Page custom preOptions leaveOptions
!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
!insertmacro MUI_PAGE_DIRECTORY
; Custom Components Page
!ifdef MOZ_MAINTENANCE_SERVICE
Page custom preComponents leaveComponents
!endif
; Custom Shortcuts Page
Page custom preShortcuts leaveShortcuts
@ -427,41 +422,6 @@ Section "-Application" APP_IDX
${EndIf}
${EndIf}
!ifdef MOZ_MAINTENANCE_SERVICE
; If the maintenance service page was displayed then a value was already
; explicitly selected for installing the maintenance service and
; and so InstallMaintenanceService will already be 0 or 1.
; If the maintenance service page was not displayed then
; InstallMaintenanceService will be equal to "".
${If} $InstallMaintenanceService == ""
Call IsUserAdmin
Pop $R0
${If} $R0 == "true"
; Only proceed if we have HKLM write access
${AndIf} $TmpVal == "HKLM"
; On Windows < XP SP3 we do not install the maintenance service.
${If} ${IsWinXP}
${AndIf} ${AtMostServicePack} 2
StrCpy $InstallMaintenanceService "0"
${Else}
; The user is an admin, so we should default to installing the service.
StrCpy $InstallMaintenanceService "1"
${EndIf}
${Else}
; The user is not admin, so we can't install the service.
StrCpy $InstallMaintenanceService "0"
${EndIf}
${EndIf}
${If} $InstallMaintenanceService == "1"
; The user wants to install the maintenance service, so execute
; the pre-packaged maintenance service installer.
; This option can only be turned on if the user is an admin so there
; is no need to use ExecShell w/ verb runas to enforce elevated.
nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\""
${EndIf}
!endif
; These need special handling on uninstall since they may be overwritten by
; an install into a different location.
StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\App Paths\${FileMainEXE}"
@ -578,13 +538,6 @@ Section "-Application" APP_IDX
${EndIf}
${EndUnless}
${EndIf}
!ifdef MOZ_MAINTENANCE_SERVICE
${If} $TmpVal == "HKLM"
; Add the registry keys for allowed certificates.
${AddMaintCertKeys}
${EndIf}
!endif
SectionEnd
; Cleanup operations to perform at the end of the installation.
@ -948,59 +901,6 @@ Function leaveShortcuts
${EndIf}
FunctionEnd
!ifdef MOZ_MAINTENANCE_SERVICE
Function preComponents
; If the service already exists, don't show this page
ServicesHelper::IsInstalled "MozillaMaintenance"
Pop $R9
${If} $R9 == 1
; The service already exists so don't show this page.
Abort
${EndIf}
; On Windows < XP SP3 we do not install the maintenance service.
${If} ${IsWinXP}
${AndIf} ${AtMostServicePack} 2
Abort
${EndIf}
; Don't show the custom components page if the
; user is not an admin
Call IsUserAdmin
Pop $R9
${If} $R9 != "true"
Abort
${EndIf}
; Only show the maintenance service page if we have write access to HKLM
ClearErrors
WriteRegStr HKLM "Software\Mozilla" \
"${BrandShortName}InstallerTest" "Write Test"
${If} ${Errors}
ClearErrors
Abort
${Else}
DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest"
${EndIf}
StrCpy $PageName "Components"
${CheckCustomCommon}
!insertmacro MUI_HEADER_TEXT "$(COMPONENTS_PAGE_TITLE)" "$(COMPONENTS_PAGE_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "components.ini"
FunctionEnd
Function leaveComponents
${MUI_INSTALLOPTIONS_READ} $0 "components.ini" "Settings" "State"
${If} $0 != 0
Abort
${EndIf}
${MUI_INSTALLOPTIONS_READ} $InstallMaintenanceService "components.ini" "Field 2" "State"
${If} $InstallType == ${INSTALLTYPE_CUSTOM}
Call CheckExistingInstall
${EndIf}
FunctionEnd
!endif
Function preSummary
StrCpy $PageName "Summary"
; Setup the summary.ini file for the Custom Summary Page

332
application/palemoon/installer/windows/nsis/maintenanceservice_installer.nsi

@ -1,332 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
; Set verbosity to 3 (e.g. no script) to lessen the noise in the build logs
!verbose 3
; 7-Zip provides better compression than the lzma from NSIS so we add the files
; uncompressed and use 7-Zip to create a SFX archive of it
SetDatablockOptimize on
SetCompress off
CRCCheck on
RequestExecutionLevel admin
; The commands inside this ifdef require NSIS 3.0a2 or greater so the ifdef can
; be removed after we require NSIS 3.0a2 or greater.
!ifdef NSIS_PACKEDVERSION
Unicode true
ManifestSupportedOS all
ManifestDPIAware true
!endif
!addplugindir ./
; Variables
Var TempMaintServiceName
Var BrandFullNameDA
Var BrandFullName
; Other included files may depend upon these includes!
; The following includes are provided by NSIS.
!include FileFunc.nsh
!include LogicLib.nsh
!include MUI.nsh
!include WinMessages.nsh
!include WinVer.nsh
!include WordFunc.nsh
!insertmacro GetOptions
!insertmacro GetParameters
!insertmacro GetSize
; The test slaves use this fallback key to run tests.
; And anyone that wants to run tests themselves should already have
; this installed.
!define FallbackKey \
"SOFTWARE\Mozilla\MaintenanceService\3932ecacee736d366d6436db0f55bce4"
!define CompanyName "Mozilla Corporation"
!define BrandFullNameInternal ""
; The following includes are custom.
!include defines.nsi
; We keep defines.nsi defined so that we get other things like
; the version number, but we redefine BrandFullName
!define MaintFullName "Mozilla Maintenance Service"
!undef BrandFullName
!define BrandFullName "${MaintFullName}"
!include common.nsh
!include locales.nsi
VIAddVersionKey "FileDescription" "${MaintFullName} Installer"
VIAddVersionKey "OriginalFilename" "maintenanceservice_installer.exe"
Name "${MaintFullName}"
OutFile "maintenanceservice_installer.exe"
; Get installation folder from registry if available
InstallDirRegKey HKLM "Software\Mozilla\MaintenanceService" ""
SetOverwrite on
; serviceinstall.cpp also uses this key, in case the path is changed, update
; there too.
!define MaintUninstallKey \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\MozillaMaintenanceService"
; Always install into the 32-bit location even if we have a 64-bit build.
; This is because we use only 1 service for all Basilisk channels.
; Allow either x86 and x64 builds to exist at this location, depending on
; what is the latest build.
InstallDir "$PROGRAMFILES32\${MaintFullName}\"
ShowUnInstDetails nevershow
################################################################################
# Modern User Interface - MUI
!define MUI_ICON setup.ico
!define MUI_UNICON setup.ico
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_UNWELCOMEFINISHPAGE_BITMAP wizWatermark.bmp
;Interface Settings
!define MUI_ABORTWARNING
; Uninstaller Pages
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
################################################################################
# Language
!insertmacro MOZ_MUI_LANGUAGE 'baseLocale'
!verbose push
!verbose 3
!include "overrideLocale.nsh"
!include "customLocale.nsh"
!verbose pop
; Set this after the locale files to override it if it is in the locale
; using " " for BrandingText will hide the "Nullsoft Install System..." branding
BrandingText " "
Function .onInit
; Remove the current exe directory from the search order.
; This only effects LoadLibrary calls and not implicitly loaded DLLs.
System::Call 'kernel32::SetDllDirectoryW(w "")'
SetSilent silent
${Unless} ${AtLeastWin7}
Abort
${EndUnless}
FunctionEnd
Function un.onInit
; Remove the current exe directory from the search order.
; This only effects LoadLibrary calls and not implicitly loaded DLLs.
System::Call 'kernel32::SetDllDirectoryW(w "")'
; The commands inside this ifndef are needed prior to NSIS 3.0a2 and can be
; removed after we require NSIS 3.0a2 or greater.
!ifndef NSIS_PACKEDVERSION
${If} ${AtLeastWinVista}
System::Call 'user32::SetProcessDPIAware()'
${EndIf}
!endif
StrCpy $BrandFullNameDA "${MaintFullName}"
StrCpy $BrandFullName "${MaintFullName}"
FunctionEnd
Section "MaintenanceService"
AllowSkipFiles off
CreateDirectory $INSTDIR
SetOutPath $INSTDIR
; If the service already exists, then it will be stopped when upgrading it
; via the maintenanceservice_tmp.exe command executed below.
; The maintenanceservice_tmp.exe command will rename the file to
; maintenanceservice.exe if maintenanceservice_tmp.exe is newer.
; If the service does not exist yet, we install it and drop the file on
; disk as maintenanceservice.exe directly.
StrCpy $TempMaintServiceName "maintenanceservice.exe"
IfFileExists "$INSTDIR\maintenanceservice.exe" 0 skipAlreadyExists
StrCpy $TempMaintServiceName "maintenanceservice_tmp.exe"
skipAlreadyExists:
; We always write out a copy and then decide whether to install it or
; not via calling its 'install' cmdline which works by version comparison.
CopyFiles "$EXEDIR\maintenanceservice.exe" "$INSTDIR\$TempMaintServiceName"
; The updater.ini file is only used when performing an install or upgrade,
; and only if that install or upgrade is successful. If an old updater.ini
; happened to be copied into the maintenance service installation directory
; but the service was not newer, the updater.ini file would be unused.
; It is used to fill the description of the service on success.
CopyFiles "$EXEDIR\updater.ini" "$INSTDIR\updater.ini"
; Install the application maintenance service.
; If a service already exists, the command line parameter will stop the
; service and only install itself if it is newer than the already installed
; service. If successful it will remove the old maintenanceservice.exe
; and replace it with maintenanceservice_tmp.exe.
ClearErrors
${GetParameters} $0
${GetOptions} "$0" "/Upgrade" $0
${If} ${Errors}
ExecWait '"$INSTDIR\$TempMaintServiceName" install'
${Else}
; The upgrade cmdline is the same as install except
; It will fail if the service isn't already installed.
ExecWait '"$INSTDIR\$TempMaintServiceName" upgrade'
${EndIf}
WriteUninstaller "$INSTDIR\Uninstall.exe"
WriteRegStr HKLM "${MaintUninstallKey}" "DisplayName" "${MaintFullName}"
WriteRegStr HKLM "${MaintUninstallKey}" "UninstallString" \
'"$INSTDIR\uninstall.exe"'
WriteRegStr HKLM "${MaintUninstallKey}" "DisplayIcon" \
"$INSTDIR\Uninstall.exe,0"
WriteRegStr HKLM "${MaintUninstallKey}" "DisplayVersion" "${AppVersion}"
WriteRegStr HKLM "${MaintUninstallKey}" "Publisher" "Mozilla"
WriteRegStr HKLM "${MaintUninstallKey}" "Comments" "${BrandFullName}"
WriteRegDWORD HKLM "${MaintUninstallKey}" "NoModify" 1
${GetSize} "$INSTDIR" "/S=0K" $R2 $R3 $R4
WriteRegDWORD HKLM "${MaintUninstallKey}" "EstimatedSize" $R2
; Write out that a maintenance service was attempted.
; We do this because on upgrades we will check this value and we only
; want to install once on the first upgrade to maintenance service.
; Also write out that we are currently installed, preferences will check
; this value to determine if we should show the service update pref.
; Since the Maintenance service can be installed either x86 or x64,
; always use the 64-bit registry for checking if an attempt was made.
${If} ${RunningX64}
SetRegView 64
${EndIf}
WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1
WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Installed" 1
DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled"
; Included here for debug purposes only.
; These keys are used to bypass the installation dir is a valid installation
; check from the service so that tests can be run.
; WriteRegStr HKLM "${FallbackKey}\0" "name" "Mozilla Corporation"
; WriteRegStr HKLM "${FallbackKey}\0" "issuer" "DigiCert SHA2 Assured ID Code Signing CA"
${If} ${RunningX64}
SetRegView lastused
${EndIf}
SectionEnd
; By renaming before deleting we improve things slightly in case
; there is a file in use error. In this case a new install can happen.
Function un.RenameDelete
Pop $9
; If the .moz-delete file already exists previously, delete it
; If it doesn't exist, the call is ignored.
; We don't need to pass /REBOOTOK here since it was already marked that way
; if it exists.
Delete "$9.moz-delete"
Rename "$9" "$9.moz-delete"
${If} ${Errors}
Delete /REBOOTOK "$9"
${Else}
Delete /REBOOTOK "$9.moz-delete"
${EndIf}
ClearErrors
FunctionEnd
Section "Uninstall"
; Delete the service so that no updates will be attempted
ExecWait '"$INSTDIR\maintenanceservice.exe" uninstall'
Push "$INSTDIR\updater.ini"
Call un.RenameDelete
Push "$INSTDIR\maintenanceservice.exe"
Call un.RenameDelete
Push "$INSTDIR\maintenanceservice_tmp.exe"
Call un.RenameDelete
Push "$INSTDIR\maintenanceservice.old"
Call un.RenameDelete
Push "$INSTDIR\Uninstall.exe"
Call un.RenameDelete
Push "$INSTDIR\update\updater.ini"
Call un.RenameDelete
Push "$INSTDIR\update\updater.exe"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-1.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-2.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-3.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-4.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-5.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-6.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-7.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-8.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-9.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-10.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-install.log"
Call un.RenameDelete
Push "$INSTDIR\logs\maintenanceservice-uninstall.log"
Call un.RenameDelete
SetShellVarContext all
Push "$APPDATA\Mozilla\logs\maintenanceservice.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-1.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-2.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-3.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-4.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-5.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-6.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-7.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-8.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-9.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-10.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-install.log"
Call un.RenameDelete
Push "$APPDATA\Mozilla\logs\maintenanceservice-uninstall.log"
Call un.RenameDelete
RMDir /REBOOTOK "$APPDATA\Mozilla\logs"
RMDir /REBOOTOK "$APPDATA\Mozilla"
RMDir /REBOOTOK "$INSTDIR\logs"
RMDir /REBOOTOK "$INSTDIR\update"
RMDir /REBOOTOK "$INSTDIR"
DeleteRegKey HKLM "${MaintUninstallKey}"
${If} ${RunningX64}
SetRegView 64
${EndIf}
DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "Installed"
DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled"
DeleteRegKey HKLM "${FallbackKey}\"
${If} ${RunningX64}
SetRegView lastused
${EndIf}
SectionEnd

93
application/palemoon/installer/windows/nsis/shared.nsh

@ -124,51 +124,6 @@
${FixDistributionsINI}
RmDir /r /REBOOTOK "$INSTDIR\${TO_BE_DELETED}"
!ifdef MOZ_MAINTENANCE_SERVICE
Call IsUserAdmin
Pop $R0
${If} $R0 == "true"
; Only proceed if we have HKLM write access
${AndIf} $TmpVal == "HKLM"
; On Windows 2000 we do not install the maintenance service.
${AndIf} ${AtLeastWinXP}
; We check to see if the maintenance service install was already attempted.
; Since the Maintenance service can be installed either x86 or x64,
; always use the 64-bit registry for checking if an attempt was made.
${If} ${RunningX64}
SetRegView 64
${EndIf}
ReadRegDWORD $5 HKLM "Software\Mozilla\MaintenanceService" "Attempted"
ClearErrors
${If} ${RunningX64}
SetRegView lastused
${EndIf}
; Add the registry keys for allowed certificates.
${AddMaintCertKeys}
; If the maintenance service is already installed, do nothing.
; The maintenance service will launch:
; maintenanceservice_installer.exe /Upgrade to upgrade the maintenance
; service if necessary. If the update was done from updater.exe without
; the service (i.e. service is failing), updater.exe will do the update of
; the service. The reasons we do not do it here is because we don't want
; to have to prompt for limited user accounts when the service isn't used
; and we currently call the PostUpdate twice, once for the user and once
; for the SYSTEM account. Also, this would stop the maintenance service
; and we need a return result back to the service when run that way.
${If} $5 == ""
; An install of maintenance service was never attempted.
; We know we are an Admin and that we have write access into HKLM
; based on the above checks, so attempt to just run the EXE.
; In the worst case, in case there is some edge case with the
; IsAdmin check and the permissions check, the maintenance service
; will just fail to be attempted to be installed.
nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\""
${EndIf}
${EndIf}
!endif
!macroend
!define PostUpdate "!insertmacro PostUpdate"
@ -718,54 +673,6 @@
!macroend
!define UpdateProtocolHandlers "!insertmacro UpdateProtocolHandlers"
!ifdef MOZ_MAINTENANCE_SERVICE
; Adds maintenance service certificate keys for the install dir.
; For the cert to work, it must also be signed by a trusted cert for the user.
!macro AddMaintCertKeys
Push $R0
; Allow main Mozilla cert information for updates
; This call will push the needed key on the stack
ServicesHelper::PathToUniqueRegistryPath "$INSTDIR"
Pop $R0
${If} $R0 != ""
; More than one certificate can be specified in a different subfolder
; for example: $R0\1, but each individual binary can be signed
; with at most one certificate. A fallback certificate can only be used
; if the binary is replaced with a different certificate.
; We always use the 64bit registry for certs.
${If} ${RunningX64}
SetRegView 64
${EndIf}
; PrefetchProcessName was originally used to experiment with deleting
; Windows prefetch as a speed optimization. It is no longer used though.
DeleteRegValue HKLM "$R0" "prefetchProcessName"
; Setting the Attempted value will ensure that a new Maintenance Service
; install will never be attempted again after this from updates. The value
; is used only to see if updates should attempt new service installs.
WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1
; These values associate the allowed certificates for the current
; installation.
WriteRegStr HKLM "$R0\0" "name" "${CERTIFICATE_NAME}"
WriteRegStr HKLM "$R0\0" "issuer" "${CERTIFICATE_ISSUER}"
; These values associate the allowed certificates for the previous
; installation, so that we can update from it cleanly using the
; old updater.exe (which will still have this signature).
WriteRegStr HKLM "$R0\1" "name" "${CERTIFICATE_NAME_PREVIOUS}"
WriteRegStr HKLM "$R0\1" "issuer" "${CERTIFICATE_ISSUER_PREVIOUS}"
${If} ${RunningX64}
SetRegView lastused
${EndIf}
ClearErrors
${EndIf}
; Restore the previously used value back
Pop $R0
!macroend
!define AddMaintCertKeys "!insertmacro AddMaintCertKeys"
!endif
; Removes various registry entries for reasons noted below (does not use SHCTX).
!macro RemoveDeprecatedKeys
StrCpy $0 "SOFTWARE\Classes"

18
application/palemoon/installer/windows/nsis/uninstaller.nsi

@ -450,24 +450,6 @@ Section "Uninstall"
; uninstalls of PaleMoon-release with reinstalls of PaleMoon-release, for example.
WriteRegStr HKCU "Software\Mozilla\PaleMoon" "Uninstalled-${UpdateChannel}" "True"
!ifdef MOZ_MAINTENANCE_SERVICE
; Get the path the allowed cert is at and remove it
; Keep this block of code last since it modfies the reg view
ServicesHelper::PathToUniqueRegistryPath "$INSTDIR"
Pop $MaintCertKey
${If} $MaintCertKey != ""
; Always use the 64bit registry for certs on 64bit systems.
${If} ${RunningX64}
SetRegView 64
${EndIf}
DeleteRegKey HKLM "$MaintCertKey"
${If} ${RunningX64}
SetRegView lastused
${EndIf}
${EndIf}
Call un.UninstallServiceIfNotUsed
!endif
${un.IsFirewallSvcRunning}
Pop $0
${If} "$0" == "true"

4
application/xulrunner/confvars.sh

@ -13,10 +13,6 @@ MOZ_CHROME_FILE_FORMAT=omni
MOZ_UPDATER=1
if test "$OS_ARCH" = "WINNT"; then
MOZ_MAINTENANCE_SERVICE=
fi
MOZ_PLACES=1
MOZ_WEBRTC=1
MOZ_WEBGL_CONFORMANT=1

18
old-configure.in

@ -3651,23 +3651,6 @@ fi
AC_CHECK_PROGS(WGET, wget, "")
AC_SUBST(WGET)
dnl ========================================================
dnl Maintenance Service
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(maintenance-service,
[ --enable-maintenance-service Enable building of maintenanceservice],
MOZ_MAINTENANCE_SERVICE=1,
MOZ_MAINTENANCE_SERVICE= )
if test -n "$MOZ_MAINTENANCE_SERVICE"; then
if test "$OS_ARCH" = "WINNT"; then
AC_DEFINE(MOZ_MAINTENANCE_SERVICE)
else
AC_MSG_ERROR([Can only build with --enable-maintenance-service with a Windows target])
fi
fi
dnl ========================================================
dnl Bundled fonts on desktop platforms
dnl ========================================================
@ -5157,7 +5140,6 @@ AC_SUBST(MOZ_UNIVERSALCHARDET)
AC_SUBST(ACCESSIBILITY)
AC_SUBST(MOZ_SPELLCHECK)
AC_SUBST(MOZ_ANDROID_ANR_REPORTER)
AC_SUBST(MOZ_MAINTENANCE_SERVICE)
AC_SUBST(MOZ_VERIFY_MAR_SIGNATURE)
AC_SUBST(MOZ_ENABLE_SIGNMAR)
AC_SUBST(MOZ_UPDATER)

7
toolkit/modules/AppConstants.jsm

@ -180,13 +180,6 @@ MOZ_SAFE_BROWSING:
false,
#endif
MOZ_MAINTENANCE_SERVICE:
#ifdef MOZ_MAINTENANCE_SERVICE
true,
#else
false,
#endif
DEBUG:
#ifdef DEBUG
true,

13
toolkit/moz.build

@ -30,19 +30,6 @@ else:
if CONFIG['MOZ_UPDATER'] and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
DIRS += ['mozapps/update']
if CONFIG['MOZ_MAINTENANCE_SERVICE'] or CONFIG['MOZ_UPDATER'] and CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
# Including mozapps/update/common-standalone allows the maintenance service
# to be built so the maintenance service can be used for things other than
# updating applications.
DIRS += [
'mozapps/update/common-standalone',
]
if CONFIG['MOZ_MAINTENANCE_SERVICE']:
DIRS += [
'components/maintenanceservice'
]
DIRS += ['xre']
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):

7
toolkit/mozapps/installer/windows/nsis/makensis.mk

@ -75,10 +75,3 @@ uninstaller::
cd $(CONFIG_DIR) && $(MAKENSISU) uninstaller.nsi
$(NSINSTALL) -D $(DIST)/bin/uninstall
cp $(CONFIG_DIR)/helper.exe $(DIST)/bin/uninstall
ifdef MOZ_MAINTENANCE_SERVICE
maintenanceservice_installer::
cd $(CONFIG_DIR) && $(MAKENSISU) maintenanceservice_installer.nsi
$(NSINSTALL) -D $(DIST)/bin/
cp $(CONFIG_DIR)/maintenanceservice_installer.exe $(DIST)/bin
endi