mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-18 23:44:59 +01:00
It's options.options in the original so keep it that way
This commit is contained in:
parent
7f25e23878
commit
1585e370d3
@ -2,16 +2,16 @@ const { execFile } = require('child_process');
|
||||
const path = require('path');
|
||||
|
||||
// Loosely based on computeSignToolArgs from app-builder-lib/src/codeSign/windowsCodeSign.ts
|
||||
function computeSignToolArgs(options, keyContainer, inputFile) {
|
||||
function computeSignToolArgs(options, keyContainer) {
|
||||
const args = [];
|
||||
|
||||
if (process.env.ELECTRON_BUILDER_OFFLINE !== "true") {
|
||||
const timestampingServiceUrl = options.timeStampServer || "http://timestamp.digicert.com";
|
||||
const timestampingServiceUrl = options.options.timeStampServer || "http://timestamp.digicert.com";
|
||||
args.push(options.isNest || options.hash === "sha256" ? "/tr" : "/t", options.isNest || options.hash === "sha256" ? (options.options.rfc3161TimeStampServer || "http://timestamp.comodoca.com/rfc3161") : timestampingServiceUrl);
|
||||
}
|
||||
|
||||
// We simplify and just specify the certificate subject name for our purposes
|
||||
args.push('/n', options.certificateSubjectName);
|
||||
args.push('/n', options.options.certificateSubjectName);
|
||||
args.push('/kc', keyContainer);
|
||||
|
||||
if (options.hash !== "sha1") {
|
||||
@ -29,12 +29,12 @@ function computeSignToolArgs(options, keyContainer, inputFile) {
|
||||
// https://github.com/electron-userland/electron-builder/issues/2875#issuecomment-387233610
|
||||
args.push("/debug")
|
||||
// must be last argument
|
||||
args.push(inputFile)
|
||||
args.push(options.path)
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
exports.default = async function(cfg) {
|
||||
exports.default = async function(options) {
|
||||
const keyContainer = process.env.SIGNING_KEY_CONTAINER;
|
||||
if (keyContainer === undefined) {
|
||||
console.warn(
|
||||
@ -46,11 +46,11 @@ exports.default = async function(cfg) {
|
||||
return;
|
||||
}
|
||||
|
||||
const inPath = cfg.path;
|
||||
const inPath = options.path;
|
||||
const appOutDir = path.dirname(inPath);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const args = ['sign'].concat(computeSignToolArgs(cfg.options, keyContainer, cfg.path));
|
||||
const args = ['sign'].concat(computeSignToolArgs(options, keyContainer));
|
||||
|
||||
console.log("Running signtool with args", args);
|
||||
execFile('signtool', args, {}, (error, stdout) => {
|
||||
|
Loading…
Reference in New Issue
Block a user