michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: ifndef CONFIG_DIR michael@0: $(error CONFIG_DIR must be set before including makensis.mk) michael@0: endif michael@0: michael@0: include $(MOZILLA_DIR)/toolkit/mozapps/installer/signing.mk michael@0: michael@0: ABS_CONFIG_DIR := $(abspath $(CONFIG_DIR)) michael@0: michael@0: SFX_MODULE ?= $(error SFX_MODULE is not defined) michael@0: michael@0: TOOLKIT_NSIS_FILES = \ michael@0: common.nsh \ michael@0: locale.nlf \ michael@0: locale-fonts.nsh \ michael@0: locale-rtl.nlf \ michael@0: locales.nsi \ michael@0: overrides.nsh \ michael@0: setup.ico \ michael@0: $(NULL) michael@0: michael@0: CUSTOM_NSIS_PLUGINS = \ michael@0: AccessControl.dll \ michael@0: AppAssocReg.dll \ michael@0: ApplicationID.dll \ michael@0: CertCheck.dll \ michael@0: CityHash.dll \ michael@0: InetBgDL.dll \ michael@0: InvokeShellVerb.dll \ michael@0: ServicesHelper.dll \ michael@0: ShellLink.dll \ michael@0: UAC.dll \ michael@0: $(NULL) michael@0: michael@0: CUSTOM_UI = \ michael@0: nsisui.exe \ michael@0: $(NULL) michael@0: michael@0: $(CONFIG_DIR)/setup.exe:: michael@0: $(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR) michael@0: $(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR) michael@0: $(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/,$(CUSTOM_UI)) $(CONFIG_DIR) michael@0: cd $(CONFIG_DIR) && $(MAKENSISU) installer.nsi michael@0: ifdef MOZ_STUB_INSTALLER michael@0: cd $(CONFIG_DIR) && $(MAKENSISU) stub.nsi michael@0: ifdef MOZ_EXTERNAL_SIGNING_FORMAT michael@0: $(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) $(CONFIG_DIR)/setup-stub.exe michael@0: endif michael@0: $(MAKE) $(CONFIG_DIR)/7zSD.sfx michael@0: 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: cat $(CONFIG_DIR)/7zSD.sfx $(CONFIG_DIR)/stub.tag $(CONFIG_DIR)/stub.7z > "$(CONFIG_DIR)/stub.exe" michael@0: ifdef MOZ_EXTERNAL_SIGNING_FORMAT michael@0: $(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) $(CONFIG_DIR)/stub.exe michael@0: endif michael@0: endif michael@0: # Support for building the uninstaller when repackaging locales michael@0: ifeq ($(CONFIG_DIR),l10ngen) michael@0: cd $(CONFIG_DIR) && $(MAKENSISU) uninstaller.nsi michael@0: endif michael@0: ifdef MOZ_EXTERNAL_SIGNING_FORMAT michael@0: $(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) "$@" michael@0: endif michael@0: michael@0: $(CONFIG_DIR)/7zSD.sfx: michael@0: $(CYGWIN_WRAPPER) upx --best -o $(CONFIG_DIR)/7zSD.sfx $(SFX_MODULE) michael@0: michael@0: installer:: michael@0: $(INSTALL) $(CONFIG_DIR)/setup.exe $(DEPTH)/installer-stage michael@0: 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: $(MAKE) $(CONFIG_DIR)/7zSD.sfx michael@0: $(NSINSTALL) -D $(DIST)/$(PKG_INST_PATH) michael@0: cat $(CONFIG_DIR)/7zSD.sfx $(CONFIG_DIR)/app.tag $(CONFIG_DIR)/app.7z > "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe" michael@0: chmod 0755 "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe" michael@0: ifdef MOZ_STUB_INSTALLER michael@0: cp $(CONFIG_DIR)/stub.exe "$(DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe" michael@0: chmod 0755 "$(DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe" michael@0: endif michael@0: ifdef MOZ_EXTERNAL_SIGNING_FORMAT michael@0: $(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe" michael@0: endif michael@0: michael@0: # For building the uninstaller during the application build so it can be michael@0: # included for mar file generation. michael@0: uninstaller:: michael@0: $(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR) michael@0: $(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR) michael@0: cd $(CONFIG_DIR) && $(MAKENSISU) uninstaller.nsi michael@0: $(NSINSTALL) -D $(DIST)/bin/uninstall michael@0: cp $(CONFIG_DIR)/helper.exe $(DIST)/bin/uninstall michael@0: michael@0: ifdef MOZ_MAINTENANCE_SERVICE michael@0: maintenanceservice_installer:: michael@0: cd $(CONFIG_DIR) && $(MAKENSISU) maintenanceservice_installer.nsi michael@0: $(NSINSTALL) -D $(DIST)/bin/ michael@0: cp $(CONFIG_DIR)/maintenanceservice_installer.exe $(DIST)/bin michael@0: endif michael@0: michael@0: ifdef MOZ_WEBAPP_RUNTIME michael@0: webapp_uninstaller:: michael@0: $(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR) michael@0: $(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR) michael@0: cd $(CONFIG_DIR) && $(MAKENSISU) webapp-uninstaller.nsi michael@0: $(NSINSTALL) -D $(DIST)/bin michael@0: cp $(CONFIG_DIR)/webapp-uninstaller.exe $(DIST)/bin michael@0: endif