From d26f44bcdd31c08f3d7b7651df39d3747127f7af Mon Sep 17 00:00:00 2001 From: Louie S Date: Thu, 9 May 2024 13:00:38 -0400 Subject: Experimental support for building NSIS installer --- docs/windows_compile_instructions.md | 5 ++++- nsis/Makefile.am | 9 +++++++-- nsis/Makefile.in | 8 ++++++-- nsis/installer.nsi.in | 3 ++- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/docs/windows_compile_instructions.md b/docs/windows_compile_instructions.md index 5e700c5..757dece 100644 --- a/docs/windows_compile_instructions.md +++ b/docs/windows_compile_instructions.md @@ -54,10 +54,13 @@ These instructions were written with 64-bit architecture in mind. Although I hav --- -## Building an Installer (WIP) +## Building an Installer Support for building an NSIS installer is in development (it currently will not work, as it is missing the installation of certain dependencies). 1. First, follow the above instructions to compile the project 2. Run `cd nsis && make installer` + - You may want to specify a path to search for dlls that the project depends on. To do so, pass an argument to the make command, for example: `make installer SEARCHPATH="/usr/x86_64-w64-mingw32/bin"` 3. Run the generated `nsis/terminal-media-launcher-Setup.exe` file + +Please note that support for building a Windows installer is still experimental! diff --git a/nsis/Makefile.am b/nsis/Makefile.am index c16bc2c..3f47a9f 100644 --- a/nsis/Makefile.am +++ b/nsis/Makefile.am @@ -1,8 +1,13 @@ EXTRA_DIST = installer.nsi.in -CLEANFILES = $(PACKAGE_NAME)-Setup.exe +CLEANFILES = $(PACKAGE_NAME)-Setup.exe deps/* + +SEARCHPATH=$$PATH +DEPENDENCIES = $(shell ./find_dlls.sh -q -s $(SEARCHPATH) '../src/$(PACKAGE_NAME).exe') .PHONY: installer +installer: $(PACKAGE_NAME)-Setup.exe $(PACKAGE_NAME)-Setup.exe: installer.nsi + mkdir -p deps + for file in $(DEPENDENCIES); do install "$$file" "deps/$$(basename "$$file")"; done makensis installer.nsi -installer: $(PACKAGE_NAME)-Setup.exe diff --git a/nsis/Makefile.in b/nsis/Makefile.in index 76207d2..9588932 100644 --- a/nsis/Makefile.in +++ b/nsis/Makefile.in @@ -222,7 +222,9 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = installer.nsi.in -CLEANFILES = $(PACKAGE_NAME)-Setup.exe +CLEANFILES = $(PACKAGE_NAME)-Setup.exe deps/* +SEARCHPATH = $$PATH +DEPENDENCIES = $(shell ./find_dlls.sh -q -s $(SEARCHPATH) '../src/$(PACKAGE_NAME).exe') all: all-am .SUFFIXES: @@ -414,9 +416,11 @@ uninstall-am: .PHONY: installer +installer: $(PACKAGE_NAME)-Setup.exe $(PACKAGE_NAME)-Setup.exe: installer.nsi + mkdir -p deps + for file in $(DEPENDENCIES); do install "$$file" "deps/$$(basename "$$file")"; done makensis installer.nsi -installer: $(PACKAGE_NAME)-Setup.exe # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/nsis/installer.nsi.in b/nsis/installer.nsi.in index f055455..18a52af 100644 --- a/nsis/installer.nsi.in +++ b/nsis/installer.nsi.in @@ -63,7 +63,7 @@ VIAddVersionKey "FileVersion" "${SETUP_VERSION}" Section "My Application" MyApp SetOutPath $INSTDIR File "..\src\@PACKAGE_NAME@.exe" - ;@DLL_DEPENDENCIES@ + File "deps\*.*" ;File "Readme.txt" WriteUninstaller "$INSTDIR\Uninstall.exe" SectionEnd @@ -72,6 +72,7 @@ SectionEnd ; Uninstaller Sections Section "Uninstall" Delete "$INSTDIR\@PACKAGE_NAME@.exe" + Delete "$INSTDIR\*.dll" Delete "$INSTDIR\Uninstall.exe" RMDir "$INSTDIR" ;DeleteRegKey /ifempty HKCU "Software\Modern UI Test" -- cgit