Skip to content

Commit

Permalink
Merge pull request #7984 from mook-as/electron-builder/signtool-optio…
Browse files Browse the repository at this point in the history
…ns-moved

packaging: win32: Move signingHashAlgorithms to signtoolOptions
  • Loading branch information
jandubois authored Dec 20, 2024
2 parents f29e500 + c2b02b0 commit 79b417a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packaging/electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ mac:
- { from: dist/electron-builder.yaml, to: electron-builder.yml }
win:
target: [ zip ]
signingHashAlgorithms: [ sha256 ] # We only support Windows 10 + WSL2
signtoolOptions:
signingHashAlgorithms: [ sha256 ] # We only support Windows 10 + WSL2
requestedExecutionLevel: asInvoker # The _app_ doesn't need privileges
extraFiles:
- build/wix/*
Expand Down
7 changes: 4 additions & 3 deletions scripts/lib/sign-win32.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import path from 'path';

import { getSignVendorPath } from 'app-builder-lib/out/codeSign/windowsSignToolManager';
import defaults from 'lodash/defaultsDeep';
import merge from 'lodash/merge';
import yaml from 'yaml';

import { simpleSpawn } from 'scripts/simple_process';
Expand All @@ -21,8 +22,8 @@ type signFileFn = (...filePath: string[]) => Promise<void>;
* when signing the installer.
*/
const REQUIRED_WINDOWS_CONFIG = {
signingHashAlgorithms: ['sha256'],
target: 'zip',
signtoolOptions: { signingHashAlgorithms: ['sha256'] },
target: 'zip',
};

/**
Expand Down Expand Up @@ -66,7 +67,7 @@ export async function sign(workDir: string): Promise<string[]> {

config.win ??= {};
defaults(config.win, DEFAULT_WINDOWS_CONFIG);
Object.assign(config.win, REQUIRED_WINDOWS_CONFIG);
merge(config.win, REQUIRED_WINDOWS_CONFIG);
config.win.certificateSha1 = certFingerprint;

const toolPath = path.join(await getSignVendorPath(), 'windows-10', process.arch, 'signtool.exe');
Expand Down

0 comments on commit 79b417a

Please sign in to comment.