diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2019-07-10 17:12:00 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2019-08-05 11:46:12 -0400 |
commit | e635c5b43df0ed6f28c05429dae126d645ac8717 (patch) | |
tree | 5879cb4d24a00a357264196bcb5bf48bd3500bc7 /branding/templates/windows/sign.py | |
parent | 92ea8778813ddffe6187e0ce300638fdefe1bf5e (diff) |
[feat] windows templates
Diffstat (limited to 'branding/templates/windows/sign.py')
-rw-r--r-- | branding/templates/windows/sign.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/branding/templates/windows/sign.py b/branding/templates/windows/sign.py new file mode 100644 index 0000000..5b6b2c6 --- /dev/null +++ b/branding/templates/windows/sign.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +""" +This script is expected to be called from the main makefile, that should pass +the content of the WIN_CERT_PASS variable as the second argument. + +Just make sure that $GOPATH is properly configured. +""" +import subprocess +import os +import sys + +WIN_CERT_PATH = sys.argv[1] +WIN_CERT_PASS = sys.argv[2] +SIGNTOOL = "signtool" + +GOPATH = os.environ.get('GOPATH') +VERSION = subprocess.run( + 'git -C ' + GOPATH + + '\\src\\0xacab.org\\leap\\bitmask-vpn describe --tags', + stdout=subprocess.PIPE).stdout.strip() + +installer = "RiseupVPN-" + str(VERSION, 'utf-8') + '.exe' +target = str(os.path.join(os.path.abspath('.'), 'dist', installer)) +cmd = [SIGNTOOL, "sign", "/f", WIN_CERT_PATH, "/p", WIN_CERT_PASS, target] +subprocess.run(cmd) |