|
|
|
|
@ -9,6 +9,11 @@ function sign(sourcePath) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (path.extname(sourcePath) !== ".exe") {
|
|
|
|
|
console.warn("[Sign] Unsupported extension for signing: ", sourcePath);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const command = `${WINDOWS_SIGN_EXECUTABLE} --executable "${sourcePath}"`;
|
|
|
|
|
console.log(`[Sign] ${command}`);
|
|
|
|
|
@ -16,20 +21,19 @@ function sign(sourcePath) {
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error("[Sign] Got error while signing " + e.output.toString("utf-8"));
|
|
|
|
|
printSigningErrorLogs();
|
|
|
|
|
process.exit(2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function printSigningErrorLogs() {
|
|
|
|
|
const logLocation = path.join(path.dirname(WINDOWS_SIGN_EXECUTABLE), "ev_signer_trilium.err.log");
|
|
|
|
|
const logLocation = path.join(path.dirname(WINDOWS_SIGN_EXECUTABLE), "ev_signer_trilium.err.log");
|
|
|
|
|
|
|
|
|
|
if (!fs.existsSync(logLocation)) {
|
|
|
|
|
console.warn("[Sign] No debug log file found.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!fs.existsSync(logLocation)) {
|
|
|
|
|
console.warn("[Sign] No debug log file found.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const logContent = fs.readFileSync(logLocation, "utf-8");
|
|
|
|
|
console.error("[Sign] Debug log content:\n" + logContent);
|
|
|
|
|
const logContent = fs.readFileSync(logLocation, "utf-8");
|
|
|
|
|
console.error("[Sign] Debug log content:\n" + logContent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module.exports = sign;
|
|
|
|
|
|