aboutsummaryrefslogtreecommitdiff
path: root/scripts/bundle.lua
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-12-15 04:17:44 -0500
committerGitHub <[email protected]>2023-12-15 10:17:44 +0100
commitd90c1f24815c036ed3f8c9e34e9aa6dcc7a000f8 (patch)
tree51b6f0f881d378f15b577ff91a0a04c80c402b1b /scripts/bundle.lua
parentchangelog (diff)
downloadzen-d90c1f24815c036ed3f8c9e34e9aa6dcc7a000f8.tar.xz
zen-d90c1f24815c036ed3f8c9e34e9aa6dcc7a000f8.zip
windows executable signing (#566)
Windows executables are now signed with official cert when creating a release
Diffstat (limited to 'scripts/bundle.lua')
-rw-r--r--scripts/bundle.lua30
1 files changed, 28 insertions, 2 deletions
diff --git a/scripts/bundle.lua b/scripts/bundle.lua
index 207122345..7294043ec 100644
--- a/scripts/bundle.lua
+++ b/scripts/bundle.lua
@@ -156,7 +156,7 @@ local function _find_vcpkg_binary(triple, port, binary)
end
--------------------------------------------------------------------------------
-local function main_windows()
+local function main_windows(signidentity)
import("core.base.option")
zip_path = "build/zenserver-win64.zip"
@@ -168,6 +168,31 @@ local function main_windows()
_build("x64", false, config_args)
+ if signidentity == nil or signidentity == "" then
+ print("Skipping signing since no signidentity was given")
+ else
+ program_files_path = os.getenv("PROGRAMFILES(x86)")
+ signtool_path = program_files_path .. "/Windows Kits/10/App Certification Kit/signtool.exe"
+ if not os.isfile(signtool_path) then
+ raise("Failed signing, unable to locate signtool at "..signtool_path)
+ end
+ local ret = _exec(signtool_path,
+ "sign",
+ "/sm",
+ "/a",
+ "/n",
+ signidentity,
+ "/tr",
+ "http://timestamp.digicert.com",
+ "/v",
+ "/as",
+ "build/windows/x64/release/zenserver.exe",
+ "build/windows/x64/release/zen.exe")
+ if ret > 0 then
+ raise("Failed signing zenserver binary")
+ end
+ end
+
local crashpad_handler_path = _find_vcpkg_binary(
"x64-windows-static",
"sentry-native",
@@ -272,7 +297,8 @@ import("core.base.option")
function main()
if is_host("windows") then
- return main_windows()
+ signidentity = option.get("codesignidentity")
+ return main_windows(signidentity)
end
if is_host("mac") then