Skip to content

Commit

Permalink
Merge pull request #13 from safing/feature/improve-signing-support
Browse files Browse the repository at this point in the history
Improve signing support with new build system
  • Loading branch information
ppacher authored Jul 24, 2020
2 parents f1c0bac + 75ccd61 commit 2591e0b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
22 changes: 12 additions & 10 deletions windows/Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
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

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
Expand All @@ -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
Expand Down
12 changes: 5 additions & 7 deletions windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 2591e0b

Please sign in to comment.