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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 # This Source Code Form is subject to the terms of the Mozilla Public
     2 # License, v. 2.0. If a copy of the MPL was not distributed with this
     3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
     5 ifndef CONFIG_DIR
     6 $(error CONFIG_DIR must be set before including makensis.mk)
     7 endif
     9 include $(MOZILLA_DIR)/toolkit/mozapps/installer/signing.mk
    11 ABS_CONFIG_DIR := $(abspath $(CONFIG_DIR))
    13 SFX_MODULE ?= $(error SFX_MODULE is not defined)
    15 TOOLKIT_NSIS_FILES = \
    16 	common.nsh \
    17 	locale.nlf \
    18 	locale-fonts.nsh \
    19 	locale-rtl.nlf \
    20 	locales.nsi \
    21 	overrides.nsh \
    22 	setup.ico \
    23 	$(NULL)
    25 CUSTOM_NSIS_PLUGINS = \
    26 	AccessControl.dll \
    27 	AppAssocReg.dll \
    28 	ApplicationID.dll \
    29 	CertCheck.dll \
    30 	CityHash.dll \
    31 	InetBgDL.dll \
    32 	InvokeShellVerb.dll \
    33 	ServicesHelper.dll \
    34 	ShellLink.dll \
    35 	UAC.dll \
    36 	$(NULL)
    38 CUSTOM_UI = \
    39 	nsisui.exe \
    40 	$(NULL)
    42 $(CONFIG_DIR)/setup.exe::
    43 	$(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR)
    44 	$(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR)
    45 	$(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/,$(CUSTOM_UI)) $(CONFIG_DIR)
    46 	cd $(CONFIG_DIR) && $(MAKENSISU) installer.nsi
    47 ifdef MOZ_STUB_INSTALLER
    48 	cd $(CONFIG_DIR) && $(MAKENSISU) stub.nsi
    49 ifdef MOZ_EXTERNAL_SIGNING_FORMAT
    50 	$(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) $(CONFIG_DIR)/setup-stub.exe
    51 endif
    52 	$(MAKE) $(CONFIG_DIR)/7zSD.sfx
    53 	cd $(CONFIG_DIR) &&  $(CYGWIN_WRAPPER) 7z a -t7z $(ABS_CONFIG_DIR)/stub.7z setup-stub.exe -mx -m0=BCJ2 -m1=LZMA:d21 -m2=LZMA:d17 -m3=LZMA:d17 -mb0:1 -mb0s1:2 -mb0s2:3
    54 	cat $(CONFIG_DIR)/7zSD.sfx $(CONFIG_DIR)/stub.tag $(CONFIG_DIR)/stub.7z > "$(CONFIG_DIR)/stub.exe"
    55 ifdef MOZ_EXTERNAL_SIGNING_FORMAT
    56 	$(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) $(CONFIG_DIR)/stub.exe
    57 endif
    58 endif
    59 # Support for building the uninstaller when repackaging locales
    60 ifeq ($(CONFIG_DIR),l10ngen)
    61 	cd $(CONFIG_DIR) && $(MAKENSISU) uninstaller.nsi
    62 endif
    63 ifdef MOZ_EXTERNAL_SIGNING_FORMAT
    64 	$(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) "$@"
    65 endif
    67 $(CONFIG_DIR)/7zSD.sfx:
    68 	$(CYGWIN_WRAPPER) upx --best -o $(CONFIG_DIR)/7zSD.sfx $(SFX_MODULE)
    70 installer::
    71 	$(INSTALL) $(CONFIG_DIR)/setup.exe $(DEPTH)/installer-stage
    72 	cd $(DEPTH)/installer-stage && $(CYGWIN_WRAPPER) 7z a -r -t7z $(ABS_CONFIG_DIR)/app.7z -mx -m0=BCJ2 -m1=LZMA:d25 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3
    73 	$(MAKE) $(CONFIG_DIR)/7zSD.sfx
    74 	$(NSINSTALL) -D $(DIST)/$(PKG_INST_PATH)
    75 	cat $(CONFIG_DIR)/7zSD.sfx $(CONFIG_DIR)/app.tag $(CONFIG_DIR)/app.7z > "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe"
    76 	chmod 0755 "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe"
    77 ifdef MOZ_STUB_INSTALLER
    78 	cp $(CONFIG_DIR)/stub.exe "$(DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe"
    79 	chmod 0755 "$(DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe"
    80 endif
    81 ifdef MOZ_EXTERNAL_SIGNING_FORMAT
    82 	$(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe"
    83 endif
    85 # For building the uninstaller during the application build so it can be
    86 # included for mar file generation.
    87 uninstaller::
    88 	$(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR)
    89 	$(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR)
    90 	cd $(CONFIG_DIR) && $(MAKENSISU) uninstaller.nsi
    91 	$(NSINSTALL) -D $(DIST)/bin/uninstall
    92 	cp $(CONFIG_DIR)/helper.exe $(DIST)/bin/uninstall
    94 ifdef MOZ_MAINTENANCE_SERVICE
    95 maintenanceservice_installer::
    96 	cd $(CONFIG_DIR) && $(MAKENSISU) maintenanceservice_installer.nsi
    97 	$(NSINSTALL) -D $(DIST)/bin/
    98 	cp $(CONFIG_DIR)/maintenanceservice_installer.exe $(DIST)/bin
    99 endif
   101 ifdef MOZ_WEBAPP_RUNTIME
   102 webapp_uninstaller::
   103 	$(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR)
   104 	$(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR)
   105 	cd $(CONFIG_DIR) && $(MAKENSISU) webapp-uninstaller.nsi
   106 	$(NSINSTALL) -D $(DIST)/bin
   107 	cp $(CONFIG_DIR)/webapp-uninstaller.exe $(DIST)/bin
   108 endif

mercurial