forked from Rookout/explorook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsign_windows.js
32 lines (28 loc) · 879 Bytes
/
sign_windows.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const package = require("./package.json");
exports.default = async function(configuration) {
// do not include passwords or other sensitive data in the file
// rather create environment variables with sensitive data
const PE_PATH = configuration.path;
if (PE_PATH.includes(".dll")) {
return true;
}
const CERTIFICATE_PATH = process.env.WINDOWS_EV_CERTIFICATE_PATH;
const GOOGLE_HSM_KEY_ID = process.env.GOOGLE_HSM_KEY_ID;
const command = [
"java", "-jar", "jsign.jar",
"--storetype", "GOOGLE_HSM",
"--gcloudhsmkeyid", GOOGLE_HSM_KEY_ID,
"--tsaurl", "http://timestamp.digicert.com",
"--certfile", CERTIFICATE_PATH,
"--name", `"${configuration.name}"`,
"--url", configuration.site,
"--replace",
`"${PE_PATH}"`,
];
require("child_process").execSync(
command.join(" "),
{
stdio: "inherit",
},
);
};