Skip to content

Commit c7410fd

Browse files
committed
Working Windows .msi w/ Desktop shortcut to SLIP-39 GUI App
1 parent 3c5e295 commit c7410fd

File tree

2 files changed

+57
-21
lines changed

2 files changed

+57
-21
lines changed

GNUmakefile

Lines changed: 51 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ BUNDLEID ?= ca.kundert.perry.SLIP39
1919
APIISSUER ?= 5f3b4519-83ae-4e01-8d31-f7db26f68290
2020
APIKEY ?= 5H98J7LKPC
2121

22+
# Various cx_Freeze targets are at paths with computed extensions, eg: build/exe.win-amd64-3.10/
23+
CXFREEZE_VER ?= 3.10
24+
CXFREEZE_ARCH ?= amd64
25+
CXFREEZE_EXT ?= win-$(CXFREEZE_ARCH)-$(CXFREEZE_VER)
26+
27+
#SIGNTOOL ?= "/c/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86"
28+
SIGNTOOL ?= "c:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\signtool.exe"
29+
30+
2231
# PY[3] is the target Python interpreter; require 3.9+. Detect if it is named python3 or python.
2332
PY3 ?= $(shell python3 --version >/dev/null 2>&1 && echo python3 || echo python )
2433

@@ -69,9 +78,16 @@ pylint:
6978

7079
build-check:
7180
@$(PY3) -m build --version \
72-
|| ( echo "\n*** Missing Python modules; run:\n\n $(PY3) -m pip install --upgrade pip setuptools wheel build\n" \
73-
&& false )
81+
|| (
82+
echo "\n*** Missing Python modules; run:"; \
83+
echo "\n\n $(PY3) -m pip install --upgrade pip setuptools wheel build\n"; \
84+
false \
85+
)
86+
87+
signing-check:
88+
$(SIGNTOOL)
7489

90+
# Any build dependencies that can't be automatically deduced.
7591
deps: deps-txt
7692

7793
build: clean wheel app
@@ -122,46 +138,61 @@ $(VENV_LOCAL)/$(VENV_NAME)-activate: $(VENV_LOCAL)/$(VENV_NAME)
122138
@bash --init-file $</venv-activate.sh -i
123139

124140

125-
wheel: dist/slip39-$(VERSION)-py3-none-any.whl
141+
wheel: deps dist/slip39-$(VERSION)-py3-none-any.whl
126142

127-
dist/slip39-$(VERSION)-py3-none-any.whl: build-check deps FORCE
143+
dist/slip39-$(VERSION)-py3-none-any.whl: build-check FORCE
128144
$(PY3) -m build
129145
@ls -last dist
130146

131147
# Install from wheel, including all optional extra dependencies
132148
install-dev:
133149
$(PY3) -m pip install --upgrade -r requirements-dev.txt
134150

135-
install: dist/slip39-$(VERSION)-py3-none-any.whl FORCE
151+
install: deps dist/slip39-$(VERSION)-py3-none-any.whl FORCE
136152
$(PY3) -m pip install --force-reinstall $<[gui,dev,serial,wallet]
137153

138154
# Building / Signing / Notarizing and Uploading the macOS App
139155
# o TODO: no signed and notarized package yet accepted for upload by macOS App Store
140-
msi: dist/slip39-$(VERSION)-win64.msi
141-
app: dist/SLIP-39.app
156+
msi: deps dist/slip39-$(VERSION)-win64.msi
157+
app: deps dist/SLIP-39.app
158+
142159
app-packages: app-zip-valid app-dmg-valid app-pkg-valid
143160
app-upload: app-dmg-upload
144161

145162

146163
# Generate, Sign and Package the macOS SLIP-39.app GUI for App Store or local/manual installation
147164
# o Try all the approaches of packaging a macOS App for App Store upload
148-
app-dmg: dist/SLIP-39-$(VERSION).dmg
149-
app-zip: dist/SLIP-39-$(VERSION).zip
150-
app-pkg: dist/SLIP-39-$(VERSION).pkg
165+
app-dmg: deps dist/SLIP-39-$(VERSION).dmg
166+
app-zip: deps dist/SLIP-39-$(VERSION).zip
167+
app-pkg: deps dist/SLIP-39-$(VERSION).pkg
151168

