1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/mozapps/installer/windows/nsis/makensis.mk Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,108 @@ 1.4 +# This Source Code Form is subject to the terms of the Mozilla Public 1.5 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.7 + 1.8 +ifndef CONFIG_DIR 1.9 +$(error CONFIG_DIR must be set before including makensis.mk) 1.10 +endif 1.11 + 1.12 +include $(MOZILLA_DIR)/toolkit/mozapps/installer/signing.mk 1.13 + 1.14 +ABS_CONFIG_DIR := $(abspath $(CONFIG_DIR)) 1.15 + 1.16 +SFX_MODULE ?= $(error SFX_MODULE is not defined) 1.17 + 1.18 +TOOLKIT_NSIS_FILES = \ 1.19 + common.nsh \ 1.20 + locale.nlf \ 1.21 + locale-fonts.nsh \ 1.22 + locale-rtl.nlf \ 1.23 + locales.nsi \ 1.24 + overrides.nsh \ 1.25 + setup.ico \ 1.26 + $(NULL) 1.27 + 1.28 +CUSTOM_NSIS_PLUGINS = \ 1.29 + AccessControl.dll \ 1.30 + AppAssocReg.dll \ 1.31 + ApplicationID.dll \ 1.32 + CertCheck.dll \ 1.33 + CityHash.dll \ 1.34 + InetBgDL.dll \ 1.35 + InvokeShellVerb.dll \ 1.36 + ServicesHelper.dll \ 1.37 + ShellLink.dll \ 1.38 + UAC.dll \ 1.39 + $(NULL) 1.40 + 1.41 +CUSTOM_UI = \ 1.42 + nsisui.exe \ 1.43 + $(NULL) 1.44 + 1.45 +$(CONFIG_DIR)/setup.exe:: 1.46 + $(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR) 1.47 + $(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR) 1.48 + $(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/,$(CUSTOM_UI)) $(CONFIG_DIR) 1.49 + cd $(CONFIG_DIR) && $(MAKENSISU) installer.nsi 1.50 +ifdef MOZ_STUB_INSTALLER 1.51 + cd $(CONFIG_DIR) && $(MAKENSISU) stub.nsi 1.52 +ifdef MOZ_EXTERNAL_SIGNING_FORMAT 1.53 + $(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) $(CONFIG_DIR)/setup-stub.exe 1.54 +endif 1.55 + $(MAKE) $(CONFIG_DIR)/7zSD.sfx 1.56 + 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 1.57 + cat $(CONFIG_DIR)/7zSD.sfx $(CONFIG_DIR)/stub.tag $(CONFIG_DIR)/stub.7z > "$(CONFIG_DIR)/stub.exe" 1.58 +ifdef MOZ_EXTERNAL_SIGNING_FORMAT 1.59 + $(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) $(CONFIG_DIR)/stub.exe 1.60 +endif 1.61 +endif 1.62 +# Support for building the uninstaller when repackaging locales 1.63 +ifeq ($(CONFIG_DIR),l10ngen) 1.64 + cd $(CONFIG_DIR) && $(MAKENSISU) uninstaller.nsi 1.65 +endif 1.66 +ifdef MOZ_EXTERNAL_SIGNING_FORMAT 1.67 + $(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) "$@" 1.68 +endif 1.69 + 1.70 +$(CONFIG_DIR)/7zSD.sfx: 1.71 + $(CYGWIN_WRAPPER) upx --best -o $(CONFIG_DIR)/7zSD.sfx $(SFX_MODULE) 1.72 + 1.73 +installer:: 1.74 + $(INSTALL) $(CONFIG_DIR)/setup.exe $(DEPTH)/installer-stage 1.75 + 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 1.76 + $(MAKE) $(CONFIG_DIR)/7zSD.sfx 1.77 + $(NSINSTALL) -D $(DIST)/$(PKG_INST_PATH) 1.78 + cat $(CONFIG_DIR)/7zSD.sfx $(CONFIG_DIR)/app.tag $(CONFIG_DIR)/app.7z > "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe" 1.79 + chmod 0755 "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe" 1.80 +ifdef MOZ_STUB_INSTALLER 1.81 + cp $(CONFIG_DIR)/stub.exe "$(DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe" 1.82 + chmod 0755 "$(DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe" 1.83 +endif 1.84 +ifdef MOZ_EXTERNAL_SIGNING_FORMAT 1.85 + $(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe" 1.86 +endif 1.87 + 1.88 +# For building the uninstaller during the application build so it can be 1.89 +# included for mar file generation. 1.90 +uninstaller:: 1.91 + $(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR) 1.92 + $(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR) 1.93 + cd $(CONFIG_DIR) && $(MAKENSISU) uninstaller.nsi 1.94 + $(NSINSTALL) -D $(DIST)/bin/uninstall 1.95 + cp $(CONFIG_DIR)/helper.exe $(DIST)/bin/uninstall 1.96 + 1.97 +ifdef MOZ_MAINTENANCE_SERVICE 1.98 +maintenanceservice_installer:: 1.99 + cd $(CONFIG_DIR) && $(MAKENSISU) maintenanceservice_installer.nsi 1.100 + $(NSINSTALL) -D $(DIST)/bin/ 1.101 + cp $(CONFIG_DIR)/maintenanceservice_installer.exe $(DIST)/bin 1.102 +endif 1.103 + 1.104 +ifdef MOZ_WEBAPP_RUNTIME 1.105 +webapp_uninstaller:: 1.106 + $(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR) 1.107 + $(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR) 1.108 + cd $(CONFIG_DIR) && $(MAKENSISU) webapp-uninstaller.nsi 1.109 + $(NSINSTALL) -D $(DIST)/bin 1.110 + cp $(CONFIG_DIR)/webapp-uninstaller.exe $(DIST)/bin 1.111 +endif