summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorOwen Rudge <owen@owenrudge.net>2021-05-24 23:03:04 +0100
committerOwen Rudge <owen@owenrudge.net>2021-05-26 13:40:44 +0100
commit3ce7e31f64d86b3ca58be61407a33380cda072b4 (patch)
treec6e65b2e1f07bdfbc898c3b965ffbb5dbb639bb8 /os
parentc96945fa2b0487c7ccd5d7c14399e1b95e60c8c4 (diff)
downloadopenttd-3ce7e31f64d86b3ca58be61407a33380cda072b4.tar.xz
Feature: Sign Windows builds
Diffstat (limited to 'os')
-rw-r--r--os/windows/sign.bat18
1 files changed, 18 insertions, 0 deletions
diff --git a/os/windows/sign.bat b/os/windows/sign.bat
new file mode 100644
index 000000000..0e4291f9b
--- /dev/null
+++ b/os/windows/sign.bat
@@ -0,0 +1,18 @@
+@echo off
+REM Signing script
+REM Arguments: sign.bat exe_to_sign certificate_subject_name
+
+REM This is a loose wrapper around the Microsoft signtool application (included in the Windows SDK).
+REM See https://docs.microsoft.com/en-us/dotnet/framework/tools/signtool-exe for more details.
+
+REM Path to signtool.exe
+IF NOT DEFINED SIGNTOOL_PATH (SET SIGNTOOL_PATH=signtool)
+
+REM URL of the timestamp server
+IF NOT DEFINED SIGNTOOL_TIMESTAMP_URL (SET SIGNTOOL_TIMESTAMP_URL=http://timestamp.digicert.com)
+
+REM Sign with SHA-1 for Windows 7 and below
+"%SIGNTOOL_PATH%" sign -v -n %2 -t %SIGNTOOL_TIMESTAMP_URL% %1
+
+REM Sign with SHA-256 for Windows 8 and above
+"%SIGNTOOL_PATH%" sign -v -n %2 -tr %SIGNTOOL_TIMESTAMP_URL% -fd sha256 -td sha256 -as %1