diff --git a/Makefile b/Makefile index c03782a..d45dd50 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ endif # Pytest options: # --resultlog: write test results in file # -s: do not capture stdout/stderr (some tests fail otherwise) -PYTESTOPTS:=--resultlog=testresults.txt -s +PYTESTOPTS:=--resultlog=testresults.txt -s --durations=0 # which test modules to run TESTS ?= tests/ # set test options @@ -130,15 +130,14 @@ doc/$(LAPPNAME).txt: doc/$(LAPPNAME).1 deb: # build a debian package [ -f $(DEBORIGFILE) ] || cp dist/$(ARCHIVE_SOURCE) $(DEBORIGFILE) $(DEBUILDDIR)/$(LAPPNAME)_$(VERSION).orig.tar.gz - sed -i 's/VERSION:=.*/VERSION:=$(VERSION)/' $(DEBUILDDIR)/$(LAPPNAME).mak + sed -i -e 's/VERSION_$(LAPPNAME):=.*/VERSION_$(LAPPNAME):=$(VERSION)/' $(DEBUILDDIR)/$(LAPPNAME).mak [ -d $(DEBPACKAGEDIR) ] || (cd $(DEBUILDDIR); \ patool extract $(DEBORIGFILE); \ cd $(CURDIR); \ git checkout debian; \ cp -r debian $(DEBPACKAGEDIR); \ git checkout master) - rm -f $(DEBUILDDIR)/$(LAPPNAME) - $(MAKE) -C $(DEBUILDDIR) $(LAPPNAME) + $(MAKE) -C $(DEBUILDDIR) $(LAPPNAME)_clean $(LAPPNAME) update-copyright: # update-copyright is a local tool which updates the copyright year for each diff --git a/setup.py b/setup.py index efbdcd3..04ac493 100644 --- a/setup.py +++ b/setup.py @@ -205,13 +205,32 @@ class InnoScript: def sign (self): """Sign InnoSetup installer with local self-signed certificate.""" + print("*** signing the inno setup installer ***") pfxfile = r'C:\patool.pfx' if os.path.isfile(pfxfile): - cmd = ['signtool.exe', 'sign', '/f', pfxfile, self.distfile] - subprocess.check_call(cmd) + path = get_windows_sdk_path() + signtool = os.path.join(path, "bin", "signtool.exe") + if os.path.isfile(signtool): + cmd = [signtool, 'sign', '/f', pfxfile, self.distfile] + subprocess.check_call(cmd) + else: + print("No signed installer: signtool.exe not found.") else: print("No signed installer: certificate %s not found." % pfxfile) +def get_windows_sdk_path(): + """Return path of Microsoft Windows SDK installation, or None if + not found.""" + try: + import _winreg as winreg + except ImportError: + import winreg + sub_key = r"Software\Microsoft\Microsoft SDKs\Windows" + with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, sub_key) as key: + name = "CurrentInstallFolder" + return winreg.QueryValueEx(key, name)[0] + return None + try: from py2exe.build_exe import py2exe as py2exe_build