summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2022-01-25 16:15:54 -0600
committerMatt A. Tobin <email@mattatobin.com>2022-01-25 16:15:54 -0600
commit8e85ee969ea06d77e018350dbccdbf0a7e07936d (patch)
tree4fce102f14b9cb81abc87c70fbe36a675da9090a
parent1075dcef264137fb09721662c52e6889ea1144fc (diff)
downloadaura-central-8e85ee969ea06d77e018350dbccdbf0a7e07936d.tar.gz
[Packager] Land current draft and fix conflicts
-rw-r--r--components/profile/mimeTypes.rdf86
-rw-r--r--components/profile/moz.build7
-rw-r--r--components/profile/userChrome-example.css58
-rw-r--r--components/profile/userContent-example.css47
-rw-r--r--other-licenses/7zstub/gre/7zSD.manifest (renamed from other-licenses/7zstub/uxp/7zSD.manifest)0
-rw-r--r--other-licenses/7zstub/gre/7zSD.sfx (renamed from other-licenses/7zstub/uxp/7zSD.sfx)bin156672 -> 156672 bytes
-rw-r--r--system/packager/base.mk273
-rw-r--r--system/packager/installer.mk84
-rw-r--r--system/packager/locale-install.rdf.in34
-rw-r--r--system/packager/packager.mk137
-rw-r--r--system/packager/skin-install.rdf.in21
11 files changed, 747 insertions, 0 deletions
diff --git a/components/profile/mimeTypes.rdf b/components/profile/mimeTypes.rdf
new file mode 100644
index 000000000..10edce3ce
--- /dev/null
+++ b/components/profile/mimeTypes.rdf
@@ -0,0 +1,86 @@
+<?xml version="1.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/. -->
+
+
+<!--
+ This file is used as a persistent data store for helper application
+ information about both MIME type and protocol scheme helpers.
+
+ The root of the data are the two containers
+ <RDF:Seq about="urn:mimetypes:root"/> and <RDF:Seq about="urn:schemes:root"/>.
+
+ These contain one <RDF:li/> entry per MIME type/protocol. Each <RDF:li/> entry
+ corresponds to a "urn:<class>:<type>" resource, where <class> is either
+ "mimetype" or "scheme" and <type> is either a MIME type in "major/minor" format
+ or a scheme. For example, for HTML we would have "urn:mimetype:text/html",
+ while for mailto: we would have "urn:scheme:mailto".
+
+ Typically, this resource will be in the <RDF:Description/> node which has the
+ corresponding "about" attribute.
+
+ Each "urn:<class>:<type>" resource can have the following properties:
+
+ NC:Value - the MIME type or scheme string
+ NC:editable - a "true" or "false" depending on whether this entry is
+ editable
+ NC:description - a description of the type ("HTML Document" for text/html)
+ NC:fileExtensions - for MIME types, there will be one of these properties
+ per extension that corresponds to this MIME type,
+ each one having a single extension as its value.
+ NC:handlerProp - the way the type should be handled. This corresponds to a
+ "urn:<class>:handler:<type>" resource. Eg, the way HTML is
+ handled would be stored in the
+ "urn:mimetype:handler:text/html" resource.
+
+ Each "urn:<class>:handler:<type>" resource can have the following properties:
+
+ NC:useSystemDefault - "true" if we should handle per default OS setting,
+ "false" or not set otherwise
+ NC:saveToDisk - "true" if the data should be saved to disk, "false" or not
+ set otherwise.
+ (Note - if both of these are false, that means "open in helper app")
+ NC:alwaysAsk - "true" if the user should always be prompted before handling
+ data of this type, false otherwise.
+ NC:externalApplication - the preferred helper application to use for this
+ type. This corresponds to a
+ "urn:<class>:externalApplication:<type>" resource.
+ NC:possibleApplication - a helper application that can be used for this type.
+ Since there can be multiple possible applications,
+ there can be multiple assertions in the graph with
+ this property for a given handler resource.
+
+ Each "urn:<class>:externalApplication:<type>" resource, and each resource
+ that represents a possible application, can have the following property:
+
+ NC:prettyName - the "pretty name" of the application ("Acrobat Reader" for
+ /usr/bin/acroread, eg).
+
+ If the resource represents a local application, then it can have the following
+ property:
+
+ NC:path - the path to the application on the local filesystem, for example
+ /usr/bin/test or C:\windows\system32\cmd.exe.
+
+ If the resource represents a web application, then it can have the following
+ property:
+
+ NC:uriTemplate - a URI pointing to the web application to which the type
+ should be handed off, with %s in the template representing
+ the place where the content should be inserted. For example,
+ here is a URI template for a service that lets you email
+ an address in a mailto: link:
+ http://www.example.com/sendmail?link=%s
+-->
+
+<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:NC="http://home.netscape.com/NC-rdf#">
+
+ <RDF:Description about="urn:mimetypes">
+ <NC:MIME-types>
+ <RDF:Seq about="urn:mimetypes:root">
+ </RDF:Seq>
+ </NC:MIME-types>
+ </RDF:Description>
+</RDF:RDF>
diff --git a/components/profile/moz.build b/components/profile/moz.build
index af0009490..c9b3572a4 100644
--- a/components/profile/moz.build
+++ b/components/profile/moz.build
@@ -20,6 +20,13 @@ if CONFIG['OS_ARCH'] == 'WINNT':
LOCAL_INCLUDES += ['/system/runtime']
+FINAL_TARGET_FILES.defaults.profile += ['mimeTypes.rdf']
+
+FINAL_TARGET_FILES.defaults.profile.chrome += [
+ 'userChrome-example.css',
+ 'userContent-example.css',
+]
+
XPIDL_MODULE = 'toolkitprofile'
FINAL_LIBRARY = 'xul'
JAR_MANIFESTS += ['jar.mn']
diff --git a/components/profile/userChrome-example.css b/components/profile/userChrome-example.css
new file mode 100644
index 000000000..420ec3fd6
--- /dev/null
+++ b/components/profile/userChrome-example.css
@@ -0,0 +1,58 @@
+/* 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/. */
+
+/*
+ * Edit this file and copy it as userChrome.css into your
+ * profile-directory/chrome/
+ */
+
+/*
+ * This file can be used to customize the look of Mozilla's user interface
+ * You should consider using !important on rules which you want to
+ * override default settings.
+ */
+
+/*
+ * Do not remove the @namespace line -- it's required for correct functioning
+ */
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
+
+
+/*
+ * Some possible accessibility enhancements:
+ */
+/*
+ * Make all the default font sizes 20 pt:
+ *
+ * * {
+ * font-size: 20pt !important
+ * }
+ */
+/*
+ * Make menu items in particular 15 pt instead of the default size:
+ *
+ * menupopup > * {
+ * font-size: 15pt !important
+ * }
+ */
+/*
+ * Give the Location (URL) Bar a fixed-width font
+ *
+ * #urlbar {
+ * font-family: monospace !important;
+ * }
+ */
+
+/*
+ * Eliminate the throbber and its annoying movement:
+ *
+ * #throbber-box {
+ * display: none !important;
+ * }
+ */
+
+/*
+ * For more examples see http://www-archive.mozilla.org/unix/customizing.html
+ */
+
diff --git a/components/profile/userContent-example.css b/components/profile/userContent-example.css
new file mode 100644
index 000000000..4528c9871
--- /dev/null
+++ b/components/profile/userContent-example.css
@@ -0,0 +1,47 @@
+/* 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/. */
+
+/*
+ * Edit this file and copy it as userContent.css into your
+ * profile-directory/chrome/
+ */
+
+/*
+ * This file can be used to apply a style to all web pages you view
+ * Rules without !important are overruled by author rules if the
+ * author sets any. Rules with !important overrule author rules.
+ */
+
+/*
+ * example: turn off "blink" element blinking
+ *
+ * blink { text-decoration: none ! important; }
+ *
+ */
+
+/*
+ * example: give all tables a 2px border
+ *
+ * table { border: 2px solid; }
+ */
+
+/*
+ * example: turn off "marquee" element
+ *
+ * marquee { -moz-binding: none; }
+ *
+ */
+
+/*
+ * example: make search fields on www.mozilla.org black-on-white
+ *
+ * @-moz-document url-prefix(http://www.mozilla.org/) {
+ * #q { background: white ! important; color: black ! important; }
+ * }
+ */
+
+/*
+ * For more examples see http://www-archive.mozilla.org/unix/customizing.html
+ */
+
diff --git a/other-licenses/7zstub/uxp/7zSD.manifest b/other-licenses/7zstub/gre/7zSD.manifest
index 14639d7f5..14639d7f5 100644
--- a/other-licenses/7zstub/uxp/7zSD.manifest
+++ b/other-licenses/7zstub/gre/7zSD.manifest
diff --git a/other-licenses/7zstub/uxp/7zSD.sfx b/other-licenses/7zstub/gre/7zSD.sfx
index 97c9b38d5..44f353080 100644
--- a/other-licenses/7zstub/uxp/7zSD.sfx
+++ b/other-licenses/7zstub/gre/7zSD.sfx
Binary files differ
diff --git a/system/packager/base.mk b/system/packager/base.mk
new file mode 100644
index 000000000..f6dc197c6
--- /dev/null
+++ b/system/packager/base.mk
@@ -0,0 +1,273 @@
+# 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/.
+
+# == | Setup | ========================================================================================================
+
+ifndef GREPKGR_BASE_MK_INCLUDED
+GREPKGR_BASE_MK_INCLUDED := 1
+else
+$(error GRE Packager base.mk may only be included once)
+endif # GREPKGR_BASE_MK_INCLUDED
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+# These vars are here so that if paths change the number of places that need to be changed is minimal.
+MOZINST_PATH := $(MOZILLA_DIR)/system/installer
+GREPKGR_PATH := $(MOZILLA_DIR)/system/packager
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+# This entire section contains common values normally spread all over hell and back but mostly originate from
+# the multiple application installer makefiles. Which was redundantly redundant so we collect them here.
+
+DEFINES += \
+ -DDLL_PREFIX=$(DLL_PREFIX) \
+ -DDLL_SUFFIX=$(DLL_SUFFIX) \
+ -DBIN_SUFFIX=$(BIN_SUFFIX) \
+ -DMOZ_APP_NAME=$(MOZ_APP_NAME) \
+ -DMOZ_APP_DISPLAYNAME=$(MOZ_APP_NAME) \
+ -DMOZ_APP_ID=$(MOZ_APP_ID) \
+ -DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
+ -DMOZ_APP_MAXVERSION=$(MOZ_APP_MAXVERSION) \
+ -DMOZILLA_VERSION=$(MOZILLA_VERSION) \
+ -DBINPATH=bin \
+ -DPREF_DIR=$(PREF_DIR) \
+ -DMOZ_ICU_VERSION=$(MOZ_ICU_VERSION) \
+ -DMOZ_ICU_DBG_SUFFIX=$(MOZ_ICU_DBG_SUFFIX) \
+ -DICU_DATA_FILE=$(ICU_DATA_FILE) \
+ -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME) \
+ $(NULL)
+
+export USE_ELF_HACK ELF_HACK_FLAGS
+
+ifdef NO_PKG_DEFAULT_FILES
+NO_PKG_FILES += \
+ certutil$(BIN_SUFFIX) \
+ modutil$(BIN_SUFFIX) \
+ pk12util$(BIN_SUFFIX) \
+ shlibsign$(BIN_SUFFIX) \
+ xpcshell$(BIN_SUFFIX) \
+ $(NULL)
+endif
+
+NON_OMNIJAR_FILES += \
+ defaults/profile/chrome/userChrome-example.css \
+ defaults/profile/chrome/userContent-example.css \
+ defaults/profile/mimeTypes.rdf \
+ $(NULL)
+
+MOZ_PKG_FATAL_WARNINGS = 1
+
+ifeq ($(MOZ_CHROME_FILE_FORMAT),jar)
+DEFINES += -DJAREXT=.jar
+else
+ifeq ($(MOZ_PACKAGER_FORMAT),omni)
+DEFINES += -DMOZ_OMNIJAR=1
+endif
+DEFINES += -DJAREXT=
+endif
+
+ifdef MOZ_DEBUG
+DEFINES += -DMOZ_DEBUG=1
+endif
+
+ifdef ENABLE_TESTS
+DEFINES += -DENABLE_TESTS=1
+endif
+
+ifdef MOZ_ANGLE_RENDERER
+DEFINES += -DMOZ_ANGLE_RENDERER=$(MOZ_ANGLE_RENDERER)
+ifdef MOZ_D3DCOMPILER_VISTA_DLL
+DEFINES += -DMOZ_D3DCOMPILER_VISTA_DLL=$(MOZ_D3DCOMPILER_VISTA_DLL)
+endif
+ifdef MOZ_D3DCOMPILER_XP_DLL
+DEFINES += -DMOZ_D3DCOMPILER_XP_DLL=$(MOZ_D3DCOMPILER_XP_DLL)
+endif
+endif
+
+ifdef NIGHTLY_BUILD
+DEFINES += -DNIGHTLY_BUILD=1
+endif
+
+ifdef MOZ_ENABLE_GNOME_COMPONENT
+DEFINES += -DMOZ_ENABLE_GNOME_COMPONENT=1
+endif
+
+ifneq (,$(filter gtk%,$(MOZ_WIDGET_TOOLKIT)))
+DEFINES += -DMOZ_GTK=1
+ifeq ($(MOZ_WIDGET_TOOLKIT),gtk3)
+DEFINES += -DMOZ_GTK3=1
+endif
+endif
+
+ifdef MOZ_FOLD_LIBS
+DEFINES += -DMOZ_FOLD_LIBS=1
+endif
+
+ifdef _MSC_VER
+DEFINES += -D_MSC_VER=$(_MSC_VER)
+endif
+
+ifdef MOZ_SYSTEM_NSPR
+DEFINES += -DMOZ_SYSTEM_NSPR=1
+endif
+
+ifdef MOZ_SYSTEM_NSS
+DEFINES += -DMOZ_SYSTEM_NSS=1
+endif
+
+ifdef NSS_DISABLE_DBM
+DEFINES += -DNSS_DISABLE_DBM=1
+endif
+
+ifdef NECKO_WIFI
+DEFINES += -DNECKO_WIFI=1
+endif
+
+ifdef GKMEDIAS_SHARED_LIBRARY
+DEFINES += -DGKMEDIAS_SHARED_LIBRARY
+endif
+
+# Set MSVC dlls version to package, if any.
+# With VS2015+ it does not make sense to define the ucrt libs without
+# the base c++ libs and vice versa.
+ifdef MOZ_NO_DEBUG_RTL
+ifdef WIN32_REDIST_DIR
+ifdef WIN_UCRT_REDIST_DIR
+DEFINES += \
+ -DMOZ_PACKAGE_MSVC_DLLS=1 \
+ -DMSVC_C_RUNTIME_DLL=$(MSVC_C_RUNTIME_DLL) \
+ -DMSVC_CXX_RUNTIME_DLL=$(MSVC_CXX_RUNTIME_DLL) \
+ -DMOZ_PACKAGE_WIN_UCRT_DLLS=1 \
+ $(NULL)
+endif
+endif
+endif
+
+ifneq ($(OS_ARCH),WINNT)
+DEFINES += -DMOZ_SHARED_MOZGLUE=1
+endif
+
+ifdef MOZ_SYSTEM_ICU
+DEFINES += -DMOZ_SYSTEM_ICU
+endif
+
+ifdef MOZ_ICU_DATA_ARCHIVE
+DEFINES += -DMOZ_ICU_DATA_ARCHIVE
+endif
+
+ifdef MOZ_UPDATER
+DEFINES += -DMOZ_UPDATER=1
+endif
+
+ifneq (,$(wildcard $(DIST)/bin/application.ini))
+BUILDID = $(shell $(PYTHON) $(MOZILLA_DIR)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)
+else
+BUILDID = $(shell $(PYTHON) $(MOZILLA_DIR)/config/printconfigsetting.py $(DIST)/bin/platform.ini Build BuildID)
+endif
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+# Package Application Name
+ifndef PKG_APP_NAME
+PKG_APP_NAME := $(MOZ_APP_NAME)
+endif
+
+# Package Application Version
+ifndef PKG_APP_VERSION
+PKG_APP_VERSION := $(MOZ_APP_VERSION)
+endif
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+# TARGET_OS/TARGET_CPU may be un-intuitive, so we hardcode some special formats
+ifndef PKG_BUILD_TARGET
+PKG_BUILD_TARGET := $(TARGET_OS)-$(TARGET_CPU)
+ifeq ($(OS_ARCH),WINNT)
+ifeq ($(TARGET_CPU),x86_64)
+PKG_BUILD_TARGET := win64
+else
+PKG_BUILD_TARGET := win32
+endif
+endif
+ifeq ($(TARGET_OS),linux-gnu)
+PKG_BUILD_TARGET := linux-$(TARGET_CPU)
+endif
+ifeq ($(OS_ARCH),SunOS)
+PKG_BUILD_TARGET := sunos-$(TARGET_CPU)
+endif
+endif # PKG_BUILD_TARGET
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+# Support the older var in this case but only if the newer one isn't set.
+# We use this when we want to offer different flavors like gtk2 vs gtk3 or different flavors of sunos.
+ifndef PKG_BUILD_FLAVOR
+ifdef MOZ_PKG_SPECIAL
+PKG_BUILD_TARGET := $(PKG_BUILD_TARGET)-$(MOZ_PKG_SPECIAL)
+endif # MOZ_PKG_SPECIAL
+else
+PKG_BUILD_TARGET := $(PKG_BUILD_TARGET)-$(PKG_BUILD_FLAVOR)
+endif # PKG_BUILD_FLAVOR
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+ifndef PGK_BASENAME
+PKG_BASENAME := $(PKG_APP_NAME)-$(PKG_APP_VERSION).$(PKG_BUILD_TARGET)
+endif
+
+# XXXTobin: It would be nice if we could have a generic stage directory but various tools won't allow it.
+PKG_STAGE_DIR = $(PKG_APP_NAME)
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+ifeq ($(OS_ARCH),WINNT)
+# Archiver command and filename
+PKG_ARCHIVER_CMD = 7z a -t7z -m0=lzma2 -mx=9 -aoa -bb3
+PKG_ARCHIVE_FILENAME = $(PKG_BASENAME).7z
+
+# Windows Symbol stage directory and archive filename
+PKG_SYMBOLS_STAGE_DIR = $(PKG_STAGE_DIR)-symbols
+PKG_SYMBOLS_FILENAME = $(PKG_BASENAME)-symbols.7z
+
+# NSIS-related vars and defines.
+ifdef MAKENSISU
+DEFINES += -DHAVE_MAKENSISU=1
+CONFIG_DIR = instgen
+ifndef SFX_MODULE
+SFX_MODULE = $(MOZILLA_SRCDIR)/other-licenses/7zstub/gre/7zSD.sfx
+endif # SFX_MODULE
+endif # MAKENSISU
+
+# Installer filename
+PKG_INSTALLER_FILENAME = $(PKG_BASENAME).installer.exe
+
+# Generic OS name when specifics aren't as important
+PKG_GENERIC_OS = windows
+else
+# Archiver command and filename for not-windows target operating systems
+PKG_ARCHIVER_CMD = $(TAR) cfJv -owner=0 --group=0 --numeric-owner --mode=go-w --exclude=.mkdir.done
+PKG_ARCHIVE_FILENAME = $(PKG_BASENAME).tar.xz
+
+# Generic OS name when specifics aren't as important
+PKG_GENERIC_OS = unix
+endif
+
+# We only use the complete mar patch file
+# XXXTobin: Stop caring about the complete designation
+PKG_UPDATE_FILENAME = $(PKG_BASENAME).complete.mar
+
+# This is the mozbuildinfo json file that contains a number of mozinfra build values
+# We also use this in our infra because it exists..
+PKG_JSON_FILENAME = $(PKG_BASENAME).json
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+# Vars that are used in faking xpi-stage to create useful packages that are normally ONLY omnijar'd
+PKG_XPI_L10N_STAGE_DIR = xpi-stage/grepkgr-locale
+PKG_XPI_L10N_FILENAME := $(PKG_APP_NAME)-$(PKG_APP_VERSION).en-US.langpack.zip
+PKG_XPI_SKIN_STAGE_DIR = xpi-stage/grepkgr-skin
+PKG_XPI_SKIN_FILENAME := $(PKG_APP_NAME)-$(PKG_APP_VERSION).$(PKG_GENERIC_OS).theme.zip
+
+# =====================================================================================================================
diff --git a/system/packager/installer.mk b/system/packager/installer.mk
new file mode 100644
index 000000000..b4eae8e32
--- /dev/null
+++ b/system/packager/installer.mk
@@ -0,0 +1,84 @@
+# 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/.
+
+# == | Setup | ========================================================================================================
+
+TOOLKIT_NSIS_FILES = \
+ common.nsh \
+ locale.nlf \
+ locale-fonts.nsh \
+ locale-rtl.nlf \
+ locales.nsi \
+ overrides.nsh \
+ setup.ico \
+ $(NULL)
+
+CUSTOM_NSIS_PLUGINS = \
+ AccessControl.dll \
+ AppAssocReg.dll \
+ ApplicationID.dll \
+ CertCheck.dll \
+ CityHash.dll \
+ InetBgDL.dll \
+ InvokeShellVerb.dll \
+ liteFirewallW.dll \
+ ServicesHelper.dll \
+ ShellLink.dll \
+ UAC.dll \
+ $(NULL)
+
+CUSTOM_UI = nsisui.exe
+
+# =====================================================================================================================
+
+# == | Makefile Targets | =============================================================================================
+
+$(CONFIG_DIR)/7zSD.sfx:
+ $(CYGWIN_WRAPPER) upx --best -o $(CONFIG_DIR)/7zSD.sfx $(SFX_MODULE)
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+$(CONFIG_DIR)/setup.exe::
+ $(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
+ $(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
+ $(INSTALL) $(addprefix $(MOZINST_PATH)/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR)
+ $(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR)
+ $(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/,$(CUSTOM_UI)) $(CONFIG_DIR)
+ $(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
+ $(srcdir)/$(INSTALLER_DEFINES) -o $(CONFIG_DIR)/defines.nsi)
+ cd $(CONFIG_DIR) && $(MAKENSISU) installer.nsi
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+installer:: stage-package
+ @rm -rf $(DIST)/installer-stage $(DIST)/xpt
+ @echo 'Staging installer files...'
+ @$(NSINSTALL) -D $(DIST)/installer-stage/core
+ @cp -av $(DIST)/$(PKG_STAGE_DIR)/. $(DIST)/installer-stage/core
+ $(RM) -r $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
+ $(MAKE) $(CONFIG_DIR)/setup.exe
+ $(INSTALL) $(CONFIG_DIR)/setup.exe $(DIST)/installer-stage
+ @echo 'Compressing installer files...'
+ cd $(DIST)/installer-stage && $(CYGWIN_WRAPPER) $(PKG_ARCHIVER_CMD) $(abspath $(CONFIG_DIR))/app.7z
+ $(MAKE) $(CONFIG_DIR)/7zSD.sfx
+ cat $(CONFIG_DIR)/7zSD.sfx $(CONFIG_DIR)/app.tag $(CONFIG_DIR)/app.7z > "$(DIST)/$(PKG_INSTALLER_FILENAME)"
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+uninstaller::
+ $(RM) -r $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
+ $(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
+ $(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
+ $(INSTALL) $(addprefix $(MOZINST_PATH)/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR)
+ $(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR)
+ $(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
+ $(srcdir)/src/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
+ $(PYTHON) $(MOZINST_PATH)/windows/nsis/preprocess-locale.py \
+ --preprocess-locale $(MOZILLA_SRCDIR) \
+ $(topsrcdir)/navigator/installer/locale $(AB_CD) $(CONFIG_DIR)
+ $(NSINSTALL) -D $(DIST)/bin/uninstall
+ cd $(CONFIG_DIR) && $(MAKENSISU) uninstaller.nsi
+ cp $(CONFIG_DIR)/helper.exe $(DIST)/bin/uninstall
+
+# =====================================================================================================================
diff --git a/system/packager/locale-install.rdf.in b/system/packager/locale-install.rdf.in
new file mode 100644
index 000000000..23cc16d3c
--- /dev/null
+++ b/system/packager/locale-install.rdf.in
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+ <Description about="urn:mozilla:install-manifest"
+ em:type="8"
+#ifdef MC_PALEMOON
+ em:id="langpack-en-US@palemoon.org"
+#elif BINOC_NAVIGATOR
+ em:id="langpack-en-US@borealis.binaryoutcast.com"
+#elif BINOC_MAIL
+ em:id="langpack-en-US@interlink.binaryoutcast.com"
+#else
+#expand em:id="langpack-en-US@__MOZ_APP_NAME"
+#endif
+ em:version="@MOZ_APP_VERSION@"
+ em:name="English (US) Language Pack"
+#if defined(BINOC_NAVIGATOR) || defined(BINOC_MAIL)
+ em:creator="Binary Outcast"
+#elif MC_PALEMOON
+ em:creator="Moonchild Productions"
+#else
+ em:creator="Open Source Contributors"
+#endif
+ em:strictCompatibility="true"
+ em:license="MPL-2.0">
+
+ <em:targetApplication>
+ <Description em:id="@MOZ_APP_ID@"
+ em:minVersion="@MOZ_APP_VERSION@"
+ em:maxVersion="@MOZ_APP_MAXVERSION@"/>
+ </em:targetApplication>
+ </Description>
+</RDF>
diff --git a/system/packager/packager.mk b/system/packager/packager.mk
new file mode 100644
index 000000000..ba4730392
--- /dev/null
+++ b/system/packager/packager.mk
@@ -0,0 +1,137 @@
+# 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/.
+
+# == | Makefile Targets | =============================================================================================
+
+libs:: stage-package
+
+install::
+ $(error "make install" is no longer supported on any target operating system. Use "make package" instead)
+
+ifeq ($(OS_ARCH),WINNT)
+ifndef MAKENSISU
+installer::
+ $(error "make installer" requires NSIS)
+endif # MAKENSISU
+else
+installer::
+ $(error "make installer" only supports Windows at this time)
+endif
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+# Handle the package manifest(s) if it is used
+ifdef MOZ_PKG_MANIFEST_P
+MOZ_PKG_MANIFEST = package-manifest
+
+$(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P) $(GLOBAL_DEPS)
+ $(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $< -o $@)
+
+GARBAGE += $(MOZ_PKG_MANIFEST)
+endif
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+# Create the mozbuildinfo json file
+.PHONY: json-metadata
+json-metadata:
+ @$(RM) -f $(DIST)/$(PKG_JSON_FILENAME)
+ $(PYTHON) $(MOZINST_PATH)/informulate.py \
+ $(DIST)/$(PKG_JSON_FILENAME) \
+ BUILDID=$(BUILDID) \
+ MOZ_PKG_PLATFORM=$(PKG_BUILD_TARGET)
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+# Stage and strip the package
+stage-package: $(MOZ_PKG_MANIFEST) json-metadata
+ @echo 'Staging application files...'
+ OMNIJAR_NAME=$(OMNIJAR_NAME) \
+ NO_PKG_FILES="$(NO_PKG_FILES)" \
+ $(PYTHON) $(MOZINST_PATH)/packager.py $(DEFINES) $(ACDEFINES) \
+ --format $(MOZ_PACKAGER_FORMAT) \
+ $(if $(MOZ_PKG_REMOVALS),$(addprefix --removals ,$(MOZ_PKG_REMOVALS))) \
+ $(if $(filter-out 0,$(MOZ_PKG_FATAL_WARNINGS)),,--ignore-errors) \
+ $(if $(OPTIMIZEJARS),--optimizejars) \
+ $(addprefix --compress ,$(JAR_COMPRESSION)) \
+ $(MOZ_PKG_MANIFEST) '$(DIST)' '$(DIST)'/$(PKG_STAGE_DIR)$(if $(MOZ_PKG_MANIFEST),,$(_BINPATH)) \
+ $(if $(filter omni,$(MOZ_PACKAGER_FORMAT)),$(if $(NON_OMNIJAR_FILES),--non-resource $(NON_OMNIJAR_FILES)))
+ $(PYTHON) $(MOZINST_PATH)/find-dupes.py $(DIST)/$(PKG_STAGE_DIR)
+ @(cd $(DIST)/$(PKG_STAGE_DIR) && $(CREATE_PRECOMPLETE_CMD))
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+# Package the application as an archive
+archive: stage-package
+ @echo 'Compressing application archive...'
+ifeq ($(OS_ARCH),WINNT)
+ cd $(DIST); $(CYGWIN_WRAPPER) $(PKG_ARCHIVER_CMD) $(PKG_ARCHIVE_FILENAME) $(PKG_STAGE_DIR)
+else
+ cd $(DIST); XZ_OPT=-9e $(PKG_ARCHIVER_CMD) $(PKG_ARCHIVE_FILENAME) $(PKG_STAGE_DIR)
+endif
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+# Package debugging symbols
+.PHONY: symbols
+symbols:
+ifeq ($(OS_ARCH),WINNT)
+ @echo 'Staging debugging symbols...'
+ @$(RM) -rf $(DIST)/$(PKG_SYMBOLS_STAGE_DIR) $(DIST)/$(PKG_SYMBOLS_FILENAME)
+ cd $(topobjdir); find . -type f -name "*.pdb" \
+ -not -path "./dist/*" \
+ -not -name "generated.pdb" \
+ -not -name "vc*.pdb" \
+ -exec install -Dv {} ./dist/$(PKG_SYMBOLS_STAGE_DIR)/{} \;
+ @echo 'Compressing debugging symbols...'
+ cd $(DIST); $(CYGWIN_WRAPPER) $(PKG_ARCHIVER_CMD) $(PKG_SYMBOLS_FILENAME) $(PKG_SYMBOLS_STAGE_DIR)
+else
+ $(error "make symbols" only supports Windows at this time)
+endif
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+# For some reason when manually regenerating the chrome files with a fully built dist/bin it fucks up compiling
+# the startupcache.
+# So we only invoke this phony-target purging and regenerating when the application is NOT fully built.
+# Otherwise one should treat the locale and skin targets like any other packaging target, namely, issuing a build
+# command to regenerate.
+# tl;dr hacks are hack-y.
+.PHONY: regenerate-chrome
+regenerate-chrome:
+ @echo '(Re)generating chrome files...'
+ @test -f $(topobjdir)/source-repo.h || $(MAKE) -C $(DEPTH) export
+ @$(RM) -rf $(DIST)/bin/chrome.manifest $(DIST)/bin/chrome;
+ @$(MAKE) -C $(DEPTH) chrome
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+# Create an en-US language pack without needing a whole custom build system codepath
+locale: $(GREPKGR_PATH)/locale-install.rdf.in
+ @$(RM) -rf $(DIST)/$(PKG_XPI_L10N_STAGE_DIR) $(DIST)/$(PKG_XPI_L10N_FILENAME)
+ @test -f $(DIST)/bin/$(MOZ_APP_NAME)$(BIN_SUFFIX) || $(MAKE) regenerate-chrome
+ @echo 'Staging l10n files...'
+ @$(NSINSTALL) -D $(DIST)/$(PKG_XPI_L10N_STAGE_DIR)/chrome
+ @cp -rv $(DIST)/bin/chrome/en-US.manifest $(DIST)/bin/chrome/en-US $(DIST)/$(PKG_XPI_L10N_STAGE_DIR)/chrome
+ @echo manifest chrome/en-US.manifest > $(DIST)/$(PKG_XPI_L10N_STAGE_DIR)/chrome.manifest
+ $(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) $^ -o $(DIST)/$(PKG_XPI_L10N_STAGE_DIR)/install.rdf)
+ @echo 'Compressing l10n files...'
+ cd $(DIST)/$(PKG_XPI_L10N_STAGE_DIR); $(ZIP) -Dr9X ../../$(PKG_XPI_L10N_FILENAME) *
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+# Create an os-dependent skin without needing a whole custom build system codepath
+skin: $(GREPKGR_PATH)/skin-install.rdf.in
+ @$(RM) -rf $(DIST)/$(PKG_XPI_SKIN_STAGE_DIR) $(DIST)/$(PKG_XPI_SKIN_FILENAME)
+ @test -f $(DIST)/bin/$(MOZ_APP_NAME)$(BIN_SUFFIX) || $(MAKE) regenerate-chrome
+ @echo 'Staging theme files...'
+ @$(NSINSTALL) -D $(DIST)/$(PKG_XPI_SKIN_STAGE_DIR)/chrome
+ @cp -rv $(DIST)/bin/chrome/classic.manifest $(DIST)/bin/chrome/classic $(DIST)/$(PKG_XPI_SKIN_STAGE_DIR)/chrome
+ @cp -rv $(DIST)/bin/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.manifest $(DIST)/$(PKG_XPI_SKIN_STAGE_DIR)
+ @echo manifest chrome/classic.manifest >> $(DIST)/$(PKG_XPI_SKIN_STAGE_DIR)/chrome.manifest
+ $(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) $^ -o $(DIST)/$(PKG_XPI_SKIN_STAGE_DIR)/install.rdf)
+ @echo 'Compressing theme files...'
+ cd $(DIST)/$(PKG_XPI_SKIN_STAGE_DIR); $(ZIP) -Dr9X ../../$(PKG_XPI_SKIN_FILENAME) *
+
+# =====================================================================================================================
diff --git a/system/packager/skin-install.rdf.in b/system/packager/skin-install.rdf.in
new file mode 100644
index 000000000..e646ff95d
--- /dev/null
+++ b/system/packager/skin-install.rdf.in
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+ <Description about="urn:mozilla:install-manifest"
+ em:type="4"
+#expand em:id="default-theme@__MOZ_APP_NAME__"
+ em:version="@MOZ_APP_VERSION@"
+ em:name="Default Application Theme"
+ em:creator="Open Source Contributors"
+ em:strictCompatibility="true"
+ em:internalName="classic/1.0"
+ em:license="MPL-2.0">
+
+ <em:targetApplication>
+ <Description em:id="@MOZ_APP_ID@"
+ em:minVersion="@MOZ_APP_VERSION@"
+ em:maxVersion="@MOZ_APP_VERSION@"/>
+ </em:targetApplication>
+ </Description>
+</RDF>