app-builder-lib 27.0.0-alpha.6 → 27.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts +23 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.js +71 -0
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
- package/dist/configuration.d.ts +42 -5
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/fileMatcher.d.ts +15 -0
- package/dist/fileMatcher.d.ts.map +1 -1
- package/dist/fileMatcher.js +41 -2
- package/dist/fileMatcher.js.map +1 -1
- package/dist/indexInternal.d.ts +2 -1
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +2 -1
- package/dist/indexInternal.js.map +1 -1
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +2 -3
- package/dist/macPackager.js.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.d.ts +11 -1
- package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.js +28 -5
- package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.js +3 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
- package/dist/options/SnapOptions.d.ts +8 -4
- package/dist/options/SnapOptions.d.ts.map +1 -1
- package/dist/options/SnapOptions.js.map +1 -1
- package/dist/options/macOptions.d.ts +17 -7
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +5 -4
- package/dist/options/winOptions.d.ts.map +1 -1
- package/dist/options/winOptions.js.map +1 -1
- package/dist/packager.js +1 -1
- package/dist/packager.js.map +1 -1
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
- package/dist/publish/updateInfoBuilder.js +3 -1
- package/dist/publish/updateInfoBuilder.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +4 -1
- package/dist/targets/linux/FlatpakTarget.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +9 -0
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.d.ts +1 -1
- package/dist/targets/linux/appimage/appImageUtil.js +3 -3
- package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
- package/dist/targets/linux/snap/core24.d.ts +27 -0
- package/dist/targets/linux/snap/core24.d.ts.map +1 -1
- package/dist/targets/linux/snap/core24.js +92 -57
- package/dist/targets/linux/snap/core24.js.map +1 -1
- package/dist/targets/mac/MacTargetHelper.d.ts +12 -2
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
- package/dist/targets/mac/MacTargetHelper.js +20 -11
- package/dist/targets/mac/MacTargetHelper.js.map +1 -1
- package/dist/targets/win/MsiTarget.js +2 -2
- package/dist/targets/win/MsiTarget.js.map +1 -1
- package/dist/toolsets/custom.js +4 -2
- package/dist/toolsets/custom.js.map +1 -1
- package/dist/toolsets/icons.d.ts.map +1 -1
- package/dist/toolsets/icons.js +4 -1
- package/dist/toolsets/icons.js.map +1 -1
- package/dist/util/appFileCopier.d.ts.map +1 -1
- package/dist/util/appFileCopier.js +63 -2
- package/dist/util/appFileCopier.js.map +1 -1
- package/dist/util/electronGet.d.ts +5 -0
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +107 -7
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/packageMetadata.js +46 -21
- package/dist/util/packageMetadata.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +8 -8
- package/scheme.json +36 -10
|
@@ -37,12 +37,35 @@ export interface CertificateFromStoreInfo {
|
|
|
37
37
|
}
|
|
38
38
|
/** Extracts the non-Azure signing config from WindowsConfiguration, or null for Azure/unset/disabled. */
|
|
39
39
|
export declare function getSigntoolFamilyConfig(config: WindowsConfiguration): WindowsSigntoolFamilyConfig | null;
|
|
40
|
+
/**
|
|
41
|
+
* Matches configured publisher names against a certificate subject using the same semantics as
|
|
42
|
+
* electron-updater's update signature verifier (windowsExecutableCodeSignatureVerifier): a name that
|
|
43
|
+
* parses as a Distinguished Name (DN) must match every RDN it specifies against the certificate
|
|
44
|
+
* subject (extra subject RDNs are ignored); otherwise it is compared strictly against the
|
|
45
|
+
* certificate's Common Name (CN). Passes when ANY configured name matches — multiple names are
|
|
46
|
+
* supported for certificate rotation.
|
|
47
|
+
*/
|
|
48
|
+
export declare function publisherNameMatchesCertificate(publisherNames: Array<string>, certInfo: CertificateInfo): boolean;
|
|
40
49
|
export declare abstract class SigntoolBaseSignManager implements SignManager {
|
|
41
50
|
protected readonly packager: WinPackager;
|
|
42
51
|
protected readonly platformSpecificBuildOptions: WindowsConfiguration;
|
|
43
52
|
constructor(packager: WinPackager);
|
|
44
53
|
readonly computedPublisherName: Lazy<string[] | null>;
|
|
45
54
|
readonly lazyCertInfo: MemoLazy<MemoLazy<WindowsConfiguration, FileCodeSigningInfo | CertificateFromStoreInfo | null>, CertificateInfo | null>;
|
|
55
|
+
private readonly explicitPublisherNameValidation;
|
|
56
|
+
/**
|
|
57
|
+
* When `publisherName` is explicitly configured and the subject of the local code signing
|
|
58
|
+
* certificate is known, fail the build if none of the configured names match the certificate.
|
|
59
|
+
* This catches signing with the wrong certificate at build time — otherwise the mismatch only
|
|
60
|
+
* surfaces at update time, when electron-updater rejects every update signed with that
|
|
61
|
+
* certificate.
|
|
62
|
+
*
|
|
63
|
+
* The check is intentionally skipped whenever the actual signing certificate's subject is not
|
|
64
|
+
* genuinely known: custom `sign` hooks, PKCS#11 without an extractable certificate file,
|
|
65
|
+
* x509 certificate files without a CN, or any error while reading certificate info.
|
|
66
|
+
* An explicit `publisherName: null` remains a pure opt-out (nothing to validate).
|
|
67
|
+
*/
|
|
68
|
+
protected validateExplicitPublisherName(): Promise<void>;
|
|
46
69
|
readonly cscInfo: MemoLazy<WindowsConfiguration, FileCodeSigningInfo | CertificateFromStoreInfo | null>;
|
|
47
70
|
initialize(): Promise<void>;
|
|
48
71
|
computePublisherName(target: Target, publisherName: string | null): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signtoolBaseSignManager.d.ts","sourceRoot":"","sources":["../../../src/codeSign/win/signtoolBaseSignManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAW,MAAM,sBAAsB,CAAA;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAEL,oBAAoB,EAEpB,2BAA2B,EAE5B,MAAM,6BAA6B,CAAA;AAIpC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAIpD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAGzD,MAAM,MAAM,iBAAiB,GAAG,CAAC,aAAa,EAAE,kCAAkC,EAAE,QAAQ,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;AAE3H,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED,MAAM,WAAW,mBAAm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,GAAG,KAAK,CAAC,MAAM,CAAC;CAgCvG"}
|
|
@@ -21,6 +21,24 @@ export function getSigntoolFamilyConfig(config) {
|
|
|
21
21
|
}
|
|
22
22
|
return s;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Matches configured publisher names against a certificate subject using the same semantics as
|
|
26
|
+
* electron-updater's update signature verifier (windowsExecutableCodeSignatureVerifier): a name that
|
|
27
|
+
* parses as a Distinguished Name (DN) must match every RDN it specifies against the certificate
|
|
28
|
+
* subject (extra subject RDNs are ignored); otherwise it is compared strictly against the
|
|
29
|
+
* certificate's Common Name (CN). Passes when ANY configured name matches — multiple names are
|
|
30
|
+
* supported for certificate rotation.
|
|
31
|
+
*/
|
|
32
|
+
export function publisherNameMatchesCertificate(publisherNames, certInfo) {
|
|
33
|
+
const subject = parseDn(certInfo.bloodyMicrosoftSubjectDn);
|
|
34
|
+
return publisherNames.some(name => {
|
|
35
|
+
const dn = parseDn(name);
|
|
36
|
+
if (dn.size) {
|
|
37
|
+
return Array.from(dn.keys()).every(key => dn.get(key) === subject.get(key));
|
|
38
|
+
}
|
|
39
|
+
return name === certInfo.commonName;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
24
42
|
export class SigntoolBaseSignManager {
|
|
25
43
|
constructor(packager) {
|
|
26
44
|
this.packager = packager;
|
|
@@ -31,6 +49,7 @@ export class SigntoolBaseSignManager {
|
|
|
31
49
|
return null;
|
|
32
50
|
}
|
|
33
51
|
else if (publisherName != null) {
|
|
52
|
+
await this.explicitPublisherNameValidation.value;
|
|
34
53
|
return asArray(publisherName);
|
|
35
54
|
}
|
|
36
55
|
const certInfo = await this.lazyCertInfo.value;
|
|
@@ -60,6 +79,8 @@ export class SigntoolBaseSignManager {
|
|
|
60
79
|
// Returns null when the CN is absent — caller must set publisherName explicitly.
|
|
61
80
|
return await readCertInfoFromX509(cscFile);
|
|
62
81
|
});
|
|
82
|
+
// Memoized so the check runs once per build even though signFile is invoked once per file.
|
|
83
|
+
this.explicitPublisherNameValidation = new Lazy(() => this.validateExplicitPublisherName());
|
|
63
84
|
this.cscInfo = new MemoLazy(() => this.platformSpecificBuildOptions, platformSpecificBuildOptions => {
|
|
64
85
|
const signing = getSigntoolFamilyConfig(platformSpecificBuildOptions);
|
|
65
86
|
// signtool is the implicit default when win.sign is unset, so an absent config still
|
|
@@ -115,6 +136,53 @@ export class SigntoolBaseSignManager {
|
|
|
115
136
|
});
|
|
116
137
|
this.platformSpecificBuildOptions = packager.platformOptions;
|
|
117
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* When `publisherName` is explicitly configured and the subject of the local code signing
|
|
141
|
+
* certificate is known, fail the build if none of the configured names match the certificate.
|
|
142
|
+
* This catches signing with the wrong certificate at build time — otherwise the mismatch only
|
|
143
|
+
* surfaces at update time, when electron-updater rejects every update signed with that
|
|
144
|
+
* certificate.
|
|
145
|
+
*
|
|
146
|
+
* The check is intentionally skipped whenever the actual signing certificate's subject is not
|
|
147
|
+
* genuinely known: custom `sign` hooks, PKCS#11 without an extractable certificate file,
|
|
148
|
+
* x509 certificate files without a CN, or any error while reading certificate info.
|
|
149
|
+
* An explicit `publisherName: null` remains a pure opt-out (nothing to validate).
|
|
150
|
+
*/
|
|
151
|
+
async validateExplicitPublisherName() {
|
|
152
|
+
const signing = getSigntoolFamilyConfig(this.platformSpecificBuildOptions);
|
|
153
|
+
const publisherName = signing?.publisherName;
|
|
154
|
+
if (publisherName == null) {
|
|
155
|
+
// not configured (auto-derive) or explicit `null` opt-out — nothing to validate
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (signing?.sign != null) {
|
|
159
|
+
// custom sign hook: electron-builder does not know which certificate the hook actually signs with
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const publisherNames = asArray(publisherName);
|
|
163
|
+
if (publisherNames.length === 0) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
let certInfo;
|
|
167
|
+
try {
|
|
168
|
+
certInfo = await this.lazyCertInfo.value;
|
|
169
|
+
}
|
|
170
|
+
catch (e) {
|
|
171
|
+
// this check must only fire when the signing certificate's subject is genuinely known
|
|
172
|
+
log.debug({ error: e.message || e }, "skipping publisherName validation against the signing certificate (cannot read certificate info)");
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (certInfo == null) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (!publisherNameMatchesCertificate(publisherNames, certInfo)) {
|
|
179
|
+
throw new InvalidConfigurationError(`The configured publisherName does not match the subject of the code signing certificate. ` +
|
|
180
|
+
`This usually means the build is signing with the wrong certificate (for example, a code signing certificate for another platform or team leaked into WIN_CSC_LINK/CSC_LINK in CI) — electron-updater would reject every update signed with it.\n` +
|
|
181
|
+
` Configured publisherName: ${publisherNames.join(" | ")}\n` +
|
|
182
|
+
` Certificate subject: ${certInfo.bloodyMicrosoftSubjectDn}\n` +
|
|
183
|
+
`Fix win.publisherName (or sign with the intended certificate). To opt out of update signature verification entirely, set publisherName to null.`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
118
186
|
initialize() {
|
|
119
187
|
return Promise.resolve();
|
|
120
188
|
}
|
|
@@ -179,6 +247,9 @@ export class SigntoolBaseSignManager {
|
|
|
179
247
|
};
|
|
180
248
|
}
|
|
181
249
|
log.info(logInfo, "signing");
|
|
250
|
+
// validate an explicitly configured publisherName against the signing certificate before the
|
|
251
|
+
// first file is signed, so a wrong-certificate build fails even when no publish config exists
|
|
252
|
+
await this.explicitPublisherNameValidation.value;
|
|
182
253
|
}
|
|
183
254
|
else if (this.handleNullCscInfo(customSign)) {
|
|
184
255
|
log.debug({ signHook: !!customSign, cscInfo }, "no signing info identified, signing is skipped");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signtoolBaseSignManager.js","sourceRoot":"","sources":["../../../src/codeSign/win/signtoolBaseSignManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,GAAG,E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CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;QAC/B,CAAC;QAED,mBAAmB;QACnB,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAA;QAEjD,iBAAiB;QACjB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;QAE3C,mEAAmE;QACnE,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAA;QAEnD,gBAAgB;QAChB,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAA;QAC1C,IAAI,UAAU,EAAE,MAAM,EAAE,CAAC;YACvB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;QAC7B,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["import { asArray, InvalidConfigurationError, log, retry } from \"builder-util\"\nimport { MemoLazy, parseDn } from \"builder-util-runtime\"\nimport _fsExtra from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { Target } from \"../../core.js\"\nimport {\n resolveWindowsSigningConfiguration,\n WindowsConfiguration,\n WindowsHsmSigningConfig,\n WindowsSigntoolFamilyConfig,\n WindowsSigntoolSigningConfig,\n} from \"../../options/winOptions.js\"\nimport AppXTarget from \"../../targets/win/AppxTarget.js\"\nimport MsixTarget from \"../../targets/win/MsixTarget.js\"\nimport { getSignToolPath } from \"../../toolsets/winCodeSign.js\"\nimport { ToolInfo } from \"../../util/bundledTool.js\"\nimport { resolveFunction } from \"../../util/resolve.js\"\nimport { withSigntoolLock } from \"../../util/toolsetLock.js\"\nimport { readCertInfo, readCertInfoFromX509 } from \"../certInfo.js\"\nimport { VmManager } from \"../../vm/vm.js\"\nimport type { WinPackager } from \"../../winPackager.js\"\nimport { importCertificate } from \"../codesign.js\"\nimport type { SignManager } from \"./signManager.js\"\nimport { WindowsSignOptions } from \"./windowsCodeSign.js\"\nconst { rename } = _fsExtra\n\nexport type CustomWindowsSign = (configuration: CustomWindowsSignTaskConfiguration, packager?: WinPackager) => Promise<any>\n\nexport interface WindowsSignToolOptions extends WindowsSignOptions {\n readonly name: string\n readonly site: string | null\n}\n\nexport interface FileCodeSigningInfo {\n readonly file: string\n readonly password: string | null\n}\n\nexport interface WindowsSignTaskConfiguration extends WindowsSignToolOptions {\n readonly cscInfo: FileCodeSigningInfo | CertificateFromStoreInfo | null\n\n // set if output path differs from input (e.g. osslsigncode cannot sign file in-place)\n resultOutputPath?: string\n\n hash: string\n isNest: boolean\n}\n\nexport interface CustomWindowsSignTaskConfiguration extends WindowsSignTaskConfiguration {\n computeSignToolArgs(isWin: boolean): Array<string>\n}\n\nexport interface CertificateInfo {\n readonly commonName: string\n readonly bloodyMicrosoftSubjectDn: string\n}\n\nexport interface CertificateFromStoreInfo {\n thumbprint: string\n subject: string\n store: string\n isLocalMachineStore: boolean\n}\n\ninterface CertInfo {\n Subject: string\n Thumbprint: string\n PSParentPath: string\n}\n\n/** Extracts the non-Azure signing config from WindowsConfiguration, or null for Azure/unset/disabled. */\nexport function getSigntoolFamilyConfig(config: WindowsConfiguration): WindowsSigntoolFamilyConfig | null {\n const s = resolveWindowsSigningConfiguration(config)\n if (s == null || s.type === \"azure\") {\n return null\n }\n return s\n}\n\nexport abstract class SigntoolBaseSignManager implements SignManager {\n protected readonly platformSpecificBuildOptions: WindowsConfiguration\n\n constructor(protected readonly packager: WinPackager) {\n this.platformSpecificBuildOptions = packager.platformOptions\n }\n\n readonly computedPublisherName = new Lazy<Array<string> | null>(async () => {\n const signing = getSigntoolFamilyConfig(this.platformSpecificBuildOptions)\n const publisherName = signing?.publisherName\n if (publisherName === null) {\n return null\n } else if (publisherName != null) {\n return asArray(publisherName)\n }\n\n const certInfo = await this.lazyCertInfo.value\n return certInfo == null ? null : [certInfo.commonName]\n })\n\n readonly lazyCertInfo = new MemoLazy<MemoLazy<WindowsConfiguration, FileCodeSigningInfo | CertificateFromStoreInfo | null>, CertificateInfo | null>(\n () => this.cscInfo,\n async csc => {\n const cscInfo = await csc.value\n if (cscInfo == null) {\n return null\n }\n\n if (\"subject\" in cscInfo) {\n const bloodyMicrosoftSubjectDn = cscInfo.subject\n return {\n commonName: parseDn(bloodyMicrosoftSubjectDn).get(\"CN\")!,\n bloodyMicrosoftSubjectDn,\n }\n }\n\n const cscFile = cscInfo.file\n if (cscFile == null) {\n return null\n }\n\n const certExt = path.extname(cscFile).toLowerCase()\n if (certExt === \".p12\" || certExt === \".pfx\") {\n return await this.getCertInfo(cscFile, cscInfo.password || \"\")\n }\n // Non-PKCS12 files (.crt, .cer): parse as plain X.509.\n // Returns null when the CN is absent — caller must set publisherName explicitly.\n return await readCertInfoFromX509(cscFile)\n }\n )\n\n readonly cscInfo = new MemoLazy<WindowsConfiguration, FileCodeSigningInfo | CertificateFromStoreInfo | null>(\n () => this.platformSpecificBuildOptions,\n platformSpecificBuildOptions => {\n const signing = getSigntoolFamilyConfig(platformSpecificBuildOptions)\n // signtool is the implicit default when win.sign is unset, so an absent config still\n // honours the WIN_CSC_LINK/cscLink fallback below (hsm/pkcs11 set signing.type explicitly).\n const isSigntool = signing == null || signing.type === \"signtool\"\n\n // signtool + hsm: store-based cert takes priority\n const subjectName = (signing as WindowsSigntoolSigningConfig | WindowsHsmSigningConfig | null)?.certificateSubjectName\n const shaType = (signing as WindowsSigntoolSigningConfig | WindowsHsmSigningConfig | null)?.certificateSha1\n if (subjectName != null || shaType != null) {\n return this.packager.vm.value\n .then(vm => this.getCertificateFromStoreInfo(platformSpecificBuildOptions, vm))\n .catch((e: any) => {\n // https://github.com/electron-userland/electron-builder/pull/2397\n if (signing?.sign == null) {\n throw e\n } else {\n log.debug({ error: e }, \"getCertificateFromStoreInfo error\")\n return null\n }\n })\n }\n\n const certificateFile = signing?.certificateFile\n if (certificateFile != null) {\n // Only signtool mode uses a password (HSM private key lives in the HSM, not the cert file)\n const certificatePassword = isSigntool ? this.packager.getCscPassword() : null\n return Promise.resolve({\n file: certificateFile,\n password: certificatePassword == null ? null : certificatePassword.trim(),\n })\n }\n\n // WIN_CSC_LINK env var fallback: only for signtool mode (including the implicit default)\n if (isSigntool) {\n const cscLink = this.packager.getCscLink(\"WIN_CSC_LINK\")\n if (cscLink == null || cscLink === \"\") {\n return Promise.resolve(null)\n }\n\n return importCertificate(cscLink, this.packager.tempDirManager, this.packager.projectDir)\n .catch((e: any) => {\n if (e instanceof InvalidConfigurationError) {\n throw new InvalidConfigurationError(`Env WIN_CSC_LINK is not correct, cannot resolve: ${e.message}`)\n } else {\n throw e\n }\n })\n .then(p => ({\n file: p,\n password: this.packager.getCscPassword(),\n }))\n }\n\n return Promise.resolve(null)\n }\n )\n\n initialize(): Promise<void> {\n return Promise.resolve()\n }\n\n // https://github.com/electron-userland/electron-builder/issues/2108#issuecomment-333200711\n async computePublisherName(target: Target, publisherName: string | null) {\n if ((target instanceof AppXTarget || target instanceof MsixTarget) && (await this.cscInfo.value) == null) {\n log.info({ reason: \"Windows Store only build\" }, \"AppX/MSIX package is not signed\")\n return publisherName ?? \"CN=ms\"\n }\n\n // When a signing cert is available, the cert's subject MUST be used so the APPX package\n // Publisher attribute matches the certificate — any mismatch causes SignerSign to fail with\n // ERROR_BAD_FORMAT. Only honour a user-supplied publisherName if it was explicitly configured\n // (non-null); otherwise derive from the certificate.\n const certInfo = await this.lazyCertInfo.value\n const publisher = publisherName ?? certInfo?.bloodyMicrosoftSubjectDn ?? null\n if (publisher == null) {\n throw new Error(\"Internal error: cannot compute subject using certificate info\")\n }\n return publisher\n }\n\n /**\n * Called when cscInfo is null. Returns true to skip signing, false to proceed, or throws.\n * Override in subclasses with different null-cert behaviour (HSM throws, PKCS#11 proceeds).\n */\n protected handleNullCscInfo(customSign: CustomWindowsSign | string | null | undefined): boolean {\n return !customSign // default: skip when no cert and no custom sign hook\n }\n\n async signFile(options: WindowsSignOptions): Promise<boolean> {\n const signing = getSigntoolFamilyConfig(options.options)\n let hashes = signing?.signingHashAlgorithms\n // msi does not support dual-signing\n if (options.path.endsWith(\".msi\")) {\n hashes = [hashes != null && !hashes.includes(\"sha1\") ? \"sha256\" : \"sha1\"]\n } else if (options.path.endsWith(\".appx\") || options.path.endsWith(\".msix\") || options.path.endsWith(\".msixbundle\")) {\n hashes = [\"sha256\"]\n } else if (hashes == null) {\n hashes = [\"sha1\", \"sha256\"]\n } else {\n hashes = Array.isArray(hashes) ? hashes : [hashes]\n }\n\n const name = this.packager.appInfo.productName\n const site = await this.packager.appInfo.computePackageUrl()\n\n const customSign = await resolveFunction(this.packager.appInfo.type, signing?.sign, \"sign\", await this.packager.getWorkspaceRoot())\n\n const cscInfo = await this.cscInfo.value\n\n if (cscInfo) {\n let logInfo: any = {\n file: log.filePath(options.path),\n }\n if (\"file\" in cscInfo) {\n logInfo = { ...logInfo, certificateFile: cscInfo.file }\n } else {\n logInfo = {\n ...logInfo,\n subject: cscInfo.subject,\n thumbprint: cscInfo.thumbprint,\n store: cscInfo.store,\n user: cscInfo.isLocalMachineStore ? \"local machine\" : \"current user\",\n }\n }\n log.info(logInfo, \"signing\")\n } else if (this.handleNullCscInfo(customSign)) {\n log.debug({ signHook: !!customSign, cscInfo }, \"no signing info identified, signing is skipped\")\n return false\n }\n\n const executor = customSign || ((config: CustomWindowsSignTaskConfiguration, packager: WinPackager) => this.doSign(config, packager))\n let isNest = false\n for (const hash of hashes) {\n const taskConfiguration: WindowsSignTaskConfiguration = { ...options, name, site, cscInfo, hash, isNest }\n await Promise.resolve(\n executor(\n {\n ...taskConfiguration,\n computeSignToolArgs: isWin => this.computeSignToolArgs(taskConfiguration, isWin),\n },\n this.packager\n )\n )\n isNest = true\n if (taskConfiguration.resultOutputPath != null) {\n await rename(taskConfiguration.resultOutputPath, options.path)\n }\n }\n\n return true\n }\n\n async getCertInfo(file: string, password: string): Promise<CertificateInfo> {\n const errorMessagePrefix = \"Cannot extract publisher name from code signing certificate. As workaround, set win.publisherName. Error: \"\n try {\n return await readCertInfo(file, password)\n } catch (e: any) {\n throw new InvalidConfigurationError(`${errorMessagePrefix}${e.message || e}`)\n }\n }\n\n // on windows be aware of http://stackoverflow.com/a/32640183/1910191\n computeSignToolArgs(options: WindowsSignTaskConfiguration, isWin: boolean, vm: VmManager = new VmManager()): Array<string> {\n return isWin ? this.computeWindowsSignArgs(options, vm) : this.computeOsslsigncodeArgs(options, vm)\n }\n\n protected isLegacyToolset(): boolean {\n const v = this.packager.config.toolsets?.winCodeSign\n // Only an explicit \"0.0.0\" pin is legacy; unset / null / \"latest\" / custom now resolve to a modern bundle.\n return v === \"0.0.0\"\n }\n\n protected abstract computeWindowsSignArgs(options: WindowsSignTaskConfiguration, vm: VmManager): Array<string>\n protected abstract computeOsslsigncodeArgs(options: WindowsSignTaskConfiguration, vm: VmManager): Array<string>\n\n // allowX509: set to true by HsmSignManager to permit .crt/.cer (public chain only, key is in HSM).\n protected addCertificateArgs(args: Array<string>, options: WindowsSignTaskConfiguration, vm: VmManager, isWin: boolean, allowX509 = false): void {\n if (options.cscInfo == null) {\n throw new Error(\"No code signing certificate configured. Provide certificateFile, certificateSha1, or certificateSubjectName.\")\n }\n const certificateFile = (options.cscInfo as FileCodeSigningInfo).file\n\n if (certificateFile == null) {\n // Certificate from store (Windows only)\n if (!isWin) {\n throw new Error(\"certificateSha1/certificateSubjectName supported only on Windows\")\n }\n\n const cscInfo = options.cscInfo as CertificateFromStoreInfo\n args.push(\"/sha1\", cscInfo.thumbprint)\n args.push(\"/s\", cscInfo.store)\n if (cscInfo.isLocalMachineStore) {\n args.push(\"/sm\")\n }\n } else {\n const certExtension = path.extname(certificateFile).toLowerCase()\n\n if (certExtension === \".p12\" || certExtension === \".pfx\") {\n args.push(isWin ? \"/f\" : \"-pkcs12\", vm.toVmFile(certificateFile))\n } else if (isWin && allowX509 && (certExtension === \".crt\" || certExtension === \".cer\")) {\n args.push(\"/f\", vm.toVmFile(certificateFile))\n } else {\n throw new InvalidConfigurationError(`Please specify pkcs12 (.p12/.pfx) file, ${certificateFile} is not correct`)\n }\n }\n }\n\n protected addCommonSigningArgs(args: Array<string>, options: WindowsSignTaskConfiguration, vm: VmManager, isWin: boolean): void {\n if (options.name) {\n args.push(isWin ? \"/d\" : \"-n\", options.name)\n }\n\n if (options.site) {\n args.push(isWin ? \"/du\" : \"-i\", options.site)\n }\n\n if (options.isNest) {\n args.push(isWin ? \"/as\" : \"-nest\")\n }\n\n const password = (options.cscInfo as FileCodeSigningInfo)?.password\n if (password) {\n args.push(isWin ? \"/p\" : \"-pass\", password)\n }\n\n const signing = getSigntoolFamilyConfig(options.options)\n const additionalCert = signing?.additionalCertificateFile\n if (additionalCert) {\n args.push(isWin ? \"/ac\" : \"-ac\", vm.toVmFile(additionalCert))\n }\n }\n\n getOutputPath(inputPath: string, hash: string) {\n const extension = path.extname(inputPath)\n return path.join(path.dirname(inputPath), `${path.basename(inputPath, extension)}-signed-${hash}${extension}`)\n }\n\n async getCertificateFromStoreInfo(options: WindowsConfiguration, vm: VmManager): Promise<CertificateFromStoreInfo> {\n const signing = getSigntoolFamilyConfig(options) as WindowsSigntoolSigningConfig | WindowsHsmSigningConfig | null\n const certificateSubjectName = signing?.certificateSubjectName\n const certificateSha1 = signing?.certificateSha1?.toUpperCase()\n\n const ps = await vm.powershellCommand.value\n const rawResult = await vm.exec(ps, [\n \"-NoProfile\",\n \"-NonInteractive\",\n \"-Command\",\n \"Get-ChildItem -Recurse Cert: -CodeSigningCert | Select-Object -Property Subject,PSParentPath,Thumbprint | ConvertTo-Json -Compress\",\n ])\n const certList = rawResult.length === 0 ? [] : asArray<CertInfo>(JSON.parse(rawResult))\n for (const certInfo of certList) {\n if (\n (certificateSubjectName != null && !certInfo.Subject.includes(certificateSubjectName)) ||\n (certificateSha1 != null && certInfo.Thumbprint.toUpperCase() !== certificateSha1)\n ) {\n continue\n }\n\n const parentPath = certInfo.PSParentPath\n const store = parentPath.substring(parentPath.lastIndexOf(\"\\\\\") + 1)\n log.debug({ store, PSParentPath: parentPath }, \"auto-detect certificate store\")\n // https://github.com/electron-userland/electron-builder/issues/1717\n const isLocalMachineStore = parentPath.includes(\"Certificate::LocalMachine\")\n log.debug(null, \"auto-detect using of LocalMachine store\")\n return {\n thumbprint: certInfo.Thumbprint,\n subject: certInfo.Subject,\n store,\n isLocalMachineStore,\n }\n }\n\n throw new Error(`Cannot find certificate ${certificateSubjectName || certificateSha1}, all certs: ${rawResult}`)\n }\n\n async getToolPath(isWin = process.platform === \"win32\"): Promise<ToolInfo> {\n return getSignToolPath(this.packager.config.toolsets?.winCodeSign, isWin, this.packager.buildResourcesDir)\n }\n\n async doSign(configuration: CustomWindowsSignTaskConfiguration, packager: WinPackager) {\n // https://github.com/electron-userland/electron-builder/pull/1944\n const timeout = parseInt(process.env.SIGNTOOL_TIMEOUT as any, 10) || 10 * 60 * 1000\n let args: Array<string>\n let vm: VmManager\n // cscInfo can be null (e.g. PKCS#11 with no cert file); guard before using `in`.\n // CertificateFromStoreInfo (no `file` property) requires a Windows VM for cert-store lookup.\n const cscInfo = configuration.cscInfo\n const useVmIfNotOnWin = configuration.path.endsWith(\".appx\") || (cscInfo != null && !(\"file\" in cscInfo))\n const isWin = process.platform === \"win32\" || useVmIfNotOnWin\n const toolInfo = await getSignToolPath(this.packager.config.toolsets?.winCodeSign, isWin, this.packager.buildResourcesDir)\n const tool = toolInfo.path\n if (useVmIfNotOnWin) {\n vm = await packager.vm.value\n args = this.computeSignToolArgs(configuration, isWin, vm)\n } else {\n vm = new VmManager()\n args = configuration.computeSignToolArgs(isWin)\n }\n\n // signtool.exe (`/f`) is not safe to run concurrently — it races on the shared per-user crypto store.\n // Serialize real-Windows signtool invocations across processes; osslsigncode (`!isWin`) is file-isolated.\n const execSign = () => vm.exec(tool, args, { timeout, env: { ...process.env, ...(toolInfo.env || {}) } })\n await retry(() => (isWin ? withSigntoolLock(execSign) : execSign()), {\n retries: 2,\n interval: 15000,\n backoff: 10000,\n shouldRetry: (e: any) => {\n if (\n e.message.includes(\"The file is being used by another process\") ||\n e.message.includes(\"The specified timestamp server either could not be reached\") ||\n e.message.includes(\"No certificates were found that met all the given criteria.\") ||\n // Transient failure of SignerSignEx after cert selection, typically a concurrent-signtool race\n // on the per-user crypto store; the cross-process lock above makes this rare, retry covers the rest.\n e.message.includes(\"An error occurred while attempting to load the signing certificate\")\n ) {\n log.warn(`Attempt to code sign failed, another attempt will be made in 15 seconds: ${e.message}`)\n return true\n }\n return false\n },\n })\n }\n}\n\nexport class SigntoolSignManager extends SigntoolBaseSignManager {\n protected computeWindowsSignArgs(options: WindowsSignTaskConfiguration, vm: VmManager): Array<string> {\n const signing = getSigntoolFamilyConfig(options.options)\n\n const inputFile = vm.toVmFile(options.path)\n const args = [\"sign\"]\n\n // Timestamping\n if (process.env.ELECTRON_BUILDER_OFFLINE !== \"true\") {\n const isRfc3161 = options.isNest || options.hash === \"sha256\"\n args.push(isRfc3161 ? \"/tr\" : \"/t\")\n const timestampUrl = isRfc3161 ? signing?.rfc3161TimeStampServer || \"http://timestamp.digicert.com\" : signing?.timeStampServer || \"http://timestamp.digicert.com\"\n args.push(timestampUrl)\n }\n\n // Certificate\n this.addCertificateArgs(args, options, vm, true)\n\n // Hash algorithm\n if (this.isLegacyToolset()) {\n // Legacy v0.0.0: Only add /fd for non-SHA1 (original behavior)\n if (options.hash !== \"sha1\") {\n args.push(\"/fd\", options.hash)\n if (process.env.ELECTRON_BUILDER_OFFLINE !== \"true\") {\n args.push(\"/td\", \"sha256\")\n }\n }\n } else {\n // Modern: Always add /fd (required by new Windows Kits)\n args.push(\"/fd\", options.hash.toLowerCase())\n // Only add /td for RFC3161 timestamps (incompatible with /t)\n if (process.env.ELECTRON_BUILDER_OFFLINE !== \"true\" && (options.isNest || options.hash === \"sha256\")) {\n args.push(\"/td\", \"sha256\")\n }\n }\n\n // Optional parameters\n this.addCommonSigningArgs(args, options, vm, true)\n\n // Windows-specific\n args.push(\"/debug\")\n args.push(inputFile) // Must be last\n\n return args\n }\n\n protected computeOsslsigncodeArgs(options: WindowsSignTaskConfiguration, vm: VmManager): Array<string> {\n const signing = getSigntoolFamilyConfig(options.options)\n\n const inputFile = vm.toVmFile(options.path)\n const outputPath = this.getOutputPath(inputFile, options.hash)\n options.resultOutputPath = outputPath\n\n const args = [\"sign\", \"-in\", inputFile, \"-out\", outputPath]\n\n // Timestamping\n if (process.env.ELECTRON_BUILDER_OFFLINE !== \"true\") {\n const timestampUrl = signing?.timeStampServer || \"http://timestamp.digicert.com\"\n args.push(\"-t\", timestampUrl)\n }\n\n // Certificate file\n this.addCertificateArgs(args, options, vm, false)\n\n // Hash algorithm\n args.push(\"-h\", options.hash.toLowerCase())\n\n // Optional parameters (name, site, nest, password, additionalCert)\n this.addCommonSigningArgs(args, options, vm, false)\n\n // Proxy support\n const httpsProxy = process.env.HTTPS_PROXY\n if (httpsProxy?.length) {\n args.push(\"-p\", httpsProxy)\n }\n\n return args\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"signtoolBaseSignManager.js","sourceRoot":"","sources":["../../../src/codeSign/win/signtoolBaseSignManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EACL,kCAAkC,GAKnC,MAAM,6BAA6B,CAAA;AACpC,OAAO,UAAU,MAAM,iCAAiC,CAAA;AACxD,OAAO,UAAU,MAAM,iCAAiC,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe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C,gBAAgB,GAAG,UAAU,CAAA;QAErC,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,CAAA;QAE3D,eAAe;QACf,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,KAAK,MAAM,EAAE,CAAC;YACpD,MAAM,YAAY,GAAG,OAAO,EAAE,eAAe,IAAI,+BAA+B,CAAA;YAChF,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;QAC/B,CAAC;QAED,mBAAmB;QACnB,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAA;QAEjD,iBAAiB;QACjB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;QAE3C,mEAAmE;QACnE,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAA;QAEnD,gBAAgB;QAChB,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAA;QAC1C,IAAI,UAAU,EAAE,MAAM,EAAE,CAAC;YACvB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;QAC7B,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["import { asArray, InvalidConfigurationError, log, retry } from \"builder-util\"\nimport { MemoLazy, parseDn } from \"builder-util-runtime\"\nimport _fsExtra from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { Target } from \"../../core.js\"\nimport {\n resolveWindowsSigningConfiguration,\n WindowsConfiguration,\n WindowsHsmSigningConfig,\n WindowsSigntoolFamilyConfig,\n WindowsSigntoolSigningConfig,\n} from \"../../options/winOptions.js\"\nimport AppXTarget from \"../../targets/win/AppxTarget.js\"\nimport MsixTarget from \"../../targets/win/MsixTarget.js\"\nimport { getSignToolPath } from \"../../toolsets/winCodeSign.js\"\nimport { ToolInfo } from \"../../util/bundledTool.js\"\nimport { resolveFunction } from \"../../util/resolve.js\"\nimport { withSigntoolLock } from \"../../util/toolsetLock.js\"\nimport { readCertInfo, readCertInfoFromX509 } from \"../certInfo.js\"\nimport { VmManager } from \"../../vm/vm.js\"\nimport type { WinPackager } from \"../../winPackager.js\"\nimport { importCertificate } from \"../codesign.js\"\nimport type { SignManager } from \"./signManager.js\"\nimport { WindowsSignOptions } from \"./windowsCodeSign.js\"\nconst { rename } = _fsExtra\n\nexport type CustomWindowsSign = (configuration: CustomWindowsSignTaskConfiguration, packager?: WinPackager) => Promise<any>\n\nexport interface WindowsSignToolOptions extends WindowsSignOptions {\n readonly name: string\n readonly site: string | null\n}\n\nexport interface FileCodeSigningInfo {\n readonly file: string\n readonly password: string | null\n}\n\nexport interface WindowsSignTaskConfiguration extends WindowsSignToolOptions {\n readonly cscInfo: FileCodeSigningInfo | CertificateFromStoreInfo | null\n\n // set if output path differs from input (e.g. osslsigncode cannot sign file in-place)\n resultOutputPath?: string\n\n hash: string\n isNest: boolean\n}\n\nexport interface CustomWindowsSignTaskConfiguration extends WindowsSignTaskConfiguration {\n computeSignToolArgs(isWin: boolean): Array<string>\n}\n\nexport interface CertificateInfo {\n readonly commonName: string\n readonly bloodyMicrosoftSubjectDn: string\n}\n\nexport interface CertificateFromStoreInfo {\n thumbprint: string\n subject: string\n store: string\n isLocalMachineStore: boolean\n}\n\ninterface CertInfo {\n Subject: string\n Thumbprint: string\n PSParentPath: string\n}\n\n/** Extracts the non-Azure signing config from WindowsConfiguration, or null for Azure/unset/disabled. */\nexport function getSigntoolFamilyConfig(config: WindowsConfiguration): WindowsSigntoolFamilyConfig | null {\n const s = resolveWindowsSigningConfiguration(config)\n if (s == null || s.type === \"azure\") {\n return null\n }\n return s\n}\n\n/**\n * Matches configured publisher names against a certificate subject using the same semantics as\n * electron-updater's update signature verifier (windowsExecutableCodeSignatureVerifier): a name that\n * parses as a Distinguished Name (DN) must match every RDN it specifies against the certificate\n * subject (extra subject RDNs are ignored); otherwise it is compared strictly against the\n * certificate's Common Name (CN). Passes when ANY configured name matches — multiple names are\n * supported for certificate rotation.\n */\nexport function publisherNameMatchesCertificate(publisherNames: Array<string>, certInfo: CertificateInfo): boolean {\n const subject = parseDn(certInfo.bloodyMicrosoftSubjectDn)\n return publisherNames.some(name => {\n const dn = parseDn(name)\n if (dn.size) {\n return Array.from(dn.keys()).every(key => dn.get(key) === subject.get(key))\n }\n return name === certInfo.commonName\n })\n}\n\nexport abstract class SigntoolBaseSignManager implements SignManager {\n protected readonly platformSpecificBuildOptions: WindowsConfiguration\n\n constructor(protected readonly packager: WinPackager) {\n this.platformSpecificBuildOptions = packager.platformOptions\n }\n\n readonly computedPublisherName = new Lazy<Array<string> | null>(async () => {\n const signing = getSigntoolFamilyConfig(this.platformSpecificBuildOptions)\n const publisherName = signing?.publisherName\n if (publisherName === null) {\n return null\n } else if (publisherName != null) {\n await this.explicitPublisherNameValidation.value\n return asArray(publisherName)\n }\n\n const certInfo = await this.lazyCertInfo.value\n return certInfo == null ? null : [certInfo.commonName]\n })\n\n readonly lazyCertInfo = new MemoLazy<MemoLazy<WindowsConfiguration, FileCodeSigningInfo | CertificateFromStoreInfo | null>, CertificateInfo | null>(\n () => this.cscInfo,\n async csc => {\n const cscInfo = await csc.value\n if (cscInfo == null) {\n return null\n }\n\n if (\"subject\" in cscInfo) {\n const bloodyMicrosoftSubjectDn = cscInfo.subject\n return {\n commonName: parseDn(bloodyMicrosoftSubjectDn).get(\"CN\")!,\n bloodyMicrosoftSubjectDn,\n }\n }\n\n const cscFile = cscInfo.file\n if (cscFile == null) {\n return null\n }\n\n const certExt = path.extname(cscFile).toLowerCase()\n if (certExt === \".p12\" || certExt === \".pfx\") {\n return await this.getCertInfo(cscFile, cscInfo.password || \"\")\n }\n // Non-PKCS12 files (.crt, .cer): parse as plain X.509.\n // Returns null when the CN is absent — caller must set publisherName explicitly.\n return await readCertInfoFromX509(cscFile)\n }\n )\n\n // Memoized so the check runs once per build even though signFile is invoked once per file.\n private readonly explicitPublisherNameValidation = new Lazy<void>(() => this.validateExplicitPublisherName())\n\n /**\n * When `publisherName` is explicitly configured and the subject of the local code signing\n * certificate is known, fail the build if none of the configured names match the certificate.\n * This catches signing with the wrong certificate at build time — otherwise the mismatch only\n * surfaces at update time, when electron-updater rejects every update signed with that\n * certificate.\n *\n * The check is intentionally skipped whenever the actual signing certificate's subject is not\n * genuinely known: custom `sign` hooks, PKCS#11 without an extractable certificate file,\n * x509 certificate files without a CN, or any error while reading certificate info.\n * An explicit `publisherName: null` remains a pure opt-out (nothing to validate).\n */\n protected async validateExplicitPublisherName(): Promise<void> {\n const signing = getSigntoolFamilyConfig(this.platformSpecificBuildOptions)\n const publisherName = signing?.publisherName\n if (publisherName == null) {\n // not configured (auto-derive) or explicit `null` opt-out — nothing to validate\n return\n }\n if (signing?.sign != null) {\n // custom sign hook: electron-builder does not know which certificate the hook actually signs with\n return\n }\n const publisherNames = asArray(publisherName)\n if (publisherNames.length === 0) {\n return\n }\n\n let certInfo: CertificateInfo | null\n try {\n certInfo = await this.lazyCertInfo.value\n } catch (e: any) {\n // this check must only fire when the signing certificate's subject is genuinely known\n log.debug({ error: e.message || e }, \"skipping publisherName validation against the signing certificate (cannot read certificate info)\")\n return\n }\n if (certInfo == null) {\n return\n }\n\n if (!publisherNameMatchesCertificate(publisherNames, certInfo)) {\n throw new InvalidConfigurationError(\n `The configured publisherName does not match the subject of the code signing certificate. ` +\n `This usually means the build is signing with the wrong certificate (for example, a code signing certificate for another platform or team leaked into WIN_CSC_LINK/CSC_LINK in CI) — electron-updater would reject every update signed with it.\\n` +\n ` Configured publisherName: ${publisherNames.join(\" | \")}\\n` +\n ` Certificate subject: ${certInfo.bloodyMicrosoftSubjectDn}\\n` +\n `Fix win.publisherName (or sign with the intended certificate). To opt out of update signature verification entirely, set publisherName to null.`\n )\n }\n }\n\n readonly cscInfo = new MemoLazy<WindowsConfiguration, FileCodeSigningInfo | CertificateFromStoreInfo | null>(\n () => this.platformSpecificBuildOptions,\n platformSpecificBuildOptions => {\n const signing = getSigntoolFamilyConfig(platformSpecificBuildOptions)\n // signtool is the implicit default when win.sign is unset, so an absent config still\n // honours the WIN_CSC_LINK/cscLink fallback below (hsm/pkcs11 set signing.type explicitly).\n const isSigntool = signing == null || signing.type === \"signtool\"\n\n // signtool + hsm: store-based cert takes priority\n const subjectName = (signing as WindowsSigntoolSigningConfig | WindowsHsmSigningConfig | null)?.certificateSubjectName\n const shaType = (signing as WindowsSigntoolSigningConfig | WindowsHsmSigningConfig | null)?.certificateSha1\n if (subjectName != null || shaType != null) {\n return this.packager.vm.value\n .then(vm => this.getCertificateFromStoreInfo(platformSpecificBuildOptions, vm))\n .catch((e: any) => {\n // https://github.com/electron-userland/electron-builder/pull/2397\n if (signing?.sign == null) {\n throw e\n } else {\n log.debug({ error: e }, \"getCertificateFromStoreInfo error\")\n return null\n }\n })\n }\n\n const certificateFile = signing?.certificateFile\n if (certificateFile != null) {\n // Only signtool mode uses a password (HSM private key lives in the HSM, not the cert file)\n const certificatePassword = isSigntool ? this.packager.getCscPassword() : null\n return Promise.resolve({\n file: certificateFile,\n password: certificatePassword == null ? null : certificatePassword.trim(),\n })\n }\n\n // WIN_CSC_LINK env var fallback: only for signtool mode (including the implicit default)\n if (isSigntool) {\n const cscLink = this.packager.getCscLink(\"WIN_CSC_LINK\")\n if (cscLink == null || cscLink === \"\") {\n return Promise.resolve(null)\n }\n\n return importCertificate(cscLink, this.packager.tempDirManager, this.packager.projectDir)\n .catch((e: any) => {\n if (e instanceof InvalidConfigurationError) {\n throw new InvalidConfigurationError(`Env WIN_CSC_LINK is not correct, cannot resolve: ${e.message}`)\n } else {\n throw e\n }\n })\n .then(p => ({\n file: p,\n password: this.packager.getCscPassword(),\n }))\n }\n\n return Promise.resolve(null)\n }\n )\n\n initialize(): Promise<void> {\n return Promise.resolve()\n }\n\n // https://github.com/electron-userland/electron-builder/issues/2108#issuecomment-333200711\n async computePublisherName(target: Target, publisherName: string | null) {\n if ((target instanceof AppXTarget || target instanceof MsixTarget) && (await this.cscInfo.value) == null) {\n log.info({ reason: \"Windows Store only build\" }, \"AppX/MSIX package is not signed\")\n return publisherName ?? \"CN=ms\"\n }\n\n // When a signing cert is available, the cert's subject MUST be used so the APPX package\n // Publisher attribute matches the certificate — any mismatch causes SignerSign to fail with\n // ERROR_BAD_FORMAT. Only honour a user-supplied publisherName if it was explicitly configured\n // (non-null); otherwise derive from the certificate.\n const certInfo = await this.lazyCertInfo.value\n const publisher = publisherName ?? certInfo?.bloodyMicrosoftSubjectDn ?? null\n if (publisher == null) {\n throw new Error(\"Internal error: cannot compute subject using certificate info\")\n }\n return publisher\n }\n\n /**\n * Called when cscInfo is null. Returns true to skip signing, false to proceed, or throws.\n * Override in subclasses with different null-cert behaviour (HSM throws, PKCS#11 proceeds).\n */\n protected handleNullCscInfo(customSign: CustomWindowsSign | string | null | undefined): boolean {\n return !customSign // default: skip when no cert and no custom sign hook\n }\n\n async signFile(options: WindowsSignOptions): Promise<boolean> {\n const signing = getSigntoolFamilyConfig(options.options)\n let hashes = signing?.signingHashAlgorithms\n // msi does not support dual-signing\n if (options.path.endsWith(\".msi\")) {\n hashes = [hashes != null && !hashes.includes(\"sha1\") ? \"sha256\" : \"sha1\"]\n } else if (options.path.endsWith(\".appx\") || options.path.endsWith(\".msix\") || options.path.endsWith(\".msixbundle\")) {\n hashes = [\"sha256\"]\n } else if (hashes == null) {\n hashes = [\"sha1\", \"sha256\"]\n } else {\n hashes = Array.isArray(hashes) ? hashes : [hashes]\n }\n\n const name = this.packager.appInfo.productName\n const site = await this.packager.appInfo.computePackageUrl()\n\n const customSign = await resolveFunction(this.packager.appInfo.type, signing?.sign, \"sign\", await this.packager.getWorkspaceRoot())\n\n const cscInfo = await this.cscInfo.value\n\n if (cscInfo) {\n let logInfo: any = {\n file: log.filePath(options.path),\n }\n if (\"file\" in cscInfo) {\n logInfo = { ...logInfo, certificateFile: cscInfo.file }\n } else {\n logInfo = {\n ...logInfo,\n subject: cscInfo.subject,\n thumbprint: cscInfo.thumbprint,\n store: cscInfo.store,\n user: cscInfo.isLocalMachineStore ? \"local machine\" : \"current user\",\n }\n }\n log.info(logInfo, \"signing\")\n // validate an explicitly configured publisherName against the signing certificate before the\n // first file is signed, so a wrong-certificate build fails even when no publish config exists\n await this.explicitPublisherNameValidation.value\n } else if (this.handleNullCscInfo(customSign)) {\n log.debug({ signHook: !!customSign, cscInfo }, \"no signing info identified, signing is skipped\")\n return false\n }\n\n const executor = customSign || ((config: CustomWindowsSignTaskConfiguration, packager: WinPackager) => this.doSign(config, packager))\n let isNest = false\n for (const hash of hashes) {\n const taskConfiguration: WindowsSignTaskConfiguration = { ...options, name, site, cscInfo, hash, isNest }\n await Promise.resolve(\n executor(\n {\n ...taskConfiguration,\n computeSignToolArgs: isWin => this.computeSignToolArgs(taskConfiguration, isWin),\n },\n this.packager\n )\n )\n isNest = true\n if (taskConfiguration.resultOutputPath != null) {\n await rename(taskConfiguration.resultOutputPath, options.path)\n }\n }\n\n return true\n }\n\n async getCertInfo(file: string, password: string): Promise<CertificateInfo> {\n const errorMessagePrefix = \"Cannot extract publisher name from code signing certificate. As workaround, set win.publisherName. Error: \"\n try {\n return await readCertInfo(file, password)\n } catch (e: any) {\n throw new InvalidConfigurationError(`${errorMessagePrefix}${e.message || e}`)\n }\n }\n\n // on windows be aware of http://stackoverflow.com/a/32640183/1910191\n computeSignToolArgs(options: WindowsSignTaskConfiguration, isWin: boolean, vm: VmManager = new VmManager()): Array<string> {\n return isWin ? this.computeWindowsSignArgs(options, vm) : this.computeOsslsigncodeArgs(options, vm)\n }\n\n protected isLegacyToolset(): boolean {\n const v = this.packager.config.toolsets?.winCodeSign\n // Only an explicit \"0.0.0\" pin is legacy; unset / null / \"latest\" / custom now resolve to a modern bundle.\n return v === \"0.0.0\"\n }\n\n protected abstract computeWindowsSignArgs(options: WindowsSignTaskConfiguration, vm: VmManager): Array<string>\n protected abstract computeOsslsigncodeArgs(options: WindowsSignTaskConfiguration, vm: VmManager): Array<string>\n\n // allowX509: set to true by HsmSignManager to permit .crt/.cer (public chain only, key is in HSM).\n protected addCertificateArgs(args: Array<string>, options: WindowsSignTaskConfiguration, vm: VmManager, isWin: boolean, allowX509 = false): void {\n if (options.cscInfo == null) {\n throw new Error(\"No code signing certificate configured. Provide certificateFile, certificateSha1, or certificateSubjectName.\")\n }\n const certificateFile = (options.cscInfo as FileCodeSigningInfo).file\n\n if (certificateFile == null) {\n // Certificate from store (Windows only)\n if (!isWin) {\n throw new Error(\"certificateSha1/certificateSubjectName supported only on Windows\")\n }\n\n const cscInfo = options.cscInfo as CertificateFromStoreInfo\n args.push(\"/sha1\", cscInfo.thumbprint)\n args.push(\"/s\", cscInfo.store)\n if (cscInfo.isLocalMachineStore) {\n args.push(\"/sm\")\n }\n } else {\n const certExtension = path.extname(certificateFile).toLowerCase()\n\n if (certExtension === \".p12\" || certExtension === \".pfx\") {\n args.push(isWin ? \"/f\" : \"-pkcs12\", vm.toVmFile(certificateFile))\n } else if (isWin && allowX509 && (certExtension === \".crt\" || certExtension === \".cer\")) {\n args.push(\"/f\", vm.toVmFile(certificateFile))\n } else {\n throw new InvalidConfigurationError(`Please specify pkcs12 (.p12/.pfx) file, ${certificateFile} is not correct`)\n }\n }\n }\n\n protected addCommonSigningArgs(args: Array<string>, options: WindowsSignTaskConfiguration, vm: VmManager, isWin: boolean): void {\n if (options.name) {\n args.push(isWin ? \"/d\" : \"-n\", options.name)\n }\n\n if (options.site) {\n args.push(isWin ? \"/du\" : \"-i\", options.site)\n }\n\n if (options.isNest) {\n args.push(isWin ? \"/as\" : \"-nest\")\n }\n\n const password = (options.cscInfo as FileCodeSigningInfo)?.password\n if (password) {\n args.push(isWin ? \"/p\" : \"-pass\", password)\n }\n\n const signing = getSigntoolFamilyConfig(options.options)\n const additionalCert = signing?.additionalCertificateFile\n if (additionalCert) {\n args.push(isWin ? \"/ac\" : \"-ac\", vm.toVmFile(additionalCert))\n }\n }\n\n getOutputPath(inputPath: string, hash: string) {\n const extension = path.extname(inputPath)\n return path.join(path.dirname(inputPath), `${path.basename(inputPath, extension)}-signed-${hash}${extension}`)\n }\n\n async getCertificateFromStoreInfo(options: WindowsConfiguration, vm: VmManager): Promise<CertificateFromStoreInfo> {\n const signing = getSigntoolFamilyConfig(options) as WindowsSigntoolSigningConfig | WindowsHsmSigningConfig | null\n const certificateSubjectName = signing?.certificateSubjectName\n const certificateSha1 = signing?.certificateSha1?.toUpperCase()\n\n const ps = await vm.powershellCommand.value\n const rawResult = await vm.exec(ps, [\n \"-NoProfile\",\n \"-NonInteractive\",\n \"-Command\",\n \"Get-ChildItem -Recurse Cert: -CodeSigningCert | Select-Object -Property Subject,PSParentPath,Thumbprint | ConvertTo-Json -Compress\",\n ])\n const certList = rawResult.length === 0 ? [] : asArray<CertInfo>(JSON.parse(rawResult))\n for (const certInfo of certList) {\n if (\n (certificateSubjectName != null && !certInfo.Subject.includes(certificateSubjectName)) ||\n (certificateSha1 != null && certInfo.Thumbprint.toUpperCase() !== certificateSha1)\n ) {\n continue\n }\n\n const parentPath = certInfo.PSParentPath\n const store = parentPath.substring(parentPath.lastIndexOf(\"\\\\\") + 1)\n log.debug({ store, PSParentPath: parentPath }, \"auto-detect certificate store\")\n // https://github.com/electron-userland/electron-builder/issues/1717\n const isLocalMachineStore = parentPath.includes(\"Certificate::LocalMachine\")\n log.debug(null, \"auto-detect using of LocalMachine store\")\n return {\n thumbprint: certInfo.Thumbprint,\n subject: certInfo.Subject,\n store,\n isLocalMachineStore,\n }\n }\n\n throw new Error(`Cannot find certificate ${certificateSubjectName || certificateSha1}, all certs: ${rawResult}`)\n }\n\n async getToolPath(isWin = process.platform === \"win32\"): Promise<ToolInfo> {\n return getSignToolPath(this.packager.config.toolsets?.winCodeSign, isWin, this.packager.buildResourcesDir)\n }\n\n async doSign(configuration: CustomWindowsSignTaskConfiguration, packager: WinPackager) {\n // https://github.com/electron-userland/electron-builder/pull/1944\n const timeout = parseInt(process.env.SIGNTOOL_TIMEOUT as any, 10) || 10 * 60 * 1000\n let args: Array<string>\n let vm: VmManager\n // cscInfo can be null (e.g. PKCS#11 with no cert file); guard before using `in`.\n // CertificateFromStoreInfo (no `file` property) requires a Windows VM for cert-store lookup.\n const cscInfo = configuration.cscInfo\n const useVmIfNotOnWin = configuration.path.endsWith(\".appx\") || (cscInfo != null && !(\"file\" in cscInfo))\n const isWin = process.platform === \"win32\" || useVmIfNotOnWin\n const toolInfo = await getSignToolPath(this.packager.config.toolsets?.winCodeSign, isWin, this.packager.buildResourcesDir)\n const tool = toolInfo.path\n if (useVmIfNotOnWin) {\n vm = await packager.vm.value\n args = this.computeSignToolArgs(configuration, isWin, vm)\n } else {\n vm = new VmManager()\n args = configuration.computeSignToolArgs(isWin)\n }\n\n // signtool.exe (`/f`) is not safe to run concurrently — it races on the shared per-user crypto store.\n // Serialize real-Windows signtool invocations across processes; osslsigncode (`!isWin`) is file-isolated.\n const execSign = () => vm.exec(tool, args, { timeout, env: { ...process.env, ...(toolInfo.env || {}) } })\n await retry(() => (isWin ? withSigntoolLock(execSign) : execSign()), {\n retries: 2,\n interval: 15000,\n backoff: 10000,\n shouldRetry: (e: any) => {\n if (\n e.message.includes(\"The file is being used by another process\") ||\n e.message.includes(\"The specified timestamp server either could not be reached\") ||\n e.message.includes(\"No certificates were found that met all the given criteria.\") ||\n // Transient failure of SignerSignEx after cert selection, typically a concurrent-signtool race\n // on the per-user crypto store; the cross-process lock above makes this rare, retry covers the rest.\n e.message.includes(\"An error occurred while attempting to load the signing certificate\")\n ) {\n log.warn(`Attempt to code sign failed, another attempt will be made in 15 seconds: ${e.message}`)\n return true\n }\n return false\n },\n })\n }\n}\n\nexport class SigntoolSignManager extends SigntoolBaseSignManager {\n protected computeWindowsSignArgs(options: WindowsSignTaskConfiguration, vm: VmManager): Array<string> {\n const signing = getSigntoolFamilyConfig(options.options)\n\n const inputFile = vm.toVmFile(options.path)\n const args = [\"sign\"]\n\n // Timestamping\n if (process.env.ELECTRON_BUILDER_OFFLINE !== \"true\") {\n const isRfc3161 = options.isNest || options.hash === \"sha256\"\n args.push(isRfc3161 ? \"/tr\" : \"/t\")\n const timestampUrl = isRfc3161 ? signing?.rfc3161TimeStampServer || \"http://timestamp.digicert.com\" : signing?.timeStampServer || \"http://timestamp.digicert.com\"\n args.push(timestampUrl)\n }\n\n // Certificate\n this.addCertificateArgs(args, options, vm, true)\n\n // Hash algorithm\n if (this.isLegacyToolset()) {\n // Legacy v0.0.0: Only add /fd for non-SHA1 (original behavior)\n if (options.hash !== \"sha1\") {\n args.push(\"/fd\", options.hash)\n if (process.env.ELECTRON_BUILDER_OFFLINE !== \"true\") {\n args.push(\"/td\", \"sha256\")\n }\n }\n } else {\n // Modern: Always add /fd (required by new Windows Kits)\n args.push(\"/fd\", options.hash.toLowerCase())\n // Only add /td for RFC3161 timestamps (incompatible with /t)\n if (process.env.ELECTRON_BUILDER_OFFLINE !== \"true\" && (options.isNest || options.hash === \"sha256\")) {\n args.push(\"/td\", \"sha256\")\n }\n }\n\n // Optional parameters\n this.addCommonSigningArgs(args, options, vm, true)\n\n // Windows-specific\n args.push(\"/debug\")\n args.push(inputFile) // Must be last\n\n return args\n }\n\n protected computeOsslsigncodeArgs(options: WindowsSignTaskConfiguration, vm: VmManager): Array<string> {\n const signing = getSigntoolFamilyConfig(options.options)\n\n const inputFile = vm.toVmFile(options.path)\n const outputPath = this.getOutputPath(inputFile, options.hash)\n options.resultOutputPath = outputPath\n\n const args = [\"sign\", \"-in\", inputFile, \"-out\", outputPath]\n\n // Timestamping\n if (process.env.ELECTRON_BUILDER_OFFLINE !== \"true\") {\n const timestampUrl = signing?.timeStampServer || \"http://timestamp.digicert.com\"\n args.push(\"-t\", timestampUrl)\n }\n\n // Certificate file\n this.addCertificateArgs(args, options, vm, false)\n\n // Hash algorithm\n args.push(\"-h\", options.hash.toLowerCase())\n\n // Optional parameters (name, site, nest, password, additionalCert)\n this.addCommonSigningArgs(args, options, vm, false)\n\n // Proxy support\n const httpsProxy = process.env.HTTPS_PROXY\n if (httpsProxy?.length) {\n args.push(\"-p\", httpsProxy)\n }\n\n return args\n }\n}\n"]}
|
package/dist/configuration.d.ts
CHANGED
|
@@ -84,8 +84,10 @@ export interface CommonConfiguration {
|
|
|
84
84
|
* Pinned versions of the binary toolsets electron-builder downloads and uses internally.
|
|
85
85
|
*
|
|
86
86
|
* Each property selects a specific release of the corresponding tool bundle. Set a property to
|
|
87
|
-
* `"0.0.0"` to force the legacy bundle (pre-v27 behaviour). Leave a property unset (or set to
|
|
88
|
-
* `
|
|
87
|
+
* `"0.0.0"` to force the legacy bundle (pre-v27 behaviour). Leave a property unset (or set it to
|
|
88
|
+
* `"latest"`) to use the modern default (newest bundle) for that toolset.
|
|
89
|
+
*
|
|
90
|
+
* Note: Toolset versioning can drop intermediate releases (such as if a problem is discovered in a bundle). If you need to pin to a specific release, check the release notes for the toolset to ensure the version you specify is valid.
|
|
89
91
|
*
|
|
90
92
|
* @see {@link ToolsetConfig}
|
|
91
93
|
*/
|
|
@@ -321,6 +323,34 @@ export interface CommonConfiguration {
|
|
|
321
323
|
* @default ["electron", "electron-builder"]
|
|
322
324
|
*/
|
|
323
325
|
readonly ignoredProductionDependencies?: Array<string> | null;
|
|
326
|
+
/**
|
|
327
|
+
* Whether production dependencies that cannot be resolved during node-module collection are
|
|
328
|
+
* allowed — i.e. whether the build should continue with a warning instead of failing.
|
|
329
|
+
*
|
|
330
|
+
* During collection every production dependency must resolve to an installed package on disk. A
|
|
331
|
+
* dependency that does not resolve (`cannot find path for dependency` / `dependency not found on
|
|
332
|
+
* disk`) is not bundled, which typically breaks the packaged app at runtime with
|
|
333
|
+
* `MODULE_NOT_FOUND`.
|
|
334
|
+
*
|
|
335
|
+
* - `false` or `null` (default): the build fails after dependency collection completes,
|
|
336
|
+
* reporting the **complete** list of missing production dependencies at once.
|
|
337
|
+
* - `string[]`: the listed dependency names are allowed to be missing; any other missing
|
|
338
|
+
* production dependency still fails the build. Entries match the package name of the reported
|
|
339
|
+
* `name@version` entry (e.g. `some-native-module`, `@scope/pkg`), or an exact `name@version`
|
|
340
|
+
* string to allow only that resolved version to be missing.
|
|
341
|
+
* - `true`: missing production dependencies are only logged as warnings (the electron-builder
|
|
342
|
+
* ≤ 26 behavior).
|
|
343
|
+
*
|
|
344
|
+
* Missing *optional* dependencies (declared in `optionalDependencies`, e.g. `fsevents` on
|
|
345
|
+
* Linux/Windows, or platform-specific packages) are always allowed and never fail the build.
|
|
346
|
+
*
|
|
347
|
+
* Independent of {@link ignoredProductionDependencies}, which controls which dependencies are
|
|
348
|
+
* excluded from the copied `node_modules`; this option only controls validation of the
|
|
349
|
+
* collection result.
|
|
350
|
+
*
|
|
351
|
+
* @default false
|
|
352
|
+
*/
|
|
353
|
+
readonly allowMissingDependencies?: boolean | Array<string> | null;
|
|
324
354
|
/**
|
|
325
355
|
* Configuration for native Node.js module installation and rebuilding.
|
|
326
356
|
*
|
|
@@ -447,6 +477,13 @@ export interface Configuration extends CommonConfiguration, PlatformSpecificBuil
|
|
|
447
477
|
/**
|
|
448
478
|
* Options forwarded to [`@electron/get`](https://github.com/electron/get) when downloading the
|
|
449
479
|
* Electron distribution to package.
|
|
480
|
+
*
|
|
481
|
+
* `checksums` (a map of artifact file name → SHA-256 hex) makes checksum validation fully offline —
|
|
482
|
+
* without it, `@electron/get` fetches `SHASUMS256.txt` from the network on every build, even when the
|
|
483
|
+
* artifact itself is already cached. When `checksums` is not configured, electron-builder automatically
|
|
484
|
+
* picks up a locally seeded `SHASUMS256.txt-<version>` (or `SHASUMS256.txt`) file at the root of the
|
|
485
|
+
* Electron cache directory. See the
|
|
486
|
+
* [air-gapped / offline builds guide](https://www.electron.build/tutorials/offline-air-gapped-builds).
|
|
450
487
|
*/
|
|
451
488
|
readonly electronGet?: ElectronGetOptions | null;
|
|
452
489
|
/**
|
|
@@ -696,13 +733,13 @@ export interface ToolsetConfig {
|
|
|
696
733
|
* Available versions:
|
|
697
734
|
* | Version | Notes |
|
|
698
735
|
* |---------|-------|
|
|
699
|
-
* | `"1.2.
|
|
736
|
+
* | `"1.2.3"` | Writes 16px/32px ICNS entries as `ic04`/`ic05` ARGB (fixes corrupt small icons in Finder) |
|
|
700
737
|
*
|
|
701
738
|
* Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/icons/CHANGELOG.md
|
|
702
739
|
*
|
|
703
740
|
* @default "latest"
|
|
704
741
|
*/
|
|
705
|
-
readonly icons?: "1.2.
|
|
742
|
+
readonly icons?: "1.2.3" | ToolsetCustom | "latest";
|
|
706
743
|
}
|
|
707
744
|
/**
|
|
708
745
|
* A custom toolset bundle supplied by the user in place of a built-in versioned bundle.
|
|
@@ -890,7 +927,7 @@ export interface Hooks {
|
|
|
890
927
|
* `electron-v${version}-${platformName}-${arch}.zip`.
|
|
891
928
|
*
|
|
892
929
|
* When not set, electron-builder downloads the official Electron release from GitHub (or the
|
|
893
|
-
* mirror configured via `
|
|
930
|
+
* mirror configured via `electronGet`).
|
|
894
931
|
*
|
|
895
932
|
* Receives a {@link PrepareApplicationStageDirectoryOptions}.
|
|
896
933
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,EAAE,uCAAuC,EAAE,MAAM,gBAAgB,CAAA;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,aAAa,E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