Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions apps/desktop/electron-forge/sign-windows.cjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
const child_process = require("child_process");
const fs = require("fs");
const { default: path } = require("path");
const path = require("path");

module.exports = function (filePath) {
const { WINDOWS_SIGN_EXECUTABLE } = process.env;

const stats = fs.lstatSync(filePath);
console.log(filePath, stats);

if (!WINDOWS_SIGN_EXECUTABLE) {
console.warn("[Sign] Skip signing due to missing environment variable.");
return;
Expand All @@ -19,11 +16,15 @@ module.exports = function (filePath) {
fs.mkdirSync(outputDir);
}

fs.copyFileSync(sourcePath, destPath);

const command = `${WINDOWS_SIGN_EXECUTABLE} --executable "${filePath}"`;
console.log(`[Sign] ${command}`);
console.log(`[Sign] Running ${command}`);

try {
child_process.execSync(command);
} catch (e) {
console.warn(`[Sign] Unable to sign ${filePath} due to:\n${e.stdout.toString("utf-8")})}`)
return;
}

const output = child_process.execSync(command);
console.log(`[Sign] ${output}`);
console.log(`[Sign] Signed ${filePath} successfully.`);
}
Loading