152-
app-dmg-valid: dist/SLIP-39-$(VERSION).dmg.valid
153-
app-zip-valid: dist/SLIP-39-$(VERSION).zip.valid
154-
app-pkg-valid: dist/SLIP-39-$(VERSION).pkg.valid
169+
app-dmg-valid: deps dist/SLIP-39-$(VERSION).dmg.valid
170+
app-zip-valid: deps dist/SLIP-39-$(VERSION).zip.valid
171+
app-pkg-valid: deps dist/SLIP-39-$(VERSION).pkg.valid
155172

156-
app-dmg-upload: dist/SLIP-39-$(VERSION).dmg.upload-package
157-
app-zip-upload: dist/SLIP-39-$(VERSION).zip.upload-package
158-
app-pkg-upload: dist/SLIP-39-$(VERSION).pkg.upload-package
173+
app-dmg-upload: deps dist/SLIP-39-$(VERSION).dmg.upload-package
174+
app-zip-upload: deps dist/SLIP-39-$(VERSION).zip.upload-package
175+
app-pkg-upload: deps dist/SLIP-39-$(VERSION).pkg.upload-package
159176

160177
#
161-
# Build the windows .msi installer
178+
# Build the windows .msi installer. Must build and sign the .exe first
162179
#
163-
dist/slip39-$(VERSION)-win64.msi: deps
164-
$(PY3) setup.py bdist_msi
180+
build/exe.$(CXFREEZE_EXT)/SLIP-39.exe:
181+
echo "\n\n*** Building $@"
182+
@$(PY3) setup.py build_exe > cx_Freeze.build_exe.log \
183+
&& echo "\n\n*** $@ Build successfully:" \
184+
|| ( echo "\n\n!!! $@ Build failed:"; tail -20 cx_Freeze.build_exe.log; false )
185+
186+
dist/slip39-$(VERSION)-win64.msi: build/exe.$(CXFREEZE_EXT)/SLIP-39.exe # signing-check
187+
#echo "\n\n*** Signing $<"
188+
#$(SIGNTOOL) sign /v /t \
189+
# http://timestamp.digicert.com \
190+
# /n "$(DEVID)" \
191+
# $<
192+
echo "\n\n*** Package $@"
193+
@$(PY3) setup.py bdist_msi > $cx_Freeze.bdist_msi.log \
194+
&& echo "\n\n*** $@ Build successfully:" \
195+
|| ( echo "\n\n!!! $@ Build failed:"; tail -20 cx_Freeze.bdist_msi.log; false )
165196

166197
#
167198
# Build the macOS App, and create and sign the .dmg file
@@ -471,8 +502,7 @@ dist/SLIP-39.app-checkids: SLIP-39.spec
471502
# - Find each dependent key, and look at its SHA fingerprint, and then see if you have
472503
# that one in your System keychain, downloading all the named keys from apple 'til
473504
# you find the one with the matching fingerprint. Grr... Repeat 'til check-signature works.
474-
dist/SLIP-39.app: deps \
475-
SLIP-39-macOS.spec \
505+
dist/SLIP-39.app: SLIP-39-macOS.spec \
476506
SLIP-39.metadata/entitlements.plist \
477507
images/SLIP-39.icns
478508
@echo "\n\n*** Rebuilding $@, version $(VERSION)..."

README.org

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,12 @@ by entering the mnemonics right on the device.
12751275
: $ cd src
12761276
: $ git clone [email protected]:pjkundert/python-slip39.git
12771277

1278+
**** Code Signing
1279+
1280+
The MMC (Microsoft Management Console) is used to store your code-signing certificates.
1281+
See [[stackoverflow.com/questions/19879812/signing-exe-with-cer-file-what-is-my-certificates-name-that-signtool-exe-is][stackoverflow.com]] for how to enable its Certificate management.
1282+
1283+
12781284
* Dependencies
12791285

12801286
Internally, python-slip39 project uses Trezor's [[https://gihub.com/trezor/python-shamir-mnemonic.git][python-shamir-mnemonic]] to encode the seed data to

0 commit comments

Comments
 (0)