Skip to content

Commit 70555d0

Browse files
sylveonSaijin-Naib
authored andcommitted
Use copy of signtool from GH runner
Signing was failing because the copy of signtool was too out of date. The GitHub runner includes a newer copy, so update the script to use that
1 parent 99ddf29 commit 70555d0

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

.github/workflows/publish-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
5757
- name: Create setup
5858
run: |
59-
python configure.py dist --azure-signing-metadata "%RUNNER_TEMP%\metadata.json"
59+
python configure.py dist --signtool-path "C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\signtool.exe" --azure-signing-metadata "%RUNNER_TEMP%\metadata.json"
6060
shell: cmd
6161
- name: Upload Setup File
6262
uses: actions/upload-artifact@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ venv/
3535
python312/
3636
dist/
3737
innosetup/
38+
azuresigning/
3839
.DS_Store

configure.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
default='https://github.com/OpenDroneMap/windows-deps/releases/download/2.6.0/vcpkg-export.zip',
3030
required=False,
3131
help='Path to VCPKG export archive')
32+
parser.add_argument('--signtool-path',
33+
type=str,
34+
default='',
35+
required=False,
36+
help='Path to x64 signtool.exe')
3237
parser.add_argument('--code-sign-cert-path',
3338
type=str,
3439
default='',
@@ -175,14 +180,6 @@ def dist():
175180
with zipfile.ZipFile(pythonzip_path) as z:
176181
z.extractall("python312")
177182

178-
# Download signtool
179-
signtool_path = os.path.join("SuperBuild", "download", "signtool.exe")
180-
signtool_url = "https://github.com/OpenDroneMap/windows-deps/releases/download/2.5.0/signtool.exe"
181-
if not os.path.exists(signtool_path):
182-
print("Downloading %s" % signtool_url)
183-
with urllib.request.urlopen(signtool_url) as response, open(signtool_path, 'wb') as out_file:
184-
shutil.copyfileobj(response, out_file)
185-
186183
# Download Artifact Signing Dlib
187184
if args.azure_signing_metadata:
188185
azure_signing_path = os.path.join("SuperBuild", "download", "microsoft.artifactsigning.client.1.0.115.nupkg")
@@ -215,11 +212,12 @@ def dist():
215212

216213
# Run
217214
cs_flags = '/DSKIP_SIGN=1'
218-
if args.azure_signing_metadata:
219-
dlib_path = os.path.join("azuresigning", "bin", "x86", "Azure.CodeSigning.Dlib.dll")
220-
cs_flags = '"/Ssigntool=$q%s$q sign /v /debug /fd SHA256 /tr http://timestamp.acs.microsoft.com /td SHA256 /dlib $q%s$q /dmdf $q%s$q $f"' % (os.path.abspath(signtool_path), os.path.abspath(dlib_path), args.azure_signing_metadata)
221-
elif args.code_sign_cert_path:
222-
cs_flags = '"/Ssigntool=$q%s$q sign /f $q%s$q /fd SHA1 /t http://timestamp.sectigo.com $f"' % (os.path.abspath(signtool_path), args.code_sign_cert_path)
215+
if args.signtool_path:
216+
if args.azure_signing_metadata:
217+
dlib_path = os.path.join("azuresigning", "bin", "x64", "Azure.CodeSigning.Dlib.dll")
218+
cs_flags = '"/Ssigntool=$q%s$q sign /v /debug /fd SHA256 /tr http://timestamp.acs.microsoft.com /td SHA256 /dlib $q%s$q /dmdf $q%s$q $f"' % (os.path.abspath(args.signtool_path), os.path.abspath(dlib_path), args.azure_signing_metadata)
219+
elif args.code_sign_cert_path:
220+
cs_flags = '"/Ssigntool=$q%s$q sign /f $q%s$q /fd SHA1 /t http://timestamp.sectigo.com $f"' % (os.path.abspath(args.signtool_path), args.code_sign_cert_path)
223221
run("innosetup\\iscc /Qp " + cs_flags + " \"innosetup.iss\"")
224222

225223
print("Done! Setup created in dist/")

0 commit comments

Comments
 (0)