Browse Source

[Navigator] Add an updated NSIS Windows Installer

master
Matt A. Tobin 2 years ago committed by Roy Tam
parent
commit
8455853118
  1. 3
      navigator/Makefile.in
  2. 2
      navigator/installer/package-manifest.in
  3. 63
      navigator/installer/windows/Makefile.in
  4. 4
      navigator/installer/windows/app.tag
  5. 85
      navigator/installer/windows/locale/custom.properties
  6. 65
      navigator/installer/windows/locale/mui.properties
  7. 86
      navigator/installer/windows/locale/override.properties
  8. 11
      navigator/installer/windows/moz.build
  9. 62
      navigator/installer/windows/nsis/defines.nsi.in
  10. 1176
      navigator/installer/windows/nsis/installer.nsi
  11. 1306
      navigator/installer/windows/nsis/shared.nsh
  12. 557
      navigator/installer/windows/nsis/uninstaller.nsi
  13. 12
      navigator/installer/windows/nsis/updater_append.ini
  14. 4
      navigator/moz.build

3
navigator/Makefile.in

@ -5,15 +5,12 @@
include $(topsrcdir)/config/rules.mk
ifdef 0
ifdef MAKENSISU
# For Windows build the uninstaller during the application build since the
# uninstaller is included with the application for mar file generation.
libs::
$(MAKE) -C installer/windows uninstaller
endif
endif
# As a fallout from bug 1247162, the sourcestamp in application.ini and
# platform.ini are the same, which isn't a problem for Firefox, but

2
navigator/installer/package-manifest.in

