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/.
6
$(error CONFIG_DIR must be set before including makensis.mk)
9
include $(MOZILLA_DIR)/toolkit/mozapps/installer/signing.mk
11
ABS_CONFIG_DIR := $(shell pwd)/$(CONFIG_DIR)
13
SFX_MODULE ?= $(error SFX_MODULE is not defined)
15
TOOLKIT_NSIS_FILES = \
23
CUSTOM_NSIS_PLUGINS = \
34
$(CONFIG_DIR)/setup.exe::
35
$(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR)
36
$(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR)
37
cd $(CONFIG_DIR) && $(MAKENSISU) installer.nsi
38
# Support for building the uninstaller when repackaging locales
39
ifeq ($(CONFIG_DIR),l10ngen)
40
cd $(CONFIG_DIR) && $(MAKENSISU) uninstaller.nsi
42
ifdef MOZ_EXTERNAL_SIGNING_FORMAT
43
$(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) "$@"
46
$(CONFIG_DIR)/7zSD.sfx:
47
$(CYGWIN_WRAPPER) upx --best -o $(CONFIG_DIR)/7zSD.sfx $(SFX_MODULE)
50
$(INSTALL) $(CONFIG_DIR)/setup.exe $(DEPTH)/installer-stage
51
cd $(DEPTH)/installer-stage && $(CYGWIN_WRAPPER) 7z a -r -t7z $(ABS_CONFIG_DIR)/app.7z -mx -m0=BCJ2 -m1=LZMA:d24 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3
52
$(MAKE) $(CONFIG_DIR)/7zSD.sfx
53
$(NSINSTALL) -D $(DIST)/$(PKG_INST_PATH)
54
cat $(CONFIG_DIR)/7zSD.sfx $(CONFIG_DIR)/app.tag $(CONFIG_DIR)/app.7z > "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe"
55
chmod 0755 "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe"
56
ifdef MOZ_EXTERNAL_SIGNING_FORMAT
57
$(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe"
60
# For building the uninstaller during the application build so it can be
61
# included for mar file generation.
63
$(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR)
64
$(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR)
65
cd $(CONFIG_DIR) && $(MAKENSISU) uninstaller.nsi
66
$(NSINSTALL) -D $(DIST)/bin/uninstall
67
cp $(CONFIG_DIR)/helper.exe $(DIST)/bin/uninstall
69
ifdef MOZ_MAINTENANCE_SERVICE
70
maintenanceservice_installer::
71
cd $(CONFIG_DIR) && $(MAKENSISU) maintenanceservice_installer.nsi
72
$(NSINSTALL) -D $(DIST)/bin/
73
cp $(CONFIG_DIR)/maintenanceservice_installer.exe $(DIST)/bin
76
ifdef MOZ_WEBAPP_RUNTIME
78
$(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR)
79
$(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR)
80
cd $(CONFIG_DIR) && $(MAKENSISU) webapp-uninstaller.nsi
81
$(NSINSTALL) -D $(FINAL_TARGET)
82
cp $(CONFIG_DIR)/webapp-uninstaller.exe $(FINAL_TARGET)