From 27d7ebc75e90a734dbfc6286d13d281348a747b5 Mon Sep 17 00:00:00 2001 From: Chris DuPuis Date: Fri, 21 Feb 2025 16:17:24 +0000 Subject: [PATCH] Bug 1940280 - Part 5: Update Makefiles to make everything r=nalexander,browser-installer-reviewers Note that this builds the test_stub.exe exectuable into $(topobjdir)/dist/bin Differential Revision: https://phabricator.services.mozilla.com/D233407 --- browser/Makefile.in | 14 ++++++++- browser/installer/windows/Makefile.in | 13 +++++++-- browser/installer/windows/nsis/Makefile.in | 29 +++++++++++++++++++ .../mozbuild/mozbuild/action/test_archive.py | 1 + 4 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 browser/installer/windows/nsis/Makefile.in diff --git a/browser/Makefile.in b/browser/Makefile.in index 2eb9e708f68e..364f590f5116 100644 --- a/browser/Makefile.in +++ b/browser/Makefile.in @@ -10,7 +10,19 @@ ifdef MAKENSISU # uninstaller is included with the application for mar file generation. libs:: $(MAKE) -C installer/windows uninstaller +ifdef ENABLE_TESTS + $(MAKE) -C installer/windows install_deps +endif #ENABLE_TESTS + ifdef MOZ_MAINTENANCE_SERVICE $(MAKE) -C installer/windows maintenanceservice_installer endif -endif + + +ifdef ENABLE_TESTS +tools:: + # test_stub.exe is used for testing installer functionality. + $(MAKE) -C installer/windows/nsis test_stub_installer +endif #ENABLE_TESTS + +endif #MAKENSISU diff --git a/browser/installer/windows/Makefile.in b/browser/installer/windows/Makefile.in index 15dfcd748a0a..0e1db5a1752d 100644 --- a/browser/installer/windows/Makefile.in +++ b/browser/installer/windows/Makefile.in @@ -22,7 +22,10 @@ INSTALLER_FILES = \ nsis/installer.nsi \ nsis/uninstaller.nsi \ nsis/stub.nsi \ + nsis/stub.nsh \ + nsis/stub_shared_defs.nsh \ nsis/shared.nsh \ + nsis/test_stub.nsi \ stub.tag \ $(NULL) @@ -55,9 +58,7 @@ else PPL_LOCALE_ARGS=$(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer endif -$(CONFIG_DIR)/setup.exe:: - $(RM) -r $(CONFIG_DIR) - $(MKDIR) $(CONFIG_DIR) +install_deps: $(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR) $(INSTALL) $(addprefix $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/,$(BRANDING_FILES)) $(CONFIG_DIR) $(call py_action,preprocessor defines.nsi,-Fsubstitution $(DEFINES) $(ACDEFINES) \ @@ -73,6 +74,12 @@ $(CONFIG_DIR)/setup.exe:: $(PYTHON3) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \ --convert-utf8-utf16le \ $(srcdir)/nsis/extensionsLocale.nsh $(CONFIG_DIR)/extensionsLocale.nsh + $(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/,$(CUSTOM_UI)) $(CONFIG_DIR) + +$(CONFIG_DIR)/setup.exe:: + $(RM) -r $(CONFIG_DIR) + $(MKDIR) $(CONFIG_DIR) + $(MAKE) install_deps include $(topsrcdir)/config/rules.mk include $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/makensis.mk diff --git a/browser/installer/windows/nsis/Makefile.in b/browser/installer/windows/nsis/Makefile.in new file mode 100644 index 000000000000..fd264ad219d7 --- /dev/null +++ b/browser/installer/windows/nsis/Makefile.in @@ -0,0 +1,29 @@ + +include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk +include $(topsrcdir)/config/config.mk + +VPATH = @srcdir@ + +CONFIG_DIR = $(topobjdir)/browser/installer/windows/instgen +BIN_UTIL_DIR = $(topobjdir)/dist/bin + +TEST_STUB_INSTALLER_DEPS := \ + test_stub.nsi \ + stub.nsh \ + stub_shared_defs.nsh \ + $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/common.nsh \ + shared.nsh \ + defines.nsi.in \ + $(NULL) + +test_stub_installer: +ifdef ENABLE_TESTS + $(MAKE) $(BIN_UTIL_DIR)/test_stub_installer.exe +else + @echo Skipping build of test_stub_installer.exe since tests are not enabled +endif # ENABLE_TESTS + +$(BIN_UTIL_DIR)/test_stub_installer.exe: $(TEST_STUB_INSTALLER_DEPS) + $(MAKE) -C .. install_deps + cd $(CONFIG_DIR) && $(MAKENSISU) -nocd -- $(CONFIG_DIR)/test_stub.nsi + cp $(CONFIG_DIR)/test_stub_installer.exe $(BIN_UTIL_DIR)/test_stub_installer.exe diff --git a/python/mozbuild/mozbuild/action/test_archive.py b/python/mozbuild/mozbuild/action/test_archive.py index 08e596f85ed5..508c7800fd2c 100644 --- a/python/mozbuild/mozbuild/action/test_archive.py +++ b/python/mozbuild/mozbuild/action/test_archive.py @@ -47,6 +47,7 @@ TEST_HARNESS_BINS = [ "screenshot", "screentopng", "ssltunnel", + "test_stub_installer", "xpcshell", "plugin-container", ]