@ -55,11 +55,9 @@
@RESPATH@/fonts/*
#endif
@RESPATH@/searchplugins/*
#ifdef 0
#ifdef HAVE_MAKENSISU
@BINPATH@/uninstall/helper.exe
#endif
#endif
#ifdef MOZ_UPDATER
@RESPATH@/updater.ini
#endif

63
navigator/installer/windows/Makefile.in

@ -0,0 +1,63 @@
# 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/.
include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/package-name.mk
CONFIG_DIR = instgen
SFX_MODULE = $(topsrcdir)/other-licenses/7zstub/binoc/7zSD.sfx
INSTALLER_FILES = \
app.tag \
nsis/installer.nsi \
nsis/uninstaller.nsi \
nsis/shared.nsh \
$(NULL)
BRANDING_FILES = \
branding.nsi \
wizHeader.bmp \
wizHeaderRTL.bmp \
wizWatermark.bmp \
$(NULL)
ifdef MOZ_UPDATER
DEFINES += -DMOZ_UPDATER=1
endif
include $(topsrcdir)/config/config.mk
OVERRIDE_DEFAULT_GOAL := installer
installer::
$(MAKE) -C .. installer-stage
$(MAKE) $(CONFIG_DIR)/setup.exe
# For building the uninstaller during the application build so it can be
# included for mar file generation.
uninstaller::
$(RM) -r $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--preprocess-locale $(MOZILLA_SRCDIR) \
$(topsrcdir)/navigator/installer/windows/locale $(AB_CD) $(CONFIG_DIR)
$(CONFIG_DIR)/setup.exe::
$(RM) -r $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--convert-utf8-utf16le $(DIST)/branding/license.txt $(CONFIG_DIR)/license.txt
$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--preprocess-locale $(MOZILLA_SRCDIR) \
$(topsrcdir)/navigator/installer/windows/locale $(AB_CD) $(CONFIG_DIR)
include $(topsrcdir)/config/rules.mk
include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/makensis.mk

4
navigator/installer/windows/app.tag

@ -0,0 +1,4 @@
;!@Install@!UTF-8!
Title="Setup"
RunProgram="setup.exe"
;!@InstallEnd@!

85
navigator/installer/windows/locale/custom.properties

@ -0,0 +1,85 @@
# 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/.
# LOCALIZATION NOTE:
# This file must be saved as UTF8
# Accesskeys are defined by prefixing the letter that is to be used for the
# accesskey with an ampersand (e.g. &).
# Do not replace $BrandShortName, $BrandFullName, or $BrandFullNameDA with a
# custom string and always use the same one as used by the en-US files.
# $BrandFullNameDA allows the string to contain an ampersand (e.g. DA stands
# for double ampersand) and prevents the letter following the ampersand from
# being used as an accesskey.
# You can use \n to create a newline in the string but only when the string
# from en-US contains a \n.
REG_APP_DESC=$BrandShortName delivers safe, easy web browsing. A familiar user interface, enhanced security features including protection from online identity theft, and integrated search let you get the most out of the web.
CONTEXT_OPTIONS=$BrandShortName &Options
CONTEXT_SAFE_MODE=$BrandShortName &Safe Mode
OPTIONS_PAGE_TITLE=Setup Type
OPTIONS_PAGE_SUBTITLE=Choose setup options
SHORTCUTS_PAGE_TITLE=Set Up Shortcuts
SHORTCUTS_PAGE_SUBTITLE=Create Program Icons
COMPONENTS_PAGE_TITLE=Set Up Optional Components
COMPONENTS_PAGE_SUBTITLE=Optional Recommended Components
SUMMARY_PAGE_TITLE=Summary
SUMMARY_PAGE_SUBTITLE=Ready to start installing $BrandShortName
SUMMARY_INSTALLED_TO=$BrandShortName will be installed to the following location:
SUMMARY_REBOOT_REQUIRED_INSTALL=A restart of your computer may be required to complete the installation.
SUMMARY_REBOOT_REQUIRED_UNINSTALL=A restart of your computer may be required to complete the uninstall.
SUMMARY_TAKE_DEFAULTS=U&se $BrandShortName as my default web browser
SUMMARY_INSTALL_CLICK=Click Install to continue.
SUMMARY_UPGRADE_CLICK=Click Upgrade to continue.
SURVEY_TEXT=&Tell us what you thought of $BrandShortName
LAUNCH_TEXT=&Launch $BrandShortName now
CREATE_ICONS_DESC=Create icons for $BrandShortName:
ICONS_DESKTOP=On my &Desktop
ICONS_STARTMENU=In my &Start Menu Programs folder
ICONS_QUICKLAUNCH=In my &Quick Launch bar
WARN_MANUALLY_CLOSE_APP_INSTALL=$BrandShortName must be closed to proceed with the installation.\n\nPlease close $BrandShortName to continue.
WARN_MANUALLY_CLOSE_APP_UNINSTALL=$BrandShortName must be closed to proceed with the uninstall.\n\nPlease close $BrandShortName to continue.
WARN_MANUALLY_CLOSE_APP_LAUNCH=$BrandShortName is already running.\n\nPlease close $BrandShortName prior to launching the version you have just installed.
WARN_WRITE_ACCESS=You don't have access to write to the installation directory.\n\nClick OK to select a different directory.
WARN_DISK_SPACE=You don't have sufficient disk space to install to this location.\n\nClick OK to select a different location.
WARN_MIN_SUPPORTED_OSVER_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer.
WARN_MIN_SUPPORTED_CPU_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires a processor with ${MinSupportedCPU} support.
WARN_MIN_SUPPORTED_OSVER_CPU_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer and a processor with ${MinSupportedCPU} support.
WARN_RESTART_REQUIRED_UNINSTALL=Your computer must be restarted to complete a previous uninstall of $BrandShortName. Do you want to reboot now?
WARN_RESTART_REQUIRED_UPGRADE=Your computer must be restarted to complete a previous upgrade of $BrandShortName. Do you want to reboot now?
ERROR_CREATE_DIRECTORY_PREFIX=Error creating directory:
ERROR_CREATE_DIRECTORY_SUFFIX=Click Cancel to stop the installation or\nRetry to try again.
UN_CONFIRM_PAGE_TITLE=Uninstall $BrandFullName
UN_CONFIRM_PAGE_SUBTITLE=Remove $BrandFullName from your computer.
UN_CONFIRM_UNINSTALLED_FROM=$BrandShortName will be uninstalled from the following location:
UN_CONFIRM_CLICK=Click Uninstall to continue.
UN_REMOVE_PROFILES=&Remove my $BrandShortName personal data and customizations
UN_REMOVE_PROFILES_DESC=This will permanently remove your bookmarks, saved passwords, cookies and customizations. You may wish to keep this information if you plan on installing another version of $BrandShortName in the future.
BANNER_CHECK_EXISTING=Checking existing installation…
STATUS_INSTALL_APP=Installing $BrandShortName…
STATUS_INSTALL_LANG=Installing Language Files (${AB_CD})…
STATUS_UNINSTALL_MAIN=Uninstalling $BrandShortName…
STATUS_CLEANUP=A Little Housekeeping…
# _DESC strings support approximately 65 characters per line.
# One line
OPTIONS_SUMMARY=Choose the type of setup you prefer, then click Next.
# One line
OPTION_STANDARD_DESC=$BrandShortName will be installed with the most common options.
OPTION_STANDARD_RADIO=&Standard
# Two lines
OPTION_CUSTOM_DESC=You may choose individual options to be installed. Recommended for experienced users.
OPTION_CUSTOM_RADIO=&Custom
# LOCALIZATION NOTE:
# The following text replaces the Install button text on the summary page.
# Verify that the access key for InstallBtn (in override.properties) and
# UPGRADE_BUTTON is not already used by SUMMARY_TAKE_DEFAULTS.
UPGRADE_BUTTON=&Upgrade

65
navigator/installer/windows/locale/mui.properties

@ -0,0 +1,65 @@
# 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/.
# To make the l10n tinderboxen see changes to this file you can change a value
# name by adding - to the end of the name followed by chars (e.g. Branding-2).
# LOCALIZATION NOTE:
# This file must be saved as UTF8
# Accesskeys are defined by prefixing the letter that is to be used for the
# accesskey with an ampersand (e.g. &).
# Do not replace $BrandShortName, $BrandFullName, or $BrandFullNameDA with a
# custom string and always use the same one as used by the en-US files.
# $BrandFullNameDA allows the string to contain an ampersand (e.g. DA stands
# for double ampersand) and prevents the letter following the ampersand from
# being used as an accesskey.
# You can use \n to create a newline in the string but only when the string
# from en-US contains a \n.
MUI_TEXT_WELCOME_INFO_TITLE=Welcome to the $BrandFullNameDA Setup Wizard
MUI_TEXT_WELCOME_INFO_TEXT=This wizard will guide you through the installation of $BrandFullNameDA.\n\nIt is recommended that you close all other applications before starting Setup. This will make it possible to update relevant system files without having to reboot your computer.\n\n$_CLICK
MUI_TEXT_COMPONENTS_TITLE=Choose Components
MUI_TEXT_COMPONENTS_SUBTITLE=Choose which features of $BrandFullNameDA you want to install.
MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE=Description
MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO=Position your mouse over a component to see its description.
MUI_TEXT_DIRECTORY_TITLE=Choose Install Location
MUI_TEXT_DIRECTORY_SUBTITLE=Choose the folder in which to install $BrandFullNameDA.
MUI_TEXT_INSTALLING_TITLE=Installing
MUI_TEXT_INSTALLING_SUBTITLE=Please wait while $BrandFullNameDA is being installed.
MUI_TEXT_FINISH_TITLE=Installation Complete
MUI_TEXT_FINISH_SUBTITLE=Setup was completed successfully.
MUI_TEXT_ABORT_TITLE=Installation Aborted
MUI_TEXT_ABORT_SUBTITLE=Setup was not completed successfully.
MUI_BUTTONTEXT_FINISH=&Finish
MUI_TEXT_FINISH_INFO_TITLE=Completing the $BrandFullNameDA Setup Wizard
MUI_TEXT_FINISH_INFO_TEXT=$BrandFullNameDA has been installed on your computer.\n\nClick Finish to close this wizard.
MUI_TEXT_FINISH_INFO_REBOOT=Your computer must be restarted in order to complete the installation of $BrandFullNameDA. Do you want to reboot now?
MUI_TEXT_FINISH_REBOOTNOW=Reboot now
MUI_TEXT_FINISH_REBOOTLATER=I want to manually reboot later
MUI_TEXT_STARTMENU_TITLE=Choose Start Menu Folder
MUI_TEXT_STARTMENU_SUBTITLE=Choose a Start Menu folder for the $BrandFullNameDA shortcuts.
MUI_INNERTEXT_STARTMENU_TOP=Select the Start Menu folder in which you would like to create the program's shortcuts. You can also enter a name to create a new folder.
MUI_TEXT_ABORTWARNING=Are you sure you want to quit $BrandFullName Setup?
MUI_UNTEXT_WELCOME_INFO_TITLE=Welcome to the $BrandFullNameDA Uninstall Wizard
MUI_UNTEXT_WELCOME_INFO_TEXT=This wizard will guide you through the uninstallation of $BrandFullNameDA.\n\nBefore starting the uninstallation, make sure $BrandFullNameDA is not running.\n\n$_CLICK
MUI_TEXT_LICENSE_TITLE=License Agreement
MUI_TEXT_LICENSE_SUBTITLE=Please review the license terms before installing $BrandFullNameDA.
MUI_INNERTEXT_LICENSE_TOP=Press Page Down to see the rest of the agreement.
MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX=If you accept the terms of the agreement, click the check box below. You must accept the agreement to install $BrandFullNameDA. $_CLICK
MUI_UNTEXT_CONFIRM_TITLE=Uninstall $BrandFullNameDA
MUI_UNTEXT_CONFIRM_SUBTITLE=Remove $BrandFullNameDA from your computer.
MUI_UNTEXT_UNINSTALLING_TITLE=Uninstalling
MUI_UNTEXT_UNINSTALLING_SUBTITLE=Please wait while $BrandFullNameDA is being uninstalled.
MUI_UNTEXT_FINISH_TITLE=Uninstallation Complete
MUI_UNTEXT_FINISH_SUBTITLE=Uninstall was completed successfully.
MUI_UNTEXT_ABORT_TITLE=Uninstallation Aborted
MUI_UNTEXT_ABORT_SUBTITLE=Uninstall was not completed successfully.
MUI_UNTEXT_FINISH_INFO_TITLE=Completing the $BrandFullNameDA Uninstall Wizard
MUI_UNTEXT_FINISH_INFO_TEXT=$BrandFullNameDA has been uninstalled from your computer.\n\nClick Finish to close this wizard.
MUI_UNTEXT_FINISH_INFO_REBOOT=Your computer must be restarted in order to complete the uninstallation of $BrandFullNameDA. Do you want to reboot now?
MUI_UNTEXT_ABORTWARNING=Are you sure you want to quit $BrandFullName Uninstall?

86
navigator/installer/windows/locale/override.properties

@ -0,0 +1,86 @@
# 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/.
# LOCALIZATION NOTE:
# This file must be saved as UTF8
# Accesskeys are defined by prefixing the letter that is to be used for the
# accesskey with an ampersand (e.g. &).
# Do not replace $BrandShortName, $BrandFullName, or $BrandFullNameDA with a
# custom string and always use the same one as used by the en-US files.
# $BrandFullNameDA allows the string to contain an ampersand (e.g. DA stands
# for double ampersand) and prevents the letter following the ampersand from
# being used as an accesskey.
# You can use \n to create a newline in the string but only when the string
# from en-US contains a \n.
# Strings that require a space at the end should be enclosed with double
# quotes and the double quotes will be removed. To add quotes to the beginning
# and end of a strong enclose the add and additional double quote to the
# beginning and end of the string (e.g. ""This will include quotes"").
SetupCaption=$BrandFullName Setup
UninstallCaption=$BrandFullName Uninstall
BackBtn=< &Back
NextBtn=&Next >
AcceptBtn=I &accept the terms in the License Agreement
DontAcceptBtn=I &do not accept the terms in the License Agreement
InstallBtn=&Install
UninstallBtn=&Uninstall
CancelBtn=Cancel
CloseBtn=&Close
BrowseBtn=B&rowse…
ShowDetailsBtn=Show &details
ClickNext=Click Next to continue.
ClickInstall=Click Install to start the installation.
ClickUninstall=Click Uninstall to start the uninstallation.
Completed=Completed
LicenseTextRB=Please review the license agreement before installing $BrandFullNameDA. If you accept all terms of the agreement, select the first option below. $_CLICK
ComponentsText=Check the components you want to install and uncheck the components you don't want to install. $_CLICK
ComponentsSubText2_NoInstTypes=Select components to install:
DirText=Setup will install $BrandFullNameDA in the following folder. To install in a different folder, click Browse and select another folder. $_CLICK
DirSubText=Destination Folder
DirBrowseText=Select the folder to install $BrandFullNameDA in:
SpaceAvailable="Space available: "
SpaceRequired="Space required: "
UninstallingText=$BrandFullNameDA will be uninstalled from the following folder. $_CLICK
UninstallingSubText=Uninstalling from:
FileError=Error opening file for writing: \r\n\r\n$0\r\n\r\nClick Abort to stop the installation,\r\nRetry to try again, or\r\nIgnore to skip this file.
FileError_NoIgnore=Error opening file for writing: \r\n\r\n$0\r\n\r\nClick Retry to try again, or\r\nCancel to stop the installation.
CantWrite="Can't write: "
CopyFailed=Copy failed
CopyTo="Copy to "
Registering="Registering: "
Unregistering="Unregistering: "
SymbolNotFound="Could not find symbol: "
CouldNotLoad="Could not load: "
CreateFolder="Create folder: "
CreateShortcut="Create shortcut: "
CreatedUninstaller="Created uninstaller: "
Delete="Delete file: "
DeleteOnReboot="Delete on reboot: "
ErrorCreatingShortcut="Error creating shortcut: "
ErrorCreating="Error creating: "
ErrorDecompressing=Error decompressing data! Corrupted installer?
ErrorRegistering=Error registering DLL
ExecShell="ExecShell: "
Exec="Execute: "
Extract="Extract: "
ErrorWriting="Extract: error writing to file "
InvalidOpcode=Installer corrupted: invalid opcode
NoOLE="No OLE for: "
OutputFolder="Output folder: "
RemoveFolder="Remove folder: "
RenameOnReboot="Rename on reboot: "
Rename="Rename: "
Skipped="Skipped: "
CopyDetails=Copy Details To Clipboard
LogInstall=Log install process
Byte=B
Kilo=K
Mega=M
Giga=G

11
navigator/installer/windows/moz.build

@ -0,0 +1,11 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
DEFINES['APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
DEFINES['MOZ_APP_NAME'] = CONFIG['MOZ_APP_NAME']
DEFINES['MOZ_APP_DISPLAYNAME'] = CONFIG['MOZ_APP_DISPLAYNAME']
DEFINES['MOZILLA_VERSION'] = CONFIG['MOZILLA_VERSION']

62
navigator/installer/windows/nsis/defines.nsi.in

@ -0,0 +1,62 @@
#filter substitution
# 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/.
# These defines should match application.ini settings
!define AppName "@MOZ_APP_DISPLAYNAME@"
!define AppVersion "@APP_VERSION@"
!define GREVersion @MOZILLA_VERSION@
!define AB_CD "@AB_CD@"
!define FileMainEXE "@MOZ_APP_NAME@.exe"
!define WindowClass "BorealisMessageWindow"
!define DDEApplication "Borealis"
!define AppRegName "Borealis"
!ifndef DEV_EDITION
!define BrandShortName "@MOZ_APP_DISPLAYNAME@"
!endif
!define BrandFullName "${BrandFullNameInternal}"
!define CERTIFICATE_NAME "Mozilla Corporation"
!define CERTIFICATE_ISSUER "DigiCert SHA2 Assured ID Code Signing CA"
; Changing the name or issuer requires us to have both the old and the new
; in the registry at the same time, temporarily.
!define CERTIFICATE_NAME_PREVIOUS "Mozilla Corporation"
!define CERTIFICATE_ISSUER_PREVIOUS "DigiCert Assured ID Code Signing CA-1"
# LSP_CATEGORIES is the permitted LSP categories for the application. Each LSP
# category value is ANDed together to set multiple permitted categories.
# See http://msdn.microsoft.com/en-us/library/ms742253%28VS.85%29.aspx
# The value below removes all LSP categories previously set.
!define LSP_CATEGORIES "0x00000000"
!if "@MOZ_UPDATE_CHANNEL@" == ""
!define UpdateChannel "Unknown"
!else
!define UpdateChannel "@MOZ_UPDATE_CHANNEL@"
!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 ARCH "x86"
!define MinSupportedVer "Microsoft Windows 7"
#endif
!define MinSupportedCPU "SSE2"
# File details shared by both the installer and uninstaller
VIProductVersion "1.0.0.0"
VIAddVersionKey "ProductName" "${BrandShortName}"
VIAddVersionKey "CompanyName" "${CompanyName}"
VIAddVersionKey "LegalCopyright" "${CompanyName}"
VIAddVersionKey "FileVersion" "${AppVersion}"
VIAddVersionKey "ProductVersion" "${AppVersion}"
# Comments is not used but left below commented out for future reference
# VIAddVersionKey "Comments" "Comments"

1176
navigator/installer/windows/nsis/installer.nsi

File diff suppressed because it is too large Load Diff

1306
navigator/installer/windows/nsis/shared.nsh

File diff suppressed because it is too large Load Diff

557
navigator/installer/windows/nsis/uninstaller.nsi

@ -0,0 +1,557 @@
# 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/.
# Required Plugins:
# AppAssocReg http://nsis.sourceforge.net/Application_Association_Registration_plug-in
# CityHash http://dxr.mozilla.org/mozilla-central/source/other-licenses/nsis/Contrib/CityHash
# ShellLink http://nsis.sourceforge.net/ShellLink_plug-in
# UAC http://nsis.sourceforge.net/UAC_plug-in
; 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 user
; 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 ./
; On Vista and above attempt to elevate Standard Users in addition to users that
; are a member of the Administrators group.
!define NONADMIN_ELEVATE
; prevents compiling of the reg write logging.
!define NO_LOG
!define MaintUninstallKey \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\MozillaMaintenanceService"
Var TmpVal
Var MaintCertKey
; 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 GetSize
!insertmacro StrFilter
!insertmacro WordReplace
!insertmacro un.GetParent
; The following includes are custom.
!include branding.nsi
!include defines.nsi
!include common.nsh
!include locales.nsi
; This is named BrandShortName helper because we use this for software update
; post update cleanup.
VIAddVersionKey "FileDescription" "${BrandShortName} Helper"
VIAddVersionKey "OriginalFilename" "helper.exe"
!insertmacro AddDisabledDDEHandlerValues
!insertmacro CleanVirtualStore
!insertmacro ElevateUAC
!insertmacro GetLongPath
!insertmacro GetPathFromString
!insertmacro InitHashAppModelId
!insertmacro IsHandlerForInstallDir
!insertmacro IsPinnedToTaskBar
!insertmacro LogDesktopShortcut
!insertmacro LogQuickLaunchShortcut
!insertmacro LogStartMenuShortcut
!insertmacro PinnedToStartMenuLnkCount
!insertmacro RegCleanAppHandler
!insertmacro RegCleanMain
!insertmacro RegCleanUninstall
!insertmacro SetAppLSPCategories
!insertmacro SetBrandNameVars
!insertmacro UpdateShortcutAppModelIDs
!insertmacro UnloadUAC
!insertmacro WriteRegDWORD2
!insertmacro WriteRegStr2
!insertmacro un.ChangeMUIHeaderImage
!insertmacro un.CheckForFilesInUse
!insertmacro un.CleanUpdateDirectories
!insertmacro un.CleanVirtualStore
!insertmacro un.DeleteShortcuts
!insertmacro un.GetLongPath
!insertmacro un.GetSecondInstallPath
!insertmacro un.InitHashAppModelId
!insertmacro un.ManualCloseAppPrompt
!insertmacro un.RegCleanAppHandler
!insertmacro un.RegCleanFileHandler
!insertmacro un.RegCleanMain
!insertmacro un.RegCleanUninstall
!insertmacro un.RegCleanProtocolHandler
!insertmacro un.RemoveQuotesFromPath
!insertmacro un.RemovePrecompleteEntries
!insertmacro un.SetAppLSPCategories
!insertmacro un.SetBrandNameVars
!include shared.nsh
; Helper macros for ui callbacks. Insert these after shared.nsh
!insertmacro OnEndCommon
!insertmacro UninstallOnInitCommon
!insertmacro un.OnEndCommon
!insertmacro un.UninstallUnOnInitCommon
Name "${BrandFullName}"
OutFile "helper.exe"
!ifdef HAVE_64BIT_BUILD
InstallDir "$PROGRAMFILES64\${BrandFullName}\"
!else
InstallDir "$PROGRAMFILES32\${BrandFullName}\"
!endif
ShowUnInstDetails nevershow
################################################################################
# Modern User Interface - MUI
!define MUI_ABORTWARNING
!define MUI_ICON setup.ico
!define MUI_UNICON setup.ico
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_RIGHT
!define MUI_UNWELCOMEFINISHPAGE_BITMAP wizWatermark.bmp
; Use a right to left header image when the language is right to left
!ifdef ${AB_CD}_rtl
!define MUI_HEADERIMAGE_BITMAP_RTL wizHeaderRTL.bmp
!else
!define MUI_HEADERIMAGE_BITMAP wizHeader.bmp
!endif
/**
* Uninstall Pages
*/
; Welcome Page
!define MUI_PAGE_CUSTOMFUNCTION_PRE un.preWelcome
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.leaveWelcome
!insertmacro MUI_UNPAGE_WELCOME
; Custom Uninstall Confirm Page
UninstPage custom un.preConfirm
; Remove Files Page
!insertmacro MUI_UNPAGE_INSTFILES
; Finish Page
!insertmacro MUI_UNPAGE_FINISH
; Use the default dialog for IDD_VERIFY for a simple Banner
ChangeUI IDD_VERIFY "${NSISDIR}\Contrib\UIs\default.exe"
################################################################################
# Install Sections
; Empty section required for the installer to compile as an uninstaller
Section ""
SectionEnd
################################################################################
# Uninstall Sections
Section "Uninstall"
SetDetailsPrint textonly
DetailPrint $(STATUS_UNINSTALL_MAIN)
SetDetailsPrint none
; Delete the app exe to prevent launching the app while we are uninstalling.
ClearErrors
${DeleteFile} "$INSTDIR\${FileMainEXE}"
${If} ${Errors}
; If the user closed the application it can take several seconds for it to
; shut down completely. If the application is being used by another user we
; can still delete the files when the system is restarted.
Sleep 5000
${DeleteFile} "$INSTDIR\${FileMainEXE}"
ClearErrors
${EndIf}
; setup the application model id registration value
${un.InitHashAppModelId} "$INSTDIR" "Software\Binary Outcast\${AppName}\TaskBarIDs"
SetShellVarContext current ; Set SHCTX to HKCU
${un.RegCleanMain} "Software\Mozilla"
${un.RegCleanUninstall}
${un.DeleteShortcuts}
; Unregister resources associated with Win7 taskbar jump lists.
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::UninstallJumpLists "$AppUserModelID"
${EndIf}
; Remove the updates directory for Vista and above
${un.CleanUpdateDirectories} "Mozilla\Borealis" "Mozilla\updates"
; Remove any app model id's stored in the registry for this install path
DeleteRegValue HKCU "Software\Binary Outcast\${AppName}\TaskBarIDs" "$INSTDIR"
DeleteRegValue HKLM "Software\Binary Outcast\${AppName}\TaskBarIDs" "$INSTDIR"
ClearErrors
WriteRegStr HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" "Write Test"
${If} ${Errors}
StrCpy $TmpVal "HKCU" ; used primarily for logging
${Else}
SetShellVarContext all ; Set SHCTX to HKLM
DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest"
StrCpy $TmpVal "HKLM" ; used primarily for logging
${un.RegCleanMain} "Software\Mozilla"
${un.RegCleanUninstall}
${un.DeleteShortcuts}
${un.SetAppLSPCategories}
${EndIf}
${un.RegCleanAppHandler} "BorealisURL"
${un.RegCleanAppHandler} "BorealisHTML"
${un.RegCleanProtocolHandler} "ftp"
${un.RegCleanProtocolHandler} "http"
${un.RegCleanProtocolHandler} "https"
ClearErrors
ReadRegStr $R9 HKCR "BorealisHTML" ""
; Don't clean up the file handlers if the BorealisHTML key still exists since
; there should be a second installation that may be the default file handler
${If} ${Errors}
${un.RegCleanFileHandler} ".htm" "BorealisHTML"
${un.RegCleanFileHandler} ".html" "BorealisHTML"
${un.RegCleanFileHandler} ".shtml" "BorealisHTML"
${un.RegCleanFileHandler} ".xht" "BorealisHTML"
${un.RegCleanFileHandler} ".xhtml" "BorealisHTML"
${un.RegCleanFileHandler} ".oga" "BorealisHTML"
${un.RegCleanFileHandler} ".ogg" "BorealisHTML"
${un.RegCleanFileHandler} ".ogv" "BorealisHTML"
${un.RegCleanFileHandler} ".webm" "BorealisHTML"
${EndIf}
SetShellVarContext all ; Set SHCTX to HKLM
${un.GetSecondInstallPath} "Software\Mozilla" $R9
${If} $R9 == "false"
SetShellVarContext current ; Set SHCTX to HKCU
${un.GetSecondInstallPath} "Software\Mozilla" $R9
${EndIf}
StrCpy $0 "Software\Clients\StartMenuInternet\${FileMainEXE}\shell\open\command"
ReadRegStr $R1 HKLM "$0" ""
${un.RemoveQuotesFromPath} "$R1" $R1
${un.GetParent} "$R1" $R1
; Only remove the StartMenuInternet key if it refers to this install location.
; The StartMenuInternet registry key is independent of the default browser
; settings. The XPInstall base un-installer always removes this key if it is
; uninstalling the default browser and it will always replace the keys when
; installing even if there is another install of Borealis that is set as the
; default browser. Now the key is always updated on install but it is only
; removed if it refers to this install location.
${If} "$INSTDIR" == "$R1"
DeleteRegKey HKLM "Software\Clients\StartMenuInternet\${FileMainEXE}"
DeleteRegValue HKLM "Software\RegisteredApplications" "${AppRegName}"
${EndIf}
ReadRegStr $R1 HKCU "$0" ""
${un.RemoveQuotesFromPath} "$R1" $R1
${un.GetParent} "$R1" $R1
; Only remove the StartMenuInternet key if it refers to this install location.
; The StartMenuInternet registry key is independent of the default browser
; settings. The XPInstall base un-installer always removes this key if it is
; uninstalling the default browser and it will always replace the keys when
; installing even if there is another install of Borealis that is set as the
; default browser. Now the key is always updated on install but it is only
; removed if it refers to this install location.
${If} "$INSTDIR" == "$R1"
DeleteRegKey HKCU "Software\Clients\StartMenuInternet\${FileMainEXE}"
DeleteRegValue HKCU "Software\RegisteredApplications" "${AppRegName}"
${EndIf}
StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\App Paths\${FileMainEXE}"
${If} $R9 == "false"
DeleteRegKey HKLM "$0"
DeleteRegKey HKCU "$0"
StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\${FileMainEXE}"
DeleteRegKey HKLM "$0"
DeleteRegKey HKCU "$0"
StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\plugin-container.exe"
DeleteRegKey HKLM "$0"
DeleteRegKey HKCU "$0"
StrCpy $0 "Software\Classes\MIME\Database\Content Type\application/x-xpinstall;app=Borealis"
DeleteRegKey HKLM "$0"
DeleteRegKey HKCU "$0"
${Else}
ReadRegStr $R1 HKLM "$0" ""
${un.RemoveQuotesFromPath} "$R1" $R1
${un.GetParent} "$R1" $R1
${If} "$INSTDIR" == "$R1"
WriteRegStr HKLM "$0" "" "$R9"
${un.GetParent} "$R9" $R1
WriteRegStr HKLM "$0" "Path" "$R1"
${EndIf}
${EndIf}
; Remove directories and files we always control before parsing the uninstall
; log so empty directories can be removed.
${If} ${FileExists} "$INSTDIR\updates"
RmDir /r /REBOOTOK "$INSTDIR\updates"
${EndIf}
${If} ${FileExists} "$INSTDIR\updated"
RmDir /r /REBOOTOK "$INSTDIR\updated"
${EndIf}
${If} ${FileExists} "$INSTDIR\defaults\shortcuts"
RmDir /r /REBOOTOK "$INSTDIR\defaults\shortcuts"
${EndIf}
${If} ${FileExists} "$INSTDIR\distribution"
RmDir /r /REBOOTOK "$INSTDIR\distribution"
${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}
${un.RemovePrecompleteEntries} "false"
${If} ${FileExists} "$INSTDIR\defaults\pref\channel-prefs.js"
Delete /REBOOTOK "$INSTDIR\defaults\pref\channel-prefs.js"
${EndIf}
${If} ${FileExists} "$INSTDIR\defaults\pref"
RmDir /REBOOTOK "$INSTDIR\defaults\pref"
${EndIf}
${If} ${FileExists} "$INSTDIR\defaults"
RmDir /REBOOTOK "$INSTDIR\defaults"
${EndIf}
${If} ${FileExists} "$INSTDIR\uninstall"
; Remove the uninstall directory that we control
RmDir /r /REBOOTOK "$INSTDIR\uninstall"
${EndIf}
${If} ${FileExists} "$INSTDIR\install.log"
Delete /REBOOTOK "$INSTDIR\install.log"
${EndIf}
${If} ${FileExists} "$INSTDIR\update-settings.ini"
Delete /REBOOTOK "$INSTDIR\update-settings.ini"
${EndIf}
; Explicitly remove empty webapprt dir in case it exists (bug 757978).
RmDir "$INSTDIR\webapprt\components"
RmDir "$INSTDIR\webapprt"
; Remove the installation directory if it is empty
RmDir "$INSTDIR"
; If Borealis.exe was successfully deleted yet we still need to restart to
; remove other files create a dummy Borealis.exe.moz-delete to prevent the
; installer from allowing an install without restart when it is required
; to complete an uninstall.
${If} ${RebootFlag}
; Admin is required to delete files on reboot so only add the moz-delete if
; the user is an admin. After calling UAC::IsAdmin $0 will equal 1 if the
; user is an admin.
UAC::IsAdmin
${If} "$0" == "1"
${Unless} ${FileExists} "$INSTDIR\${FileMainEXE}.moz-delete"
FileOpen $0 "$INSTDIR\${FileMainEXE}.moz-delete" w
FileWrite $0 "Will be deleted on restart"
Delete /REBOOTOK "$INSTDIR\${FileMainEXE}.moz-delete"
FileClose $0
${EndUnless}
${EndIf}
${EndIf}
; Refresh desktop icons otherwise the start menu internet item won't be
; removed and other ugly things will happen like recreation of the app's
; clients registry key by the OS under some conditions.
System::Call "shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i 0, i 0, i 0)"
; Users who uninstall then reinstall expecting Borealis to use a clean profile
; may be surprised during first-run. This key is checked during startup of Borealis and
; subsequently deleted after checking. If the value is found during startup
; the browser will offer to Reset Borealis. We use the UpdateChannel to match
; uninstalls of Borealis-release with reinstalls of Borealis-release, for example.
WriteRegStr HKCU "Software\Binary Outcast\Borealis" "Uninstalled-${UpdateChannel}" "True"
${un.IsFirewallSvcRunning}
Pop $0
${If} "$0" == "true"
liteFirewallW::RemoveRule "$INSTDIR\${FileMainEXE}" "${BrandShortName} ($INSTDIR)"
${EndIf}
SectionEnd
################################################################################
# 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 " "
################################################################################
# Page pre, show, and leave functions
Function un.preWelcome
${If} ${FileExists} "$INSTDIR\distribution\modern-wizard.bmp"
Delete "$PLUGINSDIR\modern-wizard.bmp"
CopyFiles /SILENT "$INSTDIR\distribution\modern-wizard.bmp" "$PLUGINSDIR\modern-wizard.bmp"
${EndIf}
FunctionEnd
Function un.leaveWelcome
${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
Banner::show /NOUNLOAD "$(BANNER_CHECK_EXISTING)"
; If the message window has been found previously give the app an additional
; five seconds to close.
${If} "$TmpVal" == "FoundMessageWindow"
Sleep 5000
${EndIf}
${PushFilesToCheck}
${un.CheckForFilesInUse} $TmpVal
Banner::destroy
; If there are files in use $TmpVal will be "true"
${If} "$TmpVal" == "true"
; If the message window is found the call to ManualCloseAppPrompt will
; abort leaving the value of $TmpVal set to "FoundMessageWindow".
StrCpy $TmpVal "FoundMessageWindow"
${un.ManualCloseAppPrompt} "${WindowClass}" "$(WARN_MANUALLY_CLOSE_APP_UNINSTALL)"
; If the message window is not found set $TmpVal to "true" so the restart
; required message is displayed.
StrCpy $TmpVal "true"
${EndIf}
${EndIf}
FunctionEnd
Function un.preConfirm
${If} ${FileExists} "$INSTDIR\distribution\modern-header.bmp"
${AndIf} $hHeaderBitmap == ""
Delete "$PLUGINSDIR\modern-header.bmp"
CopyFiles /SILENT "$INSTDIR\distribution\modern-header.bmp" "$PLUGINSDIR\modern-header.bmp"
${un.ChangeMUIHeaderImage} "$PLUGINSDIR\modern-header.bmp"
${EndIf}
; Setup the unconfirm.ini file for the Custom Uninstall Confirm Page
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Settings" NumFields "3"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 1" Type "label"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 1" Text "$(UN_CONFIRM_UNINSTALLED_FROM)"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 1" Left "0"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 1" Right "-1"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 1" Top "5"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 1" Bottom "15"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" Type "text"
; The contents of this control must be set as follows in the pre function
; ${MUI_INSTALLOPTIONS_READ} $1 "unconfirm.ini" "Field 2" "HWND"
; SendMessage $1 ${WM_SETTEXT} 0 "STR:$INSTDIR"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" State ""
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" Left "0"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" Right "-1"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" Top "17"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" Bottom "30"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" flags "READONLY"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Type "label"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Text "$(UN_CONFIRM_CLICK)"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Left "0"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Right "-1"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Top "130"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Bottom "150"
${If} "$TmpVal" == "true"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Type "label"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Text "$(SUMMARY_REBOOT_REQUIRED_UNINSTALL)"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Left "0"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Right "-1"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Top "35"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Bottom "45"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Settings" NumFields "4"
${EndIf}
!insertmacro MUI_HEADER_TEXT "$(UN_CONFIRM_PAGE_TITLE)" "$(UN_CONFIRM_PAGE_SUBTITLE)"
; The Summary custom page has a textbox that will automatically receive
; focus. This sets the focus to the Install button instead.
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "unconfirm.ini"
GetDlgItem $0 $HWNDPARENT 1
System::Call "user32::SetFocus(i r0, i 0x0007, i,i)i"
${MUI_INSTALLOPTIONS_READ} $1 "unconfirm.ini" "Field 2" "HWND"
SendMessage $1 ${WM_SETTEXT} 0 "STR:$INSTDIR"
!insertmacro MUI_INSTALLOPTIONS_SHOW
FunctionEnd
################################################################################
# Initialization Functions
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 "")'
; We need this set up for most of the helper.exe operations.
${UninstallOnInitCommon}
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 "")'
StrCpy $LANGUAGE 0
${un.UninstallUnOnInitCommon}
; 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
!insertmacro InitInstallOptionsFile "unconfirm.ini"
FunctionEnd
Function .onGUIEnd
${OnEndCommon}
FunctionEnd
Function un.onGUIEnd
${un.OnEndCommon}
FunctionEnd

12
navigator/installer/windows/nsis/updater_append.ini

@ -0,0 +1,12 @@
; IMPORTANT: This file should always start with a newline in case a locale
; provided updater.ini does not end with a newline.
; Application to launch after an update has been successfully applied. This
; must be in the same directory or a sub-directory of the directory of the
; application executable that initiated the software update.
[PostUpdateWin]
; ExeRelPath is the path to the PostUpdateWin executable relative to the
; application executable.
ExeRelPath=uninstall\helper.exe
; ExeArg is the argument to pass to the PostUpdateWin exe
ExeArg=/PostUpdate

4
navigator/moz.build

@ -13,8 +13,8 @@ DIRS += [
'themes',
]
#if CONFIG['MAKENSISU']:
# DIRS += ['installer/windows']
if CONFIG['MAKENSISU']:
DIRS += ['installer/windows']
# app is always last as it packages up the built files on mac.
DIRS += ['app']

Loading…
Cancel
Save