From 75ccd619abcc6d142f1e87bd407a45c1ffc69a5e Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 24 Jul 2020 14:45:51 +0200 Subject: [PATCH] Improve signing support with new build system --- windows/Makefile | 22 ++++++++++++---------- windows/README.md | 12 +++++------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/windows/Makefile b/windows/Makefile index d55fcfb..275b3e8 100644 --- a/windows/Makefile +++ b/windows/Makefile @@ -1,5 +1,6 @@ -WINE := $(shell command -v wine 2> /dev/null) -STARTURL ?= https://updates.safing.io/latest/windows_amd64/start/portmaster-start.exe\?CI +# Note: Built for execution in container .github/actions/build-nsis + +STARTURL ?= https://updates.safing.io/latest/windows_amd64/start/portmaster-start.exe\?client=Github all: portmaster-uninstaller.exe portmaster-installer.exe @@ -7,15 +8,13 @@ portmaster-start.exe: curl --fail --user-agent GitHub -o portmaster-start.exe $(STARTURL) portmaster-uninstaller.exe: portmaster-installer.nsi install_summary.nsh + echo hi makensis -DUNINSTALLER portmaster-installer.nsi -ifndef WINE - sudo docker run --rm -it -v $(shell pwd):/mnt jamesnetherton/wine /mnt/uninstaller_pkg.exe - sudo chown $(shell id -u)":"$(shell id -g) portmaster-uninstaller.exe uninstaller_pkg.exe -else - # CI support, we have wine available - WINEPREFIX=/tmp wine ./uninstaller_pkg.exe + WINEPREFIX=/tmp wine ./uninstaller_pkg.exe +ifdef SIGN + @echo -e "If wanted, sign now (on Windows) using:\nsign.bat portmaster-uninstaller.exe\npress enter to continue" + @read x endif - #TODO: sign install_summary.nsh: echo -n '$${NSD_SetText} $$0 "' > install_summary.nsh @@ -24,7 +23,10 @@ install_summary.nsh: portmaster-installer.exe: portmaster-start.exe portmaster-installer.nsi portmaster-uninstaller.exe install_summary.nsh makensis -DINSTALLER -DPRODUCTION portmaster-installer.nsi #Production enables good compression (takes longer) - #TODO: sign +ifdef SIGN + @echo -e "If wanted, sign now (on Windows) using:\nsign.bat portmaster-installer.exe\npress enter to continue" + @read x +endif clean: rm -f portmaster-uninstaller.exe diff --git a/windows/README.md b/windows/README.md index 362a1d8..ea48631 100644 --- a/windows/README.md +++ b/windows/README.md @@ -2,10 +2,8 @@ The Windows Installer is built with NSIS. -Here is how: -1. [Linux] download latest portmaster-start: `make portmaster-start.exe` -2. [Linux] build uninstaller: `make portmaster-uninstaller.exe` -3. [Windows] sign uninstaller: `sign.bat portmaster-uninstaller.exe` -4. [Linux] build installer (includes the uninstaller): `make portmaster-installer.exe` -5. [Windows] sign installer: `sign.bat portmaster-uninstaller.exe` -6. copy to dist directory with versioned file name +First, build the container located in `.github/actions/build-nsis`. +Then, just execute `./make`. + +If you want to sign the installer and uninstaller, use `SIGN=yes ./make` instead. +You will need a Windows VM with your signing token and access to the build directory.