changeset 1017:1953a7ba4161

add: command to sign executables on windows
author sam <sam@basx.dev>
date Mon, 29 Apr 2024 16:15:20 +0700
parents 2762e6dd5f90
children c066b9a63368
files semicongine/build.nim
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/semicongine/build.nim	Sun Apr 28 17:22:20 2024 +0700
+++ b/semicongine/build.nim	Mon Apr 29 16:15:20 2024 +0700
@@ -177,3 +177,9 @@
     raise newException(Exception, "Unsupported platform")
   let scriptPath = "..".joinPath("..").joinPath(buildscript)
   exec &"./{steamcmd} +login \"{steamaccount}\" \"{password}\" +run_app_build {scriptPath} +quit"
+
+proc semicongine_sign_executable*(file: string) =
+  const SIGNTOOL_EXE = "C:/Program Files (x86)/Windows Kits/10/App Certification Kit/signtool.exe"
+  if not SIGNTOOL_EXE.fileExists:
+    raise newException(Exception, &"signtool.exe not found at ({SIGNTOOL_EXE}), please install the Windows SDK")
+  exec $"{SIGNTOOL_EXE} sign /a /tr http://timestamp.globalsign.com/tsa/r6advanced1 /fd SHA256 /td SHA256 {file}"