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