app-builder-lib 27.0.0-alpha.13 → 27.0.0-alpha.15
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/hsmSignManager.d.ts.map +1 -1
- package/dist/codeSign/win/hsmSignManager.js +3 -2
- package/dist/codeSign/win/hsmSignManager.js.map +1 -1
- package/dist/codeSign/win/pkcs11SignManager.d.ts.map +1 -1
- package/dist/codeSign/win/pkcs11SignManager.js +2 -1
- package/dist/codeSign/win/pkcs11SignManager.js.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.js +15 -5
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
- package/dist/configuration.d.ts +78 -20
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/indexInternal.d.ts +5 -3
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +4 -3
- package/dist/indexInternal.js.map +1 -1
- package/dist/options/FileAssociation.d.ts +1 -1
- package/dist/options/FileAssociation.js.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.d.ts +4 -1
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/dist/options/SnapOptions.d.ts +13 -3
- package/dist/options/SnapOptions.d.ts.map +1 -1
- package/dist/options/SnapOptions.js.map +1 -1
- package/dist/options/macOptions.d.ts +9 -6
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +2 -2
- package/dist/options/winOptions.js.map +1 -1
- package/dist/packager.d.ts +22 -0
- package/dist/packager.d.ts.map +1 -1
- package/dist/packager.js +115 -66
- package/dist/packager.js.map +1 -1
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +10 -8
- package/dist/platformPackager.js.map +1 -1
- package/dist/publish/PublishManager.d.ts +5 -0
- package/dist/publish/PublishManager.d.ts.map +1 -1
- package/dist/publish/PublishManager.js +102 -24
- package/dist/publish/PublishManager.js.map +1 -1
- package/dist/publish/manifestUploadCheck.d.ts +12 -0
- package/dist/publish/manifestUploadCheck.d.ts.map +1 -1
- package/dist/publish/manifestUploadCheck.js +84 -12
- package/dist/publish/manifestUploadCheck.js.map +1 -1
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
- package/dist/publish/updateInfoBuilder.js +12 -7
- package/dist/publish/updateInfoBuilder.js.map +1 -1
- package/dist/publish/updateManifestVerifier.d.ts +54 -0
- package/dist/publish/updateManifestVerifier.d.ts.map +1 -1
- package/dist/publish/updateManifestVerifier.js +121 -1
- package/dist/publish/updateManifestVerifier.js.map +1 -1
- package/dist/publish/updaterSettingsCheck.d.ts +8 -0
- package/dist/publish/updaterSettingsCheck.d.ts.map +1 -0
- package/dist/publish/updaterSettingsCheck.js +136 -0
- package/dist/publish/updaterSettingsCheck.js.map +1 -0
- package/dist/targets/ArchiveTarget.js +1 -1
- package/dist/targets/ArchiveTarget.js.map +1 -1
- package/dist/targets/archive.d.ts.map +1 -1
- package/dist/targets/archive.js +4 -3
- package/dist/targets/archive.js.map +1 -1
- package/dist/targets/blockmap/blockmap.d.ts +30 -0
- package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
- package/dist/targets/blockmap/blockmap.js +99 -31
- package/dist/targets/blockmap/blockmap.js.map +1 -1
- package/dist/targets/blockmap/blockmapV3.d.ts +36 -0
- package/dist/targets/blockmap/blockmapV3.d.ts.map +1 -0
- package/dist/targets/blockmap/blockmapV3.js +41 -0
- package/dist/targets/blockmap/blockmapV3.js.map +1 -0
- package/dist/targets/blockmap/verbatimRange.d.ts +6 -0
- package/dist/targets/blockmap/verbatimRange.d.ts.map +1 -1
- package/dist/targets/blockmap/verbatimRange.js +11 -0
- package/dist/targets/blockmap/verbatimRange.js.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.d.ts +92 -4
- package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.js +266 -10
- package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +1 -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 +23 -31
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js +6 -14
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.d.ts +4 -3
- package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.js +10 -6
- package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.d.ts +8 -0
- package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +42 -9
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/mac/pkg.d.ts.map +1 -1
- package/dist/targets/mac/pkg.js +13 -9
- package/dist/targets/mac/pkg.js.map +1 -1
- package/dist/targets/targetFactory.d.ts +22 -3
- package/dist/targets/targetFactory.d.ts.map +1 -1
- package/dist/targets/targetFactory.js +70 -29
- package/dist/targets/targetFactory.js.map +1 -1
- package/dist/targets/win/MsiTarget.d.ts +7 -0
- package/dist/targets/win/MsiTarget.d.ts.map +1 -1
- package/dist/targets/win/MsiTarget.js +140 -21
- package/dist/targets/win/MsiTarget.js.map +1 -1
- package/dist/targets/win/nsis/Defines.d.ts +1 -0
- package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
- package/dist/targets/win/nsis/Defines.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.d.ts +3 -0
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +33 -12
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
- package/dist/targets/win/nsis/nsisLicense.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisLicense.js +8 -5
- package/dist/targets/win/nsis/nsisLicense.js.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.d.ts +31 -3
- package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.d.ts +6 -0
- package/dist/targets/win/nsis/nsisScriptGenerator.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.js +16 -5
- package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.js +11 -29
- package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
- package/dist/toolsets/7zip.d.ts +10 -0
- package/dist/toolsets/7zip.d.ts.map +1 -1
- package/dist/toolsets/7zip.js +12 -1
- package/dist/toolsets/7zip.js.map +1 -1
- package/dist/toolsets/appimage.d.ts +3 -0
- package/dist/toolsets/appimage.d.ts.map +1 -1
- package/dist/toolsets/appimage.js +4 -1
- package/dist/toolsets/appimage.js.map +1 -1
- package/dist/toolsets/archive.d.ts +13 -0
- package/dist/toolsets/archive.d.ts.map +1 -0
- package/dist/toolsets/archive.js +55 -0
- package/dist/toolsets/archive.js.map +1 -0
- package/dist/toolsets/custom.d.ts.map +1 -1
- package/dist/toolsets/custom.js +19 -2
- package/dist/toolsets/custom.js.map +1 -1
- package/dist/toolsets/fpm.d.ts +23 -0
- package/dist/toolsets/fpm.d.ts.map +1 -1
- package/dist/toolsets/fpm.js +52 -19
- package/dist/toolsets/fpm.js.map +1 -1
- package/dist/toolsets/nsis.d.ts +23 -4
- package/dist/toolsets/nsis.d.ts.map +1 -1
- package/dist/toolsets/nsis.js +49 -14
- package/dist/toolsets/nsis.js.map +1 -1
- package/dist/toolsets/winCodeSign.d.ts +20 -1
- package/dist/toolsets/winCodeSign.d.ts.map +1 -1
- package/dist/toolsets/winCodeSign.js +32 -5
- package/dist/toolsets/winCodeSign.js.map +1 -1
- package/dist/toolsets/wix.d.ts +44 -0
- package/dist/toolsets/wix.d.ts.map +1 -0
- package/dist/toolsets/wix.js +91 -0
- package/dist/toolsets/wix.js.map +1 -0
- package/dist/util/buildOutputVerifier.d.ts +2 -1
- package/dist/util/buildOutputVerifier.d.ts.map +1 -1
- package/dist/util/buildOutputVerifier.js +41 -63
- package/dist/util/buildOutputVerifier.js.map +1 -1
- package/dist/util/bundledTool.d.ts +8 -0
- package/dist/util/bundledTool.d.ts.map +1 -1
- package/dist/util/bundledTool.js +34 -0
- package/dist/util/bundledTool.js.map +1 -1
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +107 -10
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/electronUpdaterCompatibility.d.ts +64 -0
- package/dist/util/electronUpdaterCompatibility.d.ts.map +1 -0
- package/dist/util/electronUpdaterCompatibility.js +82 -0
- package/dist/util/electronUpdaterCompatibility.js.map +1 -0
- package/dist/util/flags.d.ts +5 -0
- package/dist/util/flags.d.ts.map +1 -1
- package/dist/util/flags.js +8 -2
- package/dist/util/flags.js.map +1 -1
- package/dist/util/mac/macosVersion.d.ts +0 -1
- package/dist/util/mac/macosVersion.d.ts.map +1 -1
- package/dist/util/mac/macosVersion.js +0 -21
- package/dist/util/mac/macosVersion.js.map +1 -1
- package/dist/util/packageMetadata.d.ts +14 -1
- package/dist/util/packageMetadata.d.ts.map +1 -1
- package/dist/util/packageMetadata.js +115 -51
- package/dist/util/packageMetadata.js.map +1 -1
- package/dist/util/removedEnvVars.js +1 -1
- package/dist/util/removedEnvVars.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 +182 -49
- package/templates/msi/template.xml +5 -5
- package/templates/msiWrapped/template.xml +1 -1
- package/templates/nsis/assistedInstaller.nsh +37 -1
- package/templates/nsis/common.nsh +142 -1
- package/templates/nsis/include/installUtil.nsh +12 -0
- package/templates/nsis/include/installer.nsh +12 -0
- package/templates/nsis/installSection.nsh +3 -0
- package/templates/nsis/installer.nsi +25 -13
- package/templates/nsis/multiUser.nsh +50 -10
- package/templates/nsis/portable.nsi +1 -1
- package/templates/nsis/uninstaller.nsh +6 -0
- package/dist/toolsets/linuxToolsMac.d.ts +0 -8
- package/dist/toolsets/linuxToolsMac.d.ts.map +0 -1
- package/dist/toolsets/linuxToolsMac.js +0 -44
- package/dist/toolsets/linuxToolsMac.js.map +0 -1
package/dist/toolsets/nsis.js
CHANGED
|
@@ -6,7 +6,7 @@ import { resolveToolsetVersion } from "./version.js";
|
|
|
6
6
|
import _fsExtra from "fs-extra";
|
|
7
7
|
const { stat } = _fsExtra;
|
|
8
8
|
// Newest NSIS bundle — selected when the config is unset / null / "latest".
|
|
9
|
-
const NSIS_LATEST = "
|
|
9
|
+
const NSIS_LATEST = "2.0.4";
|
|
10
10
|
function getLegacyNsisBin() {
|
|
11
11
|
// Warning: Don't use v3.0.4.2 - https://github.com/electron-userland/electron-builder/issues/6334
|
|
12
12
|
return downloadBuilderToolset({
|
|
@@ -30,21 +30,51 @@ export const nsisChecksums = {
|
|
|
30
30
|
// unified bundle
|
|
31
31
|
"nsis-bundle-3.12.tar.gz": "56997fdefe25e7928a1a68b4583d08b240b66cf660234053b20131a74cc082f4",
|
|
32
32
|
},
|
|
33
|
+
// 2.0.4 replaces 2.0.3, whose bundles lacked the plugin and elevate.exe license files; it also has the Unicode nsisunz fix
|
|
34
|
+
"2.0.4": {
|
|
35
|
+
// unified bundle, NSIS 3.13 compiled from source: makensis (Linux, macOS, Windows) and the Windows stubs without NSIS_CONFIG_LOG
|
|
36
|
+
"nsis-bundle-3.13.tar.gz": "c18e9ad9684cf4c5bbd7b768cbf1b056d40771d7bd9ae1b513346452decf89d2",
|
|
37
|
+
// the same bundle with makensis and the Windows stubs compiled with NSIS_CONFIG_LOG=yes, for installerDebugLogging
|
|
38
|
+
"nsis-bundle-3.13-log.tar.gz": "1803e6d45c91f6ed7860935940073fdc7857d52f2dabe123352c4676aeb635c7",
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The bundle file of each unified version. `log` is the log-enabled variant, published from nsis@2.0.4 on; the bundles of the older
|
|
43
|
+
* versions (the legacy NSIS 3.0.4.1 of "0.0.0" and the stock NSIS 3.12 of "1.2.1") are not log-enabled.
|
|
44
|
+
*/
|
|
45
|
+
const nsisBundleFiles = {
|
|
46
|
+
"1.2.1": { file: "nsis-bundle-3.12.tar.gz" },
|
|
47
|
+
"2.0.4": { file: "nsis-bundle-3.13.tar.gz", log: "nsis-bundle-3.13-log.tar.gz" },
|
|
33
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* Whether `toolsets.nsis` can provide a log-enabled NSIS, which `installerDebugLogging` needs. The default (unset / `"latest"`) and
|
|
51
|
+
* `"2.0.4"` can (their `-log` bundle); the older pinned bundles (`"0.0.0"`, `"1.2.1"`) cannot. A custom bundle is assumed to be
|
|
52
|
+
* log-enabled (makensis rejects `LogSet` if it is not).
|
|
53
|
+
*/
|
|
54
|
+
export function isNsisLoggingSupported(nsis) {
|
|
55
|
+
if (typeof nsis === "object" && nsis != null) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
const resolved = resolveToolsetVersion(nsis, NSIS_LATEST);
|
|
59
|
+
return resolved !== "0.0.0" && nsisBundleFiles[resolved]?.log != null;
|
|
60
|
+
}
|
|
34
61
|
/**
|
|
35
62
|
* `installerDebugLogging` emits `LogSet`, which only a `makensis` compiled with `NSIS_CONFIG_LOG=yes` accepts ("LogSet specified,
|
|
36
|
-
* NSIS_CONFIG_LOG not defined" otherwise).
|
|
63
|
+
* NSIS_CONFIG_LOG not defined" otherwise). nsis@2.0.4 and newer publish a log-enabled bundle next to the default one; the older pinned
|
|
64
|
+
* bundles are not log-enabled.
|
|
37
65
|
*/
|
|
38
66
|
export function assertInstallerDebugLoggingSupported(nsis, targetName) {
|
|
39
|
-
|
|
67
|
+
// a custom bundle and the default (unset / "latest") are always supported, so only a pinned bundled version is left here
|
|
68
|
+
if (isNsisLoggingSupported(nsis) || typeof nsis !== "string") {
|
|
40
69
|
return;
|
|
41
70
|
}
|
|
42
71
|
throw new InvalidConfigurationError(`\`installerDebugLogging\` (${targetName} target) needs a log-enabled NSIS (makensis and stubs compiled with NSIS_CONFIG_LOG=yes), ` +
|
|
43
|
-
`but \`toolsets.nsis\` is
|
|
44
|
-
|
|
72
|
+
`but \`toolsets.nsis\` is "${nsis}", which selects a bundled NSIS that has no log-enabled bundle.\n` +
|
|
73
|
+
` Remove the \`toolsets.nsis\` pin (or set it to "latest" or "${NSIS_LATEST}") to use the log-enabled variant of the default bundle, supply a log-enabled custom ` +
|
|
74
|
+
"`toolsets.nsis: { url, checksum, version }`, or remove `installerDebugLogging`.\n" +
|
|
45
75
|
" https://www.electron.build/docs/migration/v27-config-changes#customnsisbinary-and-customnsisresources-replaced-by-toolsetsnsis");
|
|
46
76
|
}
|
|
47
|
-
async function getNsisBundlePath(nsis, resourcesDir) {
|
|
77
|
+
async function getNsisBundlePath(nsis, resourcesDir, options) {
|
|
48
78
|
if (typeof nsis === "object" && nsis != null) {
|
|
49
79
|
return getCustomToolsetPath(nsis, resourcesDir);
|
|
50
80
|
}
|
|
@@ -52,14 +82,19 @@ async function getNsisBundlePath(nsis, resourcesDir) {
|
|
|
52
82
|
if (resolved === "0.0.0") {
|
|
53
83
|
return getLegacyNsisBin();
|
|
54
84
|
}
|
|
55
|
-
const
|
|
85
|
+
const bundle = nsisBundleFiles[resolved];
|
|
86
|
+
// The two bundles of a version download and extract to separate cache dirs (keyed by file name), so switching
|
|
87
|
+
// installerDebugLogging never reuses the other variant. Versions without a log-enabled bundle always use their only bundle;
|
|
88
|
+
// assertInstallerDebugLoggingSupported rejects installerDebugLogging for them before anything is built.
|
|
89
|
+
const file = options.debugLogging === true && bundle.log != null ? bundle.log : bundle.file;
|
|
90
|
+
const checksums = nsisChecksums[resolved];
|
|
56
91
|
return downloadBuilderToolset({
|
|
57
92
|
releaseName: `nsis@${resolved}`,
|
|
58
93
|
filenameWithExt: file,
|
|
59
|
-
checksums: { [file]:
|
|
94
|
+
checksums: { [file]: checksums[file] },
|
|
60
95
|
});
|
|
61
96
|
}
|
|
62
|
-
export async function getMakeNsisPath(nsis, resourcesDir) {
|
|
97
|
+
export async function getMakeNsisPath(nsis, resourcesDir, options = {}) {
|
|
63
98
|
const legacyBundle = (bundlePath) => {
|
|
64
99
|
// legacy bundle: platform-specific subdirectories, NSISDIR must be set explicitly
|
|
65
100
|
const env = { NSISDIR: bundlePath };
|
|
@@ -75,7 +110,7 @@ export async function getMakeNsisPath(nsis, resourcesDir) {
|
|
|
75
110
|
// the entrypoint script auto-sets NSISDIR
|
|
76
111
|
return { path: path.resolve(bundlePath, process.platform === "win32" ? "makensis.cmd" : "makensis") };
|
|
77
112
|
};
|
|
78
|
-
const bundlePath = await getNsisBundlePath(nsis, resourcesDir);
|
|
113
|
+
const bundlePath = await getNsisBundlePath(nsis, resourcesDir, options);
|
|
79
114
|
if (nsis === "0.0.0") {
|
|
80
115
|
return legacyBundle(bundlePath);
|
|
81
116
|
}
|
|
@@ -88,7 +123,7 @@ export async function getMakeNsisPath(nsis, resourcesDir) {
|
|
|
88
123
|
}
|
|
89
124
|
return entrypointBundle(bundlePath);
|
|
90
125
|
}
|
|
91
|
-
export async function getNsisPluginsPath(nsis, resourcesDir) {
|
|
126
|
+
export async function getNsisPluginsPath(nsis, resourcesDir, options = {}) {
|
|
92
127
|
const resolvePluginsDir = async (bundlePath) => {
|
|
93
128
|
const potentialPaths = [path.resolve(bundlePath, "plugins"), path.resolve(bundlePath, "windows", "Plugins")];
|
|
94
129
|
for (const p of potentialPaths) {
|
|
@@ -101,9 +136,9 @@ export async function getNsisPluginsPath(nsis, resourcesDir) {
|
|
|
101
136
|
if (nsis === "0.0.0") {
|
|
102
137
|
return path.resolve(await getLegacyNsisResourcesBin(), "plugins");
|
|
103
138
|
}
|
|
104
|
-
return resolvePluginsDir(await getNsisBundlePath(nsis, resourcesDir));
|
|
139
|
+
return resolvePluginsDir(await getNsisBundlePath(nsis, resourcesDir, options));
|
|
105
140
|
}
|
|
106
|
-
export async function getNsisElevatePath(nsis, resourcesDir) {
|
|
141
|
+
export async function getNsisElevatePath(nsis, resourcesDir, options = {}) {
|
|
107
142
|
const resolveElevate = async (dir) => {
|
|
108
143
|
const p = path.resolve(dir, "elevate.exe");
|
|
109
144
|
if ((await exists(p)) && (await stat(p)).isFile()) {
|
|
@@ -111,6 +146,6 @@ export async function getNsisElevatePath(nsis, resourcesDir) {
|
|
|
111
146
|
}
|
|
112
147
|
throw new Error(`elevate.exe not found in NSIS bundle at: ${dir}. Expected path: ${p}`);
|
|
113
148
|
};
|
|
114
|
-
return resolveElevate(await getNsisBundlePath(nsis, resourcesDir));
|
|
149
|
+
return resolveElevate(await getNsisBundlePath(nsis, resourcesDir, options));
|
|
115
150
|
}
|
|
116
151
|
//# sourceMappingURL=nsis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nsis.js","sourceRoot":"","sources":["../../src/toolsets/nsis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAEhE,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAG5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ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OAAO,CAAC,MAAM,yBAAyB,EAAE,EAAE,SAAS,CAAC,CAAA;IACnE,CAAC;IACD,OAAO,iBAAiB,CAAC,MAAM,iBAAiB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAA;AACvE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAqC,EAAE,YAAoB;IAClG,MAAM,cAAc,GAAG,KAAK,EAAE,GAAW,EAAE,EAAE;QAC3C,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;QAC1C,IAAI,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;YAClD,OAAO,CAAC,CAAA;QACV,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,4CAA4C,GAAG,oBAAoB,CAAC,EAAE,CAAC,CAAA;IACzF,CAAC,CAAA;IACD,OAAO,cAAc,CAAC,MAAM,iBAAiB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAA;AACpE,CAAC","sourcesContent":["import { exists, InvalidConfigurationError } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport * as path from \"path\"\nimport { ToolsetConfig } from \"../configuration.js\"\nimport { ToolInfo } from \"../util/bundledTool.js\"\nimport { downloadBuilderToolset } from \"../util/electronGet.js\"\nimport { getCustomToolsetPath } from \"./custom.js\"\nimport { resolveToolsetVersion } from \"./version.js\"\nimport _fsExtra from \"fs-extra\"\nconst { stat } = _fsExtra\n\n// Newest NSIS bundle — selected when the config is unset / null / \"latest\".\nconst NSIS_LATEST = \"1.2.1\"\n\nfunction getLegacyNsisBin(): Promise<string> {\n // Warning: Don't use v3.0.4.2 - https://github.com/electron-userland/electron-builder/issues/6334\n return downloadBuilderToolset({\n releaseName: \"nsis-3.0.4.1\",\n filenameWithExt: \"nsis-3.0.4.1.7z\",\n checksums: { \"nsis-3.0.4.1.7z\": \"9877df902530f96357d13a7a31ae2b9df67f48b11ffc9a1700a7c961574ec5fa\" },\n })\n}\n\nfunction getLegacyNsisResourcesBin(): Promise<string> {\n return downloadBuilderToolset({\n releaseName: \"nsis-resources-3.4.1\",\n filenameWithExt: \"nsis-resources-3.4.1.7z\",\n checksums: { \"nsis-resources-3.4.1.7z\": \"593a9a92ef958321293ac6a2ee61e64bf1bd543142a5bd6b3d310709cc924103\" },\n })\n}\n\nexport const nsisChecksums = {\n \"0.0.0\": {\n // legacy — uses getLegacyNsisBin() / getLegacyNsisResourcesBin()\n },\n \"1.2.1\": {\n // unified bundle\n \"nsis-bundle-3.12.tar.gz\": \"56997fdefe25e7928a1a68b4583d08b240b66cf660234053b20131a74cc082f4\",\n },\n} as const\n\n/**\n * `installerDebugLogging` emits `LogSet`, which only a `makensis` compiled with `NSIS_CONFIG_LOG=yes` accepts (\"LogSet specified,\n * NSIS_CONFIG_LOG not defined\" otherwise). The bundled NSIS toolsets are not log-enabled, so only a custom bundle can support it.\n */\nexport function assertInstallerDebugLoggingSupported(nsis: ToolsetConfig[\"nsis\"] | Nullish, targetName: string): void {\n if (typeof nsis === \"object\" && nsis != null) {\n return\n }\n throw new InvalidConfigurationError(\n `\\`installerDebugLogging\\` (${targetName} target) needs a log-enabled NSIS (makensis and stubs compiled with NSIS_CONFIG_LOG=yes), ` +\n `but \\`toolsets.nsis\\` is ${nsis == null ? \"unset\" : `\"${nsis}\"`}, which selects a bundled NSIS that is not log-enabled.\\n` +\n \" Supply a log-enabled NSIS bundle as a custom `toolsets.nsis: { url, checksum, version }`, or remove `installerDebugLogging`.\\n\" +\n \" https://www.electron.build/docs/migration/v27-config-changes#customnsisbinary-and-customnsisresources-replaced-by-toolsetsnsis\"\n )\n}\n\nasync function getNsisBundlePath(nsis: ToolsetConfig[\"nsis\"] | Nullish, resourcesDir: string): Promise<string> {\n if (typeof nsis === \"object\" && nsis != null) {\n return getCustomToolsetPath(nsis, resourcesDir)\n }\n const resolved = resolveToolsetVersion(nsis, NSIS_LATEST)\n if (resolved === \"0.0.0\") {\n return getLegacyNsisBin()\n }\n const file = \"nsis-bundle-3.12.tar.gz\"\n return downloadBuilderToolset({\n releaseName: `nsis@${resolved}`,\n filenameWithExt: file,\n checksums: { [file]: nsisChecksums[resolved][file] },\n })\n}\n\nexport async function getMakeNsisPath(nsis: ToolsetConfig[\"nsis\"] | Nullish, resourcesDir: string): Promise<ToolInfo> {\n const legacyBundle = (bundlePath: string) => {\n // legacy bundle: platform-specific subdirectories, NSISDIR must be set explicitly\n const env = { NSISDIR: bundlePath }\n if (process.platform === \"darwin\") {\n return { path: path.resolve(bundlePath, \"mac\", \"makensis\"), env }\n } else if (process.platform === \"win32\") {\n return { path: path.resolve(bundlePath, \"Bin\", \"makensis.exe\"), env }\n }\n return { path: path.resolve(bundlePath, \"linux\", \"makensis\"), env }\n }\n const entrypointBundle = (bundlePath: string) => {\n // the entrypoint script auto-sets NSISDIR\n return { path: path.resolve(bundlePath, process.platform === \"win32\" ? \"makensis.cmd\" : \"makensis\") }\n }\n\n const bundlePath = await getNsisBundlePath(nsis, resourcesDir)\n if (nsis === \"0.0.0\") {\n return legacyBundle(bundlePath)\n }\n if (typeof nsis === \"object\") {\n const entrypoint = entrypointBundle(bundlePath)\n if (await exists(entrypoint.path)) {\n return entrypoint\n }\n return legacyBundle(bundlePath)\n }\n return entrypointBundle(bundlePath)\n}\n\nexport async function getNsisPluginsPath(nsis: ToolsetConfig[\"nsis\"] | Nullish, resourcesDir: string): Promise<string> {\n const resolvePluginsDir = async (bundlePath: string) => {\n const potentialPaths = [path.resolve(bundlePath, \"plugins\"), path.resolve(bundlePath, \"windows\", \"Plugins\")]\n for (const p of potentialPaths) {\n if ((await exists(p)) && (await stat(p)).isDirectory()) {\n return p\n }\n }\n throw new Error(`Plugins directory not found in NSIS bundle at: ${bundlePath}. Expected one of: ${potentialPaths.join(\", \")}`)\n }\n if (nsis === \"0.0.0\") {\n return path.resolve(await getLegacyNsisResourcesBin(), \"plugins\")\n }\n return resolvePluginsDir(await getNsisBundlePath(nsis, resourcesDir))\n}\n\nexport async function getNsisElevatePath(nsis: ToolsetConfig[\"nsis\"] | Nullish, resourcesDir: string): Promise<string> {\n const resolveElevate = async (dir: string) => {\n const p = path.resolve(dir, \"elevate.exe\")\n if ((await exists(p)) && (await stat(p)).isFile()) {\n return p\n }\n throw new Error(`elevate.exe not found in NSIS bundle at: ${dir}. Expected path: ${p}`)\n }\n return resolveElevate(await getNsisBundlePath(nsis, resourcesDir))\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nsis.js","sourceRoot":"","sources":["../../src/toolsets/nsis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAEhE,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAG5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAA;AAEzB,4EAA4E;AAC5E,MAAM,WAAW,GAAG,OAAO,CAAA;AAW3B,SAAS,gBAAgB;IACvB,kGAAkG;IAClG,OAAO,sBAAsB,CAAC;QAC5B,WAAW,EAAE,cAAc;QAC3B,eAAe,EAAE,iBAAiB;QAClC,SAAS,EAAE,EAAE,iBAAiB,EAAE,kEAAkE,EAAE;KACrG,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,yBAAyB;IAChC,OAAO,sBAAsB,CAAC;QAC5B,WAAW,EAAE,sBAAsB;QACnC,eAAe,EAAE,yBAAyB;QAC1C,SAAS,EAAE,EAAE,yBAAyB,EAAE,kEAAkE,EAAE;KAC7G,CAAC,CAAA;AACJ,CAAC;AAED,MAAM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,CAAA;AAC7E,CAAC","sourcesContent":["import { exists, InvalidConfigurationError } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport * as path from \"path\"\nimport { ToolsetConfig } from \"../configuration.js\"\nimport { ToolInfo } from \"../util/bundledTool.js\"\nimport { downloadBuilderToolset } from \"../util/electronGet.js\"\nimport { getCustomToolsetPath } from \"./custom.js\"\nimport { resolveToolsetVersion } from \"./version.js\"\nimport _fsExtra from \"fs-extra\"\nconst { stat } = _fsExtra\n\n// Newest NSIS bundle — selected when the config is unset / null / \"latest\".\nconst NSIS_LATEST = \"2.0.4\"\n\n/** Which variant of a bundled NSIS toolset to use. */\nexport interface NsisToolsetOptions {\n /**\n * The target's `installerDebugLogging`: selects the log-enabled bundle (makensis and stubs compiled with `NSIS_CONFIG_LOG=yes`) for the\n * versions that publish one. Ignored for the other versions and for a custom bundle.\n */\n readonly debugLogging?: boolean\n}\n\nfunction getLegacyNsisBin(): Promise<string> {\n // Warning: Don't use v3.0.4.2 - https://github.com/electron-userland/electron-builder/issues/6334\n return downloadBuilderToolset({\n releaseName: \"nsis-3.0.4.1\",\n filenameWithExt: \"nsis-3.0.4.1.7z\",\n checksums: { \"nsis-3.0.4.1.7z\": \"9877df902530f96357d13a7a31ae2b9df67f48b11ffc9a1700a7c961574ec5fa\" },\n })\n}\n\nfunction getLegacyNsisResourcesBin(): Promise<string> {\n return downloadBuilderToolset({\n releaseName: \"nsis-resources-3.4.1\",\n filenameWithExt: \"nsis-resources-3.4.1.7z\",\n checksums: { \"nsis-resources-3.4.1.7z\": \"593a9a92ef958321293ac6a2ee61e64bf1bd543142a5bd6b3d310709cc924103\" },\n })\n}\n\nexport const nsisChecksums = {\n \"0.0.0\": {\n // legacy — uses getLegacyNsisBin() / getLegacyNsisResourcesBin()\n },\n \"1.2.1\": {\n // unified bundle\n \"nsis-bundle-3.12.tar.gz\": \"56997fdefe25e7928a1a68b4583d08b240b66cf660234053b20131a74cc082f4\",\n },\n // 2.0.4 replaces 2.0.3, whose bundles lacked the plugin and elevate.exe license files; it also has the Unicode nsisunz fix\n \"2.0.4\": {\n // unified bundle, NSIS 3.13 compiled from source: makensis (Linux, macOS, Windows) and the Windows stubs without NSIS_CONFIG_LOG\n \"nsis-bundle-3.13.tar.gz\": \"c18e9ad9684cf4c5bbd7b768cbf1b056d40771d7bd9ae1b513346452decf89d2\",\n // the same bundle with makensis and the Windows stubs compiled with NSIS_CONFIG_LOG=yes, for installerDebugLogging\n \"nsis-bundle-3.13-log.tar.gz\": \"1803e6d45c91f6ed7860935940073fdc7857d52f2dabe123352c4676aeb635c7\",\n },\n} as const\n\ntype NsisBundleVersion = Exclude<keyof typeof nsisChecksums, \"0.0.0\">\n\n/**\n * The bundle file of each unified version. `log` is the log-enabled variant, published from nsis@2.0.4 on; the bundles of the older\n * versions (the legacy NSIS 3.0.4.1 of \"0.0.0\" and the stock NSIS 3.12 of \"1.2.1\") are not log-enabled.\n */\nconst nsisBundleFiles: Record<NsisBundleVersion, { readonly file: string; readonly log?: string }> = {\n \"1.2.1\": { file: \"nsis-bundle-3.12.tar.gz\" },\n \"2.0.4\": { file: \"nsis-bundle-3.13.tar.gz\", log: \"nsis-bundle-3.13-log.tar.gz\" },\n}\n\n/**\n * Whether `toolsets.nsis` can provide a log-enabled NSIS, which `installerDebugLogging` needs. The default (unset / `\"latest\"`) and\n * `\"2.0.4\"` can (their `-log` bundle); the older pinned bundles (`\"0.0.0\"`, `\"1.2.1\"`) cannot. A custom bundle is assumed to be\n * log-enabled (makensis rejects `LogSet` if it is not).\n */\nexport function isNsisLoggingSupported(nsis: ToolsetConfig[\"nsis\"] | Nullish): boolean {\n if (typeof nsis === \"object\" && nsis != null) {\n return true\n }\n const resolved = resolveToolsetVersion(nsis, NSIS_LATEST)\n return resolved !== \"0.0.0\" && nsisBundleFiles[resolved]?.log != null\n}\n\n/**\n * `installerDebugLogging` emits `LogSet`, which only a `makensis` compiled with `NSIS_CONFIG_LOG=yes` accepts (\"LogSet specified,\n * NSIS_CONFIG_LOG not defined\" otherwise). nsis@2.0.4 and newer publish a log-enabled bundle next to the default one; the older pinned\n * bundles are not log-enabled.\n */\nexport function assertInstallerDebugLoggingSupported(nsis: ToolsetConfig[\"nsis\"] | Nullish, targetName: string): void {\n // a custom bundle and the default (unset / \"latest\") are always supported, so only a pinned bundled version is left here\n if (isNsisLoggingSupported(nsis) || typeof nsis !== \"string\") {\n return\n }\n throw new InvalidConfigurationError(\n `\\`installerDebugLogging\\` (${targetName} target) needs a log-enabled NSIS (makensis and stubs compiled with NSIS_CONFIG_LOG=yes), ` +\n `but \\`toolsets.nsis\\` is \"${nsis}\", which selects a bundled NSIS that has no log-enabled bundle.\\n` +\n ` Remove the \\`toolsets.nsis\\` pin (or set it to \"latest\" or \"${NSIS_LATEST}\") to use the log-enabled variant of the default bundle, supply a log-enabled custom ` +\n \"`toolsets.nsis: { url, checksum, version }`, or remove `installerDebugLogging`.\\n\" +\n \" https://www.electron.build/docs/migration/v27-config-changes#customnsisbinary-and-customnsisresources-replaced-by-toolsetsnsis\"\n )\n}\n\nasync function getNsisBundlePath(nsis: ToolsetConfig[\"nsis\"] | Nullish, resourcesDir: string, options: NsisToolsetOptions): Promise<string> {\n if (typeof nsis === \"object\" && nsis != null) {\n return getCustomToolsetPath(nsis, resourcesDir)\n }\n const resolved = resolveToolsetVersion(nsis, NSIS_LATEST)\n if (resolved === \"0.0.0\") {\n return getLegacyNsisBin()\n }\n const bundle = nsisBundleFiles[resolved]\n // The two bundles of a version download and extract to separate cache dirs (keyed by file name), so switching\n // installerDebugLogging never reuses the other variant. Versions without a log-enabled bundle always use their only bundle;\n // assertInstallerDebugLoggingSupported rejects installerDebugLogging for them before anything is built.\n const file = options.debugLogging === true && bundle.log != null ? bundle.log : bundle.file\n const checksums: Record<string, string> = nsisChecksums[resolved]\n return downloadBuilderToolset({\n releaseName: `nsis@${resolved}`,\n filenameWithExt: file,\n checksums: { [file]: checksums[file] },\n })\n}\n\nexport async function getMakeNsisPath(nsis: ToolsetConfig[\"nsis\"] | Nullish, resourcesDir: string, options: NsisToolsetOptions = {}): Promise<ToolInfo> {\n const legacyBundle = (bundlePath: string) => {\n // legacy bundle: platform-specific subdirectories, NSISDIR must be set explicitly\n const env = { NSISDIR: bundlePath }\n if (process.platform === \"darwin\") {\n return { path: path.resolve(bundlePath, \"mac\", \"makensis\"), env }\n } else if (process.platform === \"win32\") {\n return { path: path.resolve(bundlePath, \"Bin\", \"makensis.exe\"), env }\n }\n return { path: path.resolve(bundlePath, \"linux\", \"makensis\"), env }\n }\n const entrypointBundle = (bundlePath: string) => {\n // the entrypoint script auto-sets NSISDIR\n return { path: path.resolve(bundlePath, process.platform === \"win32\" ? \"makensis.cmd\" : \"makensis\") }\n }\n\n const bundlePath = await getNsisBundlePath(nsis, resourcesDir, options)\n if (nsis === \"0.0.0\") {\n return legacyBundle(bundlePath)\n }\n if (typeof nsis === \"object\") {\n const entrypoint = entrypointBundle(bundlePath)\n if (await exists(entrypoint.path)) {\n return entrypoint\n }\n return legacyBundle(bundlePath)\n }\n return entrypointBundle(bundlePath)\n}\n\nexport async function getNsisPluginsPath(nsis: ToolsetConfig[\"nsis\"] | Nullish, resourcesDir: string, options: NsisToolsetOptions = {}): Promise<string> {\n const resolvePluginsDir = async (bundlePath: string) => {\n const potentialPaths = [path.resolve(bundlePath, \"plugins\"), path.resolve(bundlePath, \"windows\", \"Plugins\")]\n for (const p of potentialPaths) {\n if ((await exists(p)) && (await stat(p)).isDirectory()) {\n return p\n }\n }\n throw new Error(`Plugins directory not found in NSIS bundle at: ${bundlePath}. Expected one of: ${potentialPaths.join(\", \")}`)\n }\n if (nsis === \"0.0.0\") {\n return path.resolve(await getLegacyNsisResourcesBin(), \"plugins\")\n }\n return resolvePluginsDir(await getNsisBundlePath(nsis, resourcesDir, options))\n}\n\nexport async function getNsisElevatePath(nsis: ToolsetConfig[\"nsis\"] | Nullish, resourcesDir: string, options: NsisToolsetOptions = {}): Promise<string> {\n const resolveElevate = async (dir: string) => {\n const p = path.resolve(dir, \"elevate.exe\")\n if ((await exists(p)) && (await stat(p)).isFile()) {\n return p\n }\n throw new Error(`elevate.exe not found in NSIS bundle at: ${dir}. Expected path: ${p}`)\n }\n return resolveElevate(await getNsisBundlePath(nsis, resourcesDir, options))\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Nullish } from "builder-util-runtime";
|
|
2
2
|
import { ToolsetConfig } from "../configuration.js";
|
|
3
3
|
import { ToolInfo } from "../util/bundledTool.js";
|
|
4
|
-
export declare const WIN_CODESIGN_LATEST = "1.3.
|
|
4
|
+
export declare const WIN_CODESIGN_LATEST = "1.3.3";
|
|
5
5
|
export declare const wincodesignChecksums: {
|
|
6
6
|
readonly "0.0.0": {};
|
|
7
7
|
readonly "1.0.0": {
|
|
@@ -71,6 +71,19 @@ export declare const wincodesignChecksums: {
|
|
|
71
71
|
readonly "win-codesign-windows-x64.zip": "830167112badff1bd5bf4759e0bac4d9f45a96c0cbb9b8e72e1f70187758516a";
|
|
72
72
|
readonly "windows-kits-bundle-10_0_26100_0.zip": "6a8a6211f02c0cd09118710e4a48ee411bd3cb2dbb8bd25cbd5f9e4afd9f556d";
|
|
73
73
|
};
|
|
74
|
+
readonly "1.3.3": {
|
|
75
|
+
readonly "ats-bundle-1_0_95.zip": "5695927ad1411f38e57fe1739475272192a6939f59c1e0525abc87b21f278035";
|
|
76
|
+
readonly "dotnet-runtime-win-x64-8_0_33.zip": "2e26d49416b0a4bd29f3f11f36aa971439b5e741ff40513fb1bc738a7bf3fd89";
|
|
77
|
+
readonly "rcedit-windows-2_0_0.zip": "99a37b6b54d0500b0ab9ca134b08a35faf8dfe4668b379c0091212815412504b";
|
|
78
|
+
readonly "win-codesign-darwin-arm64.zip": "94dd0ecf145103fc9039e3b73ee8eb40a71a9a637203657d55415e9f4f48b9a3";
|
|
79
|
+
readonly "win-codesign-darwin-x86_64.zip": "1b2f9300712e372ad2360c8cdd6cfaad9eabdc61cc95b26e68ea36be90ecc65f";
|
|
80
|
+
readonly "win-codesign-linux-amd64.zip": "5b55fa4853df581ec1ebc53f98c0e41d642a58a876a45fe35c86246ee964a534";
|
|
81
|
+
readonly "win-codesign-linux-arm64.zip": "a2e08d4a691429c92c3582d9d6d05fec67758e6e7c206e638f5d46d7a0c5c588";
|
|
82
|
+
readonly "win-codesign-linux-i386.zip": "1bb4fa33ebd18c58cdb6a9f96b08664337584529a8e8182071780b1fc0caebb5";
|
|
83
|
+
readonly "win-codesign-windows-arm64.zip": "49cb977a1f70c8bd5922db363ebc0736903f9574ab101ec39d943de45752baa7";
|
|
84
|
+
readonly "win-codesign-windows-x64.zip": "dcbb852ca7186be81ae374b2980f2df03655f208cce3a5ec95d064127de6a105";
|
|
85
|
+
readonly "windows-kits-bundle-10_0_26100_0.zip": "cf272921858dd134e997f4a372d413563e4375b2c4fceda06e7716fedb9e8bc7";
|
|
86
|
+
};
|
|
74
87
|
};
|
|
75
88
|
export declare function getSignToolPath(winCodeSign: ToolsetConfig["winCodeSign"] | Nullish, isWin: boolean, resourcesDir: string): Promise<ToolInfo>;
|
|
76
89
|
/**
|
|
@@ -100,6 +113,12 @@ export declare function isOldWin6(): boolean;
|
|
|
100
113
|
*/
|
|
101
114
|
export declare function isLegacyWinCodeSign(winCodeSign: ToolsetConfig["winCodeSign"] | Nullish): boolean;
|
|
102
115
|
export declare function getAtsBundleDir(winCodeSign: string): Promise<string>;
|
|
116
|
+
/**
|
|
117
|
+
* File name of the .NET runtime asset in a win-codesign release (>= 1.3.0), or `undefined` when that version ships none.
|
|
118
|
+
* The name carries the runtime version and changes between releases (1.3.0 / 1.3.1 ship `8_0_28`, 1.3.3 ships `8_0_33`),
|
|
119
|
+
* so it is looked up in that version's checksums instead of being hard-coded.
|
|
120
|
+
*/
|
|
121
|
+
export declare function getDotnetRuntimeAssetName(winCodeSign: string): string | undefined;
|
|
103
122
|
export declare function getDotnetRuntimeDir(winCodeSign: string): Promise<string>;
|
|
104
123
|
export declare function getRceditBundle(winCodeSign: ToolsetConfig["winCodeSign"] | Nullish, resourcesDir?: string): Promise<{
|
|
105
124
|
x86: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"winCodeSign.d.ts","sourceRoot":"","sources":["../../src/toolsets/winCodeSign.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAG9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAkB,MAAM,wBAAwB,CAAA;AAMjE,eAAO,MAAM,mBAAmB,UAAU,CAAA;AAU1C,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"winCodeSign.d.ts","sourceRoot":"","sources":["../../src/toolsets/winCodeSign.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAG9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAkB,MAAM,wBAAwB,CAAA;AAMjE,eAAO,MAAM,mBAAmB,UAAU,CAAA;AAU1C,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoFvB,CAAA;AAaV,wBAAsB,eAAe,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAOlJ;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE;IAAE,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE;;;GAevJ;AAED,wBAAgB,SAAS,YAGxB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,OAAO,GAAG,OAAO,CAEhG;AA2DD,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAW1E;AAID;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOjF;AAED,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAW9E;AAED,wBAAsB,eAAe,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,OAAO,EAAE,YAAY,SAAK;;;GAgB3G"}
|
|
@@ -6,7 +6,7 @@ import { downloadBuilderToolset } from "../util/electronGet.js";
|
|
|
6
6
|
import { getCustomToolsetPath } from "./custom.js";
|
|
7
7
|
import { resolveToolsetVersion } from "./version.js";
|
|
8
8
|
// Newest win-codesign bundle — selected when the config is unset / null / "latest".
|
|
9
|
-
export const WIN_CODESIGN_LATEST = "1.3.
|
|
9
|
+
export const WIN_CODESIGN_LATEST = "1.3.3";
|
|
10
10
|
function getLegacyWinCodeSignBin() {
|
|
11
11
|
return downloadBuilderToolset({
|
|
12
12
|
releaseName: "winCodeSign-2.6.0",
|
|
@@ -85,6 +85,19 @@ export const wincodesignChecksums = {
|
|
|
85
85
|
"win-codesign-windows-x64.zip": "830167112badff1bd5bf4759e0bac4d9f45a96c0cbb9b8e72e1f70187758516a",
|
|
86
86
|
"windows-kits-bundle-10_0_26100_0.zip": "6a8a6211f02c0cd09118710e4a48ee411bd3cb2dbb8bd25cbd5f9e4afd9f556d",
|
|
87
87
|
},
|
|
88
|
+
"1.3.3": {
|
|
89
|
+
"ats-bundle-1_0_95.zip": "5695927ad1411f38e57fe1739475272192a6939f59c1e0525abc87b21f278035",
|
|
90
|
+
"dotnet-runtime-win-x64-8_0_33.zip": "2e26d49416b0a4bd29f3f11f36aa971439b5e741ff40513fb1bc738a7bf3fd89",
|
|
91
|
+
"rcedit-windows-2_0_0.zip": "99a37b6b54d0500b0ab9ca134b08a35faf8dfe4668b379c0091212815412504b",
|
|
92
|
+
"win-codesign-darwin-arm64.zip": "94dd0ecf145103fc9039e3b73ee8eb40a71a9a637203657d55415e9f4f48b9a3",
|
|
93
|
+
"win-codesign-darwin-x86_64.zip": "1b2f9300712e372ad2360c8cdd6cfaad9eabdc61cc95b26e68ea36be90ecc65f",
|
|
94
|
+
"win-codesign-linux-amd64.zip": "5b55fa4853df581ec1ebc53f98c0e41d642a58a876a45fe35c86246ee964a534",
|
|
95
|
+
"win-codesign-linux-arm64.zip": "a2e08d4a691429c92c3582d9d6d05fec67758e6e7c206e638f5d46d7a0c5c588",
|
|
96
|
+
"win-codesign-linux-i386.zip": "1bb4fa33ebd18c58cdb6a9f96b08664337584529a8e8182071780b1fc0caebb5",
|
|
97
|
+
"win-codesign-windows-arm64.zip": "49cb977a1f70c8bd5922db363ebc0736903f9574ab101ec39d943de45752baa7",
|
|
98
|
+
"win-codesign-windows-x64.zip": "dcbb852ca7186be81ae374b2980f2df03655f208cce3a5ec95d064127de6a105",
|
|
99
|
+
"windows-kits-bundle-10_0_26100_0.zip": "cf272921858dd134e997f4a372d413563e4375b2c4fceda06e7716fedb9e8bc7",
|
|
100
|
+
},
|
|
88
101
|
};
|
|
89
102
|
function _getWindowsToolsBin(winCodeSign, file) {
|
|
90
103
|
const filenameWithExt = file;
|
|
@@ -206,16 +219,30 @@ export async function getAtsBundleDir(winCodeSign) {
|
|
|
206
219
|
checksums: { "ats-bundle-1_0_95.zip": checksum },
|
|
207
220
|
});
|
|
208
221
|
}
|
|
222
|
+
const DOTNET_RUNTIME_ASSET_PREFIX = "dotnet-runtime-win-x64-";
|
|
223
|
+
/**
|
|
224
|
+
* File name of the .NET runtime asset in a win-codesign release (>= 1.3.0), or `undefined` when that version ships none.
|
|
225
|
+
* The name carries the runtime version and changes between releases (1.3.0 / 1.3.1 ship `8_0_28`, 1.3.3 ships `8_0_33`),
|
|
226
|
+
* so it is looked up in that version's checksums instead of being hard-coded.
|
|
227
|
+
*/
|
|
228
|
+
export function getDotnetRuntimeAssetName(winCodeSign) {
|
|
229
|
+
const version = winCodeSign === "latest" ? WIN_CODESIGN_LATEST : winCodeSign;
|
|
230
|
+
if (!Object.prototype.hasOwnProperty.call(wincodesignChecksums, version)) {
|
|
231
|
+
return undefined;
|
|
232
|
+
}
|
|
233
|
+
const files = wincodesignChecksums[version];
|
|
234
|
+
return Object.keys(files).find(it => it.startsWith(DOTNET_RUNTIME_ASSET_PREFIX));
|
|
235
|
+
}
|
|
209
236
|
export async function getDotnetRuntimeDir(winCodeSign) {
|
|
210
237
|
const version = winCodeSign === "latest" ? WIN_CODESIGN_LATEST : winCodeSign;
|
|
211
|
-
const
|
|
212
|
-
if (
|
|
238
|
+
const file = getDotnetRuntimeAssetName(version);
|
|
239
|
+
if (file == null) {
|
|
213
240
|
throw new Error(`winCodeSign version "${version}" does not include a .NET runtime bundle (requires >= 1.3.0)`);
|
|
214
241
|
}
|
|
215
242
|
return downloadBuilderToolset({
|
|
216
243
|
releaseName: `win-codesign@${version}`,
|
|
217
|
-
filenameWithExt:
|
|
218
|
-
checksums: {
|
|
244
|
+
filenameWithExt: file,
|
|
245
|
+
checksums: { [file]: wincodesignChecksums[version][file] },
|
|
219
246
|
});
|
|
220
247
|
}
|
|
221
248
|
export async function getRceditBundle(winCodeSign, resourcesDir = "") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"winCodeSign.js","sourceRoot":"","sources":["../../src/toolsets/winCodeSign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEzE,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAY,cAAc,EAAE,MAAM,wBAAwB,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AG,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,CAAA;IAC7E,CAAC;IACD,MAAM,OAAO,GAAG,qBAAqB,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAA;IACvE,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,uBAAuB,EAAE,CAAC,CAAA;QACnE,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,CAAA;IAC9E,CAAC;IACD,MAAM,IAAI,GAAG,0BAA0B,CAAA;IACvC,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;IAC5E,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,CAAA;AAC7E,CAAC","sourcesContent":["import { InvalidConfigurationError, sanitizeDirPath } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport * as os from \"os\"\nimport * as path from \"path\"\nimport { ToolsetConfig } from \"../configuration.js\"\nimport { ToolInfo, computeToolEnv } from \"../util/bundledTool.js\"\nimport { downloadBuilderToolset } from \"../util/electronGet.js\"\nimport { getCustomToolsetPath } from \"./custom.js\"\nimport { resolveToolsetVersion } from \"./version.js\"\n\n// Newest win-codesign bundle — selected when the config is unset / null / \"latest\".\nexport const WIN_CODESIGN_LATEST = \"1.3.1\"\n\nfunction getLegacyWinCodeSignBin(): Promise<string> {\n return downloadBuilderToolset({\n releaseName: \"winCodeSign-2.6.0\",\n filenameWithExt: \"winCodeSign-2.6.0.7z\",\n checksums: { [\"winCodeSign-2.6.0.7z\"]: \"cdaec7154dda7cc31f88d886e2489379a0625a737d610b5ae7f62a12f16743a4\" },\n })\n}\n\nexport const wincodesignChecksums = {\n \"0.0.0\": {\n // legacy — downloads winCodeSign-2.6.0 via getLegacyWinCodeSignBin()\n },\n \"1.0.0\": {\n \"rcedit-windows-2_0_0.zip\": \"589709935902545a8335190b08644cf61b46a9042e34c0c3ef0660a5aeddeaae\",\n \"win-codesign-darwin-arm64.zip\": \"7eb41c3e6e48a75ced6b3384de22185da4bb458960fa410970eedd4e838c5c14\",\n \"win-codesign-darwin-x86_64.zip\": \"3986c97429f002df63490193d7f787281836f055934e3cdd9e69c70a8acb695e\",\n \"win-codesign-linux-amd64.zip\": \"d362a1a981053841554867e3e9dff51fe420fd577b44653df89bd7d3c916b156\",\n \"win-codesign-linux-arm64.zip\": \"fb848d498281f081c937be48dd6ddaf49b0201f32210dfc816ad061c47ecd37b\",\n \"win-codesign-linux-i386.zip\": \"11f8d9ffbf5b01e3bf6321c6d93b9b5e43d0c2d2a9fde1bca07698f2eb967cdf\",\n \"win-codesign-windows-x64.zip\": \"1bd27f9fa553cb14bec8df530cb3caffcfb095f9dd187dab6eaf5e9b7d6e7bff\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"1a12c81024c3499c212fdc5fac34a918e6d199271a39dfc524f6d8da484329bd\",\n },\n \"1.1.0\": {\n \"rcedit-windows-2_0_0.zip\": \"c66591ebe0919c60231f0bf79ff223e6504bfa69bc13edc1fa8bfc6177b73402\",\n \"win-codesign-darwin-arm64.zip\": \"3f263b0e53cdc5410f6165471b2e808aee3148dc792efa23a7c303e7a01e67b7\",\n \"win-codesign-darwin-x86_64.zip\": \"143fbdfcbc53bc273fa181356be8416829778452621484d39eadbe1ce49979ba\",\n \"win-codesign-linux-amd64.zip\": \"65477fe8e40709b0f998928afb8336f82413b123310bf5adaa8efb7ed6ed0eeb\",\n \"win-codesign-linux-arm64.zip\": \"575b01a966f2b775bbea119de263957378e2bd28cbd064d35f9e981827e37b59\",\n \"win-codesign-linux-i386.zip\": \"aa3ce90e9aaa3449a228a3fa30633cdeb6b2791913786677a85c59db1d985598\",\n \"win-codesign-windows-x64.zip\": \"6e5dcc5d7af7c00a7387e2101d1ad986aef80e963a3526da07bd0e65de484c30\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"284f18a2fde66e6ecfbefc3065926c9bfdf641761a9e6cd2bd26e18d1e328bf7\",\n },\n \"1.1.1\": {\n \"rcedit-windows-2_0_0.zip\": \"a4133c265a53a8a6d5063c6d92603dc2dcd47546e50bfd79c93bc56692d6fcb3\",\n \"win-codesign-darwin-arm64.zip\": \"8c655fe77edb326fb6b7051a6f74b0f09843f7d3de7887c1d217088cff47ece6\",\n \"win-codesign-darwin-x86_64.zip\": \"b5882783c910e10b18792ea8c319fa8d6ce9dbbdd0d6a283a504787b3e9e96c6\",\n \"win-codesign-linux-amd64.zip\": \"8e0c05c33b3fb24d41ac41d37b0c70ad9f8c1c82bb667ed60c2a6a8d141b7c62\",\n \"win-codesign-linux-arm64.zip\": \"535f318b8aac1c9487e0f8b58df0a4182103e303ccaca1c9d0ef20b1020e03ca\",\n \"win-codesign-linux-i386.zip\": \"e432f2819f557f9d1175e26f374eec8a368eb23b519c12c690a969ce369966c5\",\n \"win-codesign-windows-x64.zip\": \"47d78ed7e229e891866b0d0e10dde6df9617c32a89fc76a9e280ffabfc80e1fe\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"f7e67213ce690386b2f0a58e3af986dbf223bc1b45ef4a75e77ff85f66b78c94\",\n },\n \"1.2.1\": {\n \"rcedit-windows-2_0_0.zip\": \"1c2b68b9ae41229566c008ce98c4f6cd2b642ace85284e753d1d3509377f9e67\",\n \"win-codesign-darwin-arm64.zip\": \"ac7c1d9279490fc88e9e744ed965ad7e1d377e0219142dab0ab49cfba3ede764\",\n \"win-codesign-darwin-x86_64.zip\": \"7c4188bb301621cde22f918bb2d1a86ef9892ad401a40b7838b80efc9165547d\",\n \"win-codesign-linux-amd64.zip\": \"69b94f71f9189ded6b962718df102e0ffe0a81d506351fecd3df3d73c7166e31\",\n \"win-codesign-linux-arm64.zip\": \"c959031605a5ab994bfd9b84d37bc5bcaba8f39d54a6d69bd2541b2a91ecf723\",\n \"win-codesign-linux-i386.zip\": \"fc937f40655b9839b67ed35cc7b571795b3f7b7b15db10c3026599db43f1c2b1\",\n \"win-codesign-windows-arm64.zip\": \"96390eb3130e63ea9d3641ef076c941c6f51463125498cf53b2503e52c38082d\",\n \"win-codesign-windows-x64.zip\": \"40b1d88ea074de58ddc7595a2b6d30ca23f81bcce33f110102304337538fcbeb\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"9b198db76ae75b124169aef3369fb96c17b39dbf16f16f1264dbd9fd001d976f\",\n },\n \"1.3.0\": {\n \"ats-bundle-1_0_95.zip\": \"93e1441cd8c60f7b7a57a3e0e20a2109994e33a7f42bd04c998204a1928f9f2f\", // new\n \"dotnet-runtime-win-x64-8_0_28.zip\": \"71b9aa960ebaae196a62ec0bb1a4d224e1b48e18b6dc5eed89a37b28b72965ee\", // new\n \"rcedit-windows-2_0_0.zip\": \"84ea279c5d94977fecffbe0f21b073318575dc631a3dae46fadb14309f2eef11\",\n \"win-codesign-darwin-arm64.zip\": \"c5c1e1e106a5feff27d320c57856e362d8f605c09c7c02fc42d9309b72c56372\",\n \"win-codesign-darwin-x86_64.zip\": \"4fd5af2c4c655257685fad1769457419e086ec0862ee36f893b3659e1788c8ca\",\n \"win-codesign-linux-amd64.zip\": \"58c708762b3088a2c6c98494c4813e2a1d030a314a7958c77a2806d58e5efe95\",\n \"win-codesign-linux-arm64.zip\": \"1e9dd1ae149a4e0c988b5529fb983d7a8265cd71e7f3fb5af4cce501005a670c\",\n \"win-codesign-linux-i386.zip\": \"b5c3249fb565bb956a48aaff01bc1bbbd9acaf3c981960f2b754210f9df95cd9\",\n \"win-codesign-windows-arm64.zip\": \"c707709440a07e400b4053d9bab77c9f335505c1701035c2aa8285d880360989\",\n \"win-codesign-windows-x64.zip\": \"40d621aad7593e6298ce1d24798760dcefb053f358be891d74c95386ac2ac50b\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"2eeb955e580103e1bbecf9666dca87b141c3bb73ad99ead64bb8821755694ecd\",\n },\n \"1.3.1\": {\n \"ats-bundle-1_0_95.zip\": \"233230cefef263e2c9cc03e8c480bd8dcfe7ff3518e3c591dbb24fc21c1370e7\",\n \"dotnet-runtime-win-x64-8_0_28.zip\": \"9de4bdfdf33d98afb73947a8c013eb1511af0d6e1051bfc4921fbe2d34426308\",\n \"rcedit-windows-2_0_0.zip\": \"eb975970b1295a960ba5d428693f9aa548fc00b16ae441fb8cc97abedb7cb4b9\",\n \"win-codesign-darwin-arm64.zip\": \"cda6c58a81fd86c4a5474c2da2d1b450b40805b3eef6974f5a6a3af7ece2b811\",\n \"win-codesign-darwin-x86_64.zip\": \"9e07f6f7a4fd096b868e8cf2d6f06f50d9decf03fcbf6b39d3045688ccddb1f5\",\n \"win-codesign-linux-amd64.zip\": \"8443dfd4acf811b2d7eb8420fdd500c07058f507cc65ee9a6b215f833acba659\",\n \"win-codesign-linux-arm64.zip\": \"f7f287533cb302f4230960a3b2915ec5ae165f0089ddacf1940d8aa44c049fa6\",\n \"win-codesign-linux-i386.zip\": \"45649f83d9378d39123620982fd7fe15cc9ba4fb8f4009fb697f03ff02f06545\",\n \"win-codesign-windows-arm64.zip\": \"9daee4e5359371d8566639be70251abebe6ddbed82054e2ecd1812bd0d879291\",\n \"win-codesign-windows-x64.zip\": \"830167112badff1bd5bf4759e0bac4d9f45a96c0cbb9b8e72e1f70187758516a\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"6a8a6211f02c0cd09118710e4a48ee411bd3cb2dbb8bd25cbd5f9e4afd9f556d\",\n },\n} as const\n\ntype CodeSignVersionKey = keyof typeof wincodesignChecksums\n\nfunction _getWindowsToolsBin<V extends CodeSignVersionKey>(winCodeSign: V, file: keyof (typeof wincodesignChecksums)[V]): Promise<string> {\n const filenameWithExt = file as string\n return downloadBuilderToolset({\n releaseName: `win-codesign@${winCodeSign}`,\n filenameWithExt,\n checksums: { [filenameWithExt]: wincodesignChecksums[winCodeSign][file] as string },\n })\n}\n\nexport async function getSignToolPath(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish, isWin: boolean, resourcesDir: string): Promise<ToolInfo> {\n if (isWin) {\n return { path: await getWindowsSignToolExe({ winCodeSign, resourcesDir }) }\n } else {\n const vendor = await getOsslSigncodeBundle(winCodeSign, resourcesDir)\n return { path: vendor.path, env: vendor.env }\n }\n}\n\n/**\n * Resolve the Windows Kits bundle paths.\n *\n * The `kit` subdirectory holds HOST executables (`signtool.exe` / `makeappx.exe` / `makepri.exe`), so\n * it is always the x64 kit (x86 on 32-bit hosts) — never arm64. x64 binaries run on x64 hosts natively\n * and on arm64 Windows via emulation, whereas an arm64 binary cannot run on an x64 host and fails with\n * `spawn UNKNOWN`. The artifact's target arch is irrelevant here.\n * `appxAssets` is arch-independent (the bundle root).\n */\nexport async function getWindowsKitsBundle({ winCodeSign, resourcesDir }: { winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish; resourcesDir?: string }) {\n const kitArch = process.arch === \"ia32\" ? \"x86\" : \"x64\"\n if (typeof winCodeSign === \"object\" && winCodeSign != null) {\n const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined)\n return { kit: path.join(vendorPath, kitArch), appxAssets: vendorPath }\n }\n\n const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST)\n if (version === \"0.0.0\") {\n const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin())\n return { kit: path.join(vendorPath, \"windows-10\", kitArch), appxAssets: vendorPath }\n }\n const file = \"windows-kits-bundle-10_0_26100_0.zip\"\n const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file))\n return { kit: path.join(vendorPath, kitArch), appxAssets: vendorPath }\n}\n\nexport function isOldWin6() {\n const winVersion = os.release()\n return winVersion.startsWith(\"6.\") && !winVersion.startsWith(\"6.3\")\n}\n\n/**\n * True only for the explicit legacy winCodeSign pin (`\"0.0.0\"` → winCodeSign-2.6.0). That bundle lacks\n * the modern Windows Kits SDK (no MSIX-capable `makeappx`/`makepri`), so it cannot build MSIX — only the\n * MSIX target gates on this. AppX still builds fine with the legacy bundle (it has its own legacy-bundle\n * `signtool` handling in `getWindowsSignToolExe`). Unset / `null` / `\"latest\"` and any modern version pin\n * resolve to a modern bundle; a custom `{ url, … }` toolset is the caller's responsibility and is not\n * treated as legacy.\n */\nexport function isLegacyWinCodeSign(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish): boolean {\n return typeof winCodeSign !== \"object\" && resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST) === \"0.0.0\"\n}\n\nasync function getWindowsSignToolExe({ winCodeSign, resourcesDir = \"\" }: { winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish; resourcesDir?: string }) {\n if (typeof winCodeSign !== \"object\" && resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST) === \"0.0.0\") {\n // use modern signtool on Windows Server 2012 R2 to be able to sign AppX\n const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin())\n if (isOldWin6()) {\n return path.join(vendorPath, \"windows-6\", \"signtool.exe\")\n } else {\n return path.join(vendorPath, \"windows-10\", process.arch === \"ia32\" ? \"ia32\" : \"x64\", \"signtool.exe\")\n }\n }\n // kit is already sanitized by getWindowsKitsBundle\n const { kit } = await getWindowsKitsBundle({ winCodeSign, resourcesDir })\n return path.join(kit, \"signtool.exe\")\n}\n\nasync function getOsslSigncodeBundle(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish, resourcesDir = \"\") {\n // A custom toolset is an explicit user override — honored on every platform, before any platform default/fallback.\n if (typeof winCodeSign === \"object\" && winCodeSign != null) {\n const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined)\n return { path: path.join(vendorPath, \"osslsigncode\") }\n }\n\n if (process.platform === \"win32\") {\n // Unreachable in normal flow: osslsigncode is only requested when the host is not Windows (Windows signs via\n // signtool). Kept as defense-in-depth — fail loudly instead of resolving a bare `osslsigncode` from $PATH.\n throw new InvalidConfigurationError(\n `osslsigncode is not used on Windows (signing uses signtool). To override, configure a custom toolset: toolsets: { winCodeSign: { url: \"file:///absolute/path/to/dir\" } }`\n )\n }\n\n const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST)\n if (version === \"0.0.0\") {\n const legacyBase = sanitizeDirPath(await getLegacyWinCodeSignBin())\n const vendorBase = path.join(legacyBase, process.platform)\n const vendorPath = process.platform === \"darwin\" ? path.join(vendorBase, \"10.12\") : vendorBase\n return { path: path.join(vendorPath, \"osslsigncode\"), env: process.platform === \"darwin\" ? computeToolEnv([path.join(vendorPath, \"lib\")]) : undefined }\n }\n\n const file = (() => {\n if (process.platform === \"linux\") {\n if (process.arch == \"x64\") {\n return \"win-codesign-linux-amd64.zip\"\n } else if (process.arch === \"arm64\") {\n return \"win-codesign-linux-arm64.zip\"\n }\n return \"win-codesign-linux-i386.zip\"\n }\n // darwin arm64\n if (process.arch === \"arm64\") {\n return \"win-codesign-darwin-arm64.zip\"\n }\n return \"win-codesign-darwin-x86_64.zip\"\n })()\n const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file))\n return { path: path.join(vendorPath, \"osslsigncode\") }\n}\n\nexport async function getAtsBundleDir(winCodeSign: string): Promise<string> {\n const version = winCodeSign === \"latest\" ? WIN_CODESIGN_LATEST : winCodeSign\n const checksum = (wincodesignChecksums as Record<string, Record<string, string>>)[version]?.[\"ats-bundle-1_0_95.zip\"]\n if (!checksum) {\n throw new Error(`winCodeSign version \"${version}\" does not include an ATS bundle (requires >= 1.3.0)`)\n }\n return downloadBuilderToolset({\n releaseName: `win-codesign@${version}`,\n filenameWithExt: \"ats-bundle-1_0_95.zip\",\n checksums: { \"ats-bundle-1_0_95.zip\": checksum },\n })\n}\n\nexport async function getDotnetRuntimeDir(winCodeSign: string): Promise<string> {\n const version = winCodeSign === \"latest\" ? WIN_CODESIGN_LATEST : winCodeSign\n const checksum = (wincodesignChecksums as Record<string, Record<string, string>>)[version]?.[\"dotnet-runtime-win-x64-8_0_28.zip\"]\n if (!checksum) {\n throw new Error(`winCodeSign version \"${version}\" does not include a .NET runtime bundle (requires >= 1.3.0)`)\n }\n return downloadBuilderToolset({\n releaseName: `win-codesign@${version}`,\n filenameWithExt: \"dotnet-runtime-win-x64-8_0_28.zip\",\n checksums: { \"dotnet-runtime-win-x64-8_0_28.zip\": checksum },\n })\n}\n\nexport async function getRceditBundle(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish, resourcesDir = \"\") {\n const ia32 = \"rcedit-ia32.exe\"\n const x86 = \"rcedit-x86.exe\"\n const x64 = \"rcedit-x64.exe\"\n if (typeof winCodeSign === \"object\" && winCodeSign != null) {\n const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined)\n return { x86: path.join(vendorPath, x86), x64: path.join(vendorPath, x64) }\n }\n const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST)\n if (version === \"0.0.0\") {\n const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin())\n return { x86: path.join(vendorPath, ia32), x64: path.join(vendorPath, x64) }\n }\n const file = \"rcedit-windows-2_0_0.zip\"\n const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file))\n return { x86: path.join(vendorPath, x86), x64: path.join(vendorPath, x64) }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"winCodeSign.js","sourceRoot":"","sources":["../../src/toolsets/winCodeSign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEzE,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,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QACnE,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,CAAA;IAC9E,CAAC;IACD,MAAM,IAAI,GAAG,0BAA0B,CAAA;IACvC,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;IAC5E,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,CAAA;AAC7E,CAAC","sourcesContent":["import { InvalidConfigurationError, sanitizeDirPath } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport * as os from \"os\"\nimport * as path from \"path\"\nimport { ToolsetConfig } from \"../configuration.js\"\nimport { ToolInfo, computeToolEnv } from \"../util/bundledTool.js\"\nimport { downloadBuilderToolset } from \"../util/electronGet.js\"\nimport { getCustomToolsetPath } from \"./custom.js\"\nimport { resolveToolsetVersion } from \"./version.js\"\n\n// Newest win-codesign bundle — selected when the config is unset / null / \"latest\".\nexport const WIN_CODESIGN_LATEST = \"1.3.3\"\n\nfunction getLegacyWinCodeSignBin(): Promise<string> {\n return downloadBuilderToolset({\n releaseName: \"winCodeSign-2.6.0\",\n filenameWithExt: \"winCodeSign-2.6.0.7z\",\n checksums: { [\"winCodeSign-2.6.0.7z\"]: \"cdaec7154dda7cc31f88d886e2489379a0625a737d610b5ae7f62a12f16743a4\" },\n })\n}\n\nexport const wincodesignChecksums = {\n \"0.0.0\": {\n // legacy — downloads winCodeSign-2.6.0 via getLegacyWinCodeSignBin()\n },\n \"1.0.0\": {\n \"rcedit-windows-2_0_0.zip\": \"589709935902545a8335190b08644cf61b46a9042e34c0c3ef0660a5aeddeaae\",\n \"win-codesign-darwin-arm64.zip\": \"7eb41c3e6e48a75ced6b3384de22185da4bb458960fa410970eedd4e838c5c14\",\n \"win-codesign-darwin-x86_64.zip\": \"3986c97429f002df63490193d7f787281836f055934e3cdd9e69c70a8acb695e\",\n \"win-codesign-linux-amd64.zip\": \"d362a1a981053841554867e3e9dff51fe420fd577b44653df89bd7d3c916b156\",\n \"win-codesign-linux-arm64.zip\": \"fb848d498281f081c937be48dd6ddaf49b0201f32210dfc816ad061c47ecd37b\",\n \"win-codesign-linux-i386.zip\": \"11f8d9ffbf5b01e3bf6321c6d93b9b5e43d0c2d2a9fde1bca07698f2eb967cdf\",\n \"win-codesign-windows-x64.zip\": \"1bd27f9fa553cb14bec8df530cb3caffcfb095f9dd187dab6eaf5e9b7d6e7bff\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"1a12c81024c3499c212fdc5fac34a918e6d199271a39dfc524f6d8da484329bd\",\n },\n \"1.1.0\": {\n \"rcedit-windows-2_0_0.zip\": \"c66591ebe0919c60231f0bf79ff223e6504bfa69bc13edc1fa8bfc6177b73402\",\n \"win-codesign-darwin-arm64.zip\": \"3f263b0e53cdc5410f6165471b2e808aee3148dc792efa23a7c303e7a01e67b7\",\n \"win-codesign-darwin-x86_64.zip\": \"143fbdfcbc53bc273fa181356be8416829778452621484d39eadbe1ce49979ba\",\n \"win-codesign-linux-amd64.zip\": \"65477fe8e40709b0f998928afb8336f82413b123310bf5adaa8efb7ed6ed0eeb\",\n \"win-codesign-linux-arm64.zip\": \"575b01a966f2b775bbea119de263957378e2bd28cbd064d35f9e981827e37b59\",\n \"win-codesign-linux-i386.zip\": \"aa3ce90e9aaa3449a228a3fa30633cdeb6b2791913786677a85c59db1d985598\",\n \"win-codesign-windows-x64.zip\": \"6e5dcc5d7af7c00a7387e2101d1ad986aef80e963a3526da07bd0e65de484c30\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"284f18a2fde66e6ecfbefc3065926c9bfdf641761a9e6cd2bd26e18d1e328bf7\",\n },\n \"1.1.1\": {\n \"rcedit-windows-2_0_0.zip\": \"a4133c265a53a8a6d5063c6d92603dc2dcd47546e50bfd79c93bc56692d6fcb3\",\n \"win-codesign-darwin-arm64.zip\": \"8c655fe77edb326fb6b7051a6f74b0f09843f7d3de7887c1d217088cff47ece6\",\n \"win-codesign-darwin-x86_64.zip\": \"b5882783c910e10b18792ea8c319fa8d6ce9dbbdd0d6a283a504787b3e9e96c6\",\n \"win-codesign-linux-amd64.zip\": \"8e0c05c33b3fb24d41ac41d37b0c70ad9f8c1c82bb667ed60c2a6a8d141b7c62\",\n \"win-codesign-linux-arm64.zip\": \"535f318b8aac1c9487e0f8b58df0a4182103e303ccaca1c9d0ef20b1020e03ca\",\n \"win-codesign-linux-i386.zip\": \"e432f2819f557f9d1175e26f374eec8a368eb23b519c12c690a969ce369966c5\",\n \"win-codesign-windows-x64.zip\": \"47d78ed7e229e891866b0d0e10dde6df9617c32a89fc76a9e280ffabfc80e1fe\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"f7e67213ce690386b2f0a58e3af986dbf223bc1b45ef4a75e77ff85f66b78c94\",\n },\n \"1.2.1\": {\n \"rcedit-windows-2_0_0.zip\": \"1c2b68b9ae41229566c008ce98c4f6cd2b642ace85284e753d1d3509377f9e67\",\n \"win-codesign-darwin-arm64.zip\": \"ac7c1d9279490fc88e9e744ed965ad7e1d377e0219142dab0ab49cfba3ede764\",\n \"win-codesign-darwin-x86_64.zip\": \"7c4188bb301621cde22f918bb2d1a86ef9892ad401a40b7838b80efc9165547d\",\n \"win-codesign-linux-amd64.zip\": \"69b94f71f9189ded6b962718df102e0ffe0a81d506351fecd3df3d73c7166e31\",\n \"win-codesign-linux-arm64.zip\": \"c959031605a5ab994bfd9b84d37bc5bcaba8f39d54a6d69bd2541b2a91ecf723\",\n \"win-codesign-linux-i386.zip\": \"fc937f40655b9839b67ed35cc7b571795b3f7b7b15db10c3026599db43f1c2b1\",\n \"win-codesign-windows-arm64.zip\": \"96390eb3130e63ea9d3641ef076c941c6f51463125498cf53b2503e52c38082d\",\n \"win-codesign-windows-x64.zip\": \"40b1d88ea074de58ddc7595a2b6d30ca23f81bcce33f110102304337538fcbeb\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"9b198db76ae75b124169aef3369fb96c17b39dbf16f16f1264dbd9fd001d976f\",\n },\n \"1.3.0\": {\n \"ats-bundle-1_0_95.zip\": \"93e1441cd8c60f7b7a57a3e0e20a2109994e33a7f42bd04c998204a1928f9f2f\", // new\n \"dotnet-runtime-win-x64-8_0_28.zip\": \"71b9aa960ebaae196a62ec0bb1a4d224e1b48e18b6dc5eed89a37b28b72965ee\", // new\n \"rcedit-windows-2_0_0.zip\": \"84ea279c5d94977fecffbe0f21b073318575dc631a3dae46fadb14309f2eef11\",\n \"win-codesign-darwin-arm64.zip\": \"c5c1e1e106a5feff27d320c57856e362d8f605c09c7c02fc42d9309b72c56372\",\n \"win-codesign-darwin-x86_64.zip\": \"4fd5af2c4c655257685fad1769457419e086ec0862ee36f893b3659e1788c8ca\",\n \"win-codesign-linux-amd64.zip\": \"58c708762b3088a2c6c98494c4813e2a1d030a314a7958c77a2806d58e5efe95\",\n \"win-codesign-linux-arm64.zip\": \"1e9dd1ae149a4e0c988b5529fb983d7a8265cd71e7f3fb5af4cce501005a670c\",\n \"win-codesign-linux-i386.zip\": \"b5c3249fb565bb956a48aaff01bc1bbbd9acaf3c981960f2b754210f9df95cd9\",\n \"win-codesign-windows-arm64.zip\": \"c707709440a07e400b4053d9bab77c9f335505c1701035c2aa8285d880360989\",\n \"win-codesign-windows-x64.zip\": \"40d621aad7593e6298ce1d24798760dcefb053f358be891d74c95386ac2ac50b\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"2eeb955e580103e1bbecf9666dca87b141c3bb73ad99ead64bb8821755694ecd\",\n },\n \"1.3.1\": {\n \"ats-bundle-1_0_95.zip\": \"233230cefef263e2c9cc03e8c480bd8dcfe7ff3518e3c591dbb24fc21c1370e7\",\n \"dotnet-runtime-win-x64-8_0_28.zip\": \"9de4bdfdf33d98afb73947a8c013eb1511af0d6e1051bfc4921fbe2d34426308\",\n \"rcedit-windows-2_0_0.zip\": \"eb975970b1295a960ba5d428693f9aa548fc00b16ae441fb8cc97abedb7cb4b9\",\n \"win-codesign-darwin-arm64.zip\": \"cda6c58a81fd86c4a5474c2da2d1b450b40805b3eef6974f5a6a3af7ece2b811\",\n \"win-codesign-darwin-x86_64.zip\": \"9e07f6f7a4fd096b868e8cf2d6f06f50d9decf03fcbf6b39d3045688ccddb1f5\",\n \"win-codesign-linux-amd64.zip\": \"8443dfd4acf811b2d7eb8420fdd500c07058f507cc65ee9a6b215f833acba659\",\n \"win-codesign-linux-arm64.zip\": \"f7f287533cb302f4230960a3b2915ec5ae165f0089ddacf1940d8aa44c049fa6\",\n \"win-codesign-linux-i386.zip\": \"45649f83d9378d39123620982fd7fe15cc9ba4fb8f4009fb697f03ff02f06545\",\n \"win-codesign-windows-arm64.zip\": \"9daee4e5359371d8566639be70251abebe6ddbed82054e2ecd1812bd0d879291\",\n \"win-codesign-windows-x64.zip\": \"830167112badff1bd5bf4759e0bac4d9f45a96c0cbb9b8e72e1f70187758516a\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"6a8a6211f02c0cd09118710e4a48ee411bd3cb2dbb8bd25cbd5f9e4afd9f556d\",\n },\n \"1.3.3\": {\n \"ats-bundle-1_0_95.zip\": \"5695927ad1411f38e57fe1739475272192a6939f59c1e0525abc87b21f278035\",\n \"dotnet-runtime-win-x64-8_0_33.zip\": \"2e26d49416b0a4bd29f3f11f36aa971439b5e741ff40513fb1bc738a7bf3fd89\",\n \"rcedit-windows-2_0_0.zip\": \"99a37b6b54d0500b0ab9ca134b08a35faf8dfe4668b379c0091212815412504b\",\n \"win-codesign-darwin-arm64.zip\": \"94dd0ecf145103fc9039e3b73ee8eb40a71a9a637203657d55415e9f4f48b9a3\",\n \"win-codesign-darwin-x86_64.zip\": \"1b2f9300712e372ad2360c8cdd6cfaad9eabdc61cc95b26e68ea36be90ecc65f\",\n \"win-codesign-linux-amd64.zip\": \"5b55fa4853df581ec1ebc53f98c0e41d642a58a876a45fe35c86246ee964a534\",\n \"win-codesign-linux-arm64.zip\": \"a2e08d4a691429c92c3582d9d6d05fec67758e6e7c206e638f5d46d7a0c5c588\",\n \"win-codesign-linux-i386.zip\": \"1bb4fa33ebd18c58cdb6a9f96b08664337584529a8e8182071780b1fc0caebb5\",\n \"win-codesign-windows-arm64.zip\": \"49cb977a1f70c8bd5922db363ebc0736903f9574ab101ec39d943de45752baa7\",\n \"win-codesign-windows-x64.zip\": \"dcbb852ca7186be81ae374b2980f2df03655f208cce3a5ec95d064127de6a105\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"cf272921858dd134e997f4a372d413563e4375b2c4fceda06e7716fedb9e8bc7\",\n },\n} as const\n\ntype CodeSignVersionKey = keyof typeof wincodesignChecksums\n\nfunction _getWindowsToolsBin<V extends CodeSignVersionKey>(winCodeSign: V, file: keyof (typeof wincodesignChecksums)[V]): Promise<string> {\n const filenameWithExt = file as string\n return downloadBuilderToolset({\n releaseName: `win-codesign@${winCodeSign}`,\n filenameWithExt,\n checksums: { [filenameWithExt]: wincodesignChecksums[winCodeSign][file] as string },\n })\n}\n\nexport async function getSignToolPath(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish, isWin: boolean, resourcesDir: string): Promise<ToolInfo> {\n if (isWin) {\n return { path: await getWindowsSignToolExe({ winCodeSign, resourcesDir }) }\n } else {\n const vendor = await getOsslSigncodeBundle(winCodeSign, resourcesDir)\n return { path: vendor.path, env: vendor.env }\n }\n}\n\n/**\n * Resolve the Windows Kits bundle paths.\n *\n * The `kit` subdirectory holds HOST executables (`signtool.exe` / `makeappx.exe` / `makepri.exe`), so\n * it is always the x64 kit (x86 on 32-bit hosts) — never arm64. x64 binaries run on x64 hosts natively\n * and on arm64 Windows via emulation, whereas an arm64 binary cannot run on an x64 host and fails with\n * `spawn UNKNOWN`. The artifact's target arch is irrelevant here.\n * `appxAssets` is arch-independent (the bundle root).\n */\nexport async function getWindowsKitsBundle({ winCodeSign, resourcesDir }: { winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish; resourcesDir?: string }) {\n const kitArch = process.arch === \"ia32\" ? \"x86\" : \"x64\"\n if (typeof winCodeSign === \"object\" && winCodeSign != null) {\n const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined)\n return { kit: path.join(vendorPath, kitArch), appxAssets: vendorPath }\n }\n\n const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST)\n if (version === \"0.0.0\") {\n const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin())\n return { kit: path.join(vendorPath, \"windows-10\", kitArch), appxAssets: vendorPath }\n }\n const file = \"windows-kits-bundle-10_0_26100_0.zip\"\n const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file))\n return { kit: path.join(vendorPath, kitArch), appxAssets: vendorPath }\n}\n\nexport function isOldWin6() {\n const winVersion = os.release()\n return winVersion.startsWith(\"6.\") && !winVersion.startsWith(\"6.3\")\n}\n\n/**\n * True only for the explicit legacy winCodeSign pin (`\"0.0.0\"` → winCodeSign-2.6.0). That bundle lacks\n * the modern Windows Kits SDK (no MSIX-capable `makeappx`/`makepri`), so it cannot build MSIX — only the\n * MSIX target gates on this. AppX still builds fine with the legacy bundle (it has its own legacy-bundle\n * `signtool` handling in `getWindowsSignToolExe`). Unset / `null` / `\"latest\"` and any modern version pin\n * resolve to a modern bundle; a custom `{ url, … }` toolset is the caller's responsibility and is not\n * treated as legacy.\n */\nexport function isLegacyWinCodeSign(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish): boolean {\n return typeof winCodeSign !== \"object\" && resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST) === \"0.0.0\"\n}\n\nasync function getWindowsSignToolExe({ winCodeSign, resourcesDir = \"\" }: { winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish; resourcesDir?: string }) {\n if (typeof winCodeSign !== \"object\" && resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST) === \"0.0.0\") {\n // use modern signtool on Windows Server 2012 R2 to be able to sign AppX\n const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin())\n if (isOldWin6()) {\n return path.join(vendorPath, \"windows-6\", \"signtool.exe\")\n } else {\n return path.join(vendorPath, \"windows-10\", process.arch === \"ia32\" ? \"ia32\" : \"x64\", \"signtool.exe\")\n }\n }\n // kit is already sanitized by getWindowsKitsBundle\n const { kit } = await getWindowsKitsBundle({ winCodeSign, resourcesDir })\n return path.join(kit, \"signtool.exe\")\n}\n\nasync function getOsslSigncodeBundle(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish, resourcesDir = \"\") {\n // A custom toolset is an explicit user override — honored on every platform, before any platform default/fallback.\n if (typeof winCodeSign === \"object\" && winCodeSign != null) {\n const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined)\n return { path: path.join(vendorPath, \"osslsigncode\") }\n }\n\n if (process.platform === \"win32\") {\n // Unreachable in normal flow: osslsigncode is only requested when the host is not Windows (Windows signs via\n // signtool). Kept as defense-in-depth — fail loudly instead of resolving a bare `osslsigncode` from $PATH.\n throw new InvalidConfigurationError(\n `osslsigncode is not used on Windows (signing uses signtool). To override, configure a custom toolset: toolsets: { winCodeSign: { url: \"file:///absolute/path/to/dir\" } }`\n )\n }\n\n const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST)\n if (version === \"0.0.0\") {\n const legacyBase = sanitizeDirPath(await getLegacyWinCodeSignBin())\n const vendorBase = path.join(legacyBase, process.platform)\n const vendorPath = process.platform === \"darwin\" ? path.join(vendorBase, \"10.12\") : vendorBase\n return { path: path.join(vendorPath, \"osslsigncode\"), env: process.platform === \"darwin\" ? computeToolEnv([path.join(vendorPath, \"lib\")]) : undefined }\n }\n\n const file = (() => {\n if (process.platform === \"linux\") {\n if (process.arch == \"x64\") {\n return \"win-codesign-linux-amd64.zip\"\n } else if (process.arch === \"arm64\") {\n return \"win-codesign-linux-arm64.zip\"\n }\n return \"win-codesign-linux-i386.zip\"\n }\n // darwin arm64\n if (process.arch === \"arm64\") {\n return \"win-codesign-darwin-arm64.zip\"\n }\n return \"win-codesign-darwin-x86_64.zip\"\n })()\n const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file))\n return { path: path.join(vendorPath, \"osslsigncode\") }\n}\n\nexport async function getAtsBundleDir(winCodeSign: string): Promise<string> {\n const version = winCodeSign === \"latest\" ? WIN_CODESIGN_LATEST : winCodeSign\n const checksum = (wincodesignChecksums as Record<string, Record<string, string>>)[version]?.[\"ats-bundle-1_0_95.zip\"]\n if (!checksum) {\n throw new Error(`winCodeSign version \"${version}\" does not include an ATS bundle (requires >= 1.3.0)`)\n }\n return downloadBuilderToolset({\n releaseName: `win-codesign@${version}`,\n filenameWithExt: \"ats-bundle-1_0_95.zip\",\n checksums: { \"ats-bundle-1_0_95.zip\": checksum },\n })\n}\n\nconst DOTNET_RUNTIME_ASSET_PREFIX = \"dotnet-runtime-win-x64-\"\n\n/**\n * File name of the .NET runtime asset in a win-codesign release (>= 1.3.0), or `undefined` when that version ships none.\n * The name carries the runtime version and changes between releases (1.3.0 / 1.3.1 ship `8_0_28`, 1.3.3 ships `8_0_33`),\n * so it is looked up in that version's checksums instead of being hard-coded.\n */\nexport function getDotnetRuntimeAssetName(winCodeSign: string): string | undefined {\n const version = winCodeSign === \"latest\" ? WIN_CODESIGN_LATEST : winCodeSign\n if (!Object.prototype.hasOwnProperty.call(wincodesignChecksums, version)) {\n return undefined\n }\n const files = (wincodesignChecksums as Record<string, Record<string, string>>)[version]\n return Object.keys(files).find(it => it.startsWith(DOTNET_RUNTIME_ASSET_PREFIX))\n}\n\nexport async function getDotnetRuntimeDir(winCodeSign: string): Promise<string> {\n const version = winCodeSign === \"latest\" ? WIN_CODESIGN_LATEST : winCodeSign\n const file = getDotnetRuntimeAssetName(version)\n if (file == null) {\n throw new Error(`winCodeSign version \"${version}\" does not include a .NET runtime bundle (requires >= 1.3.0)`)\n }\n return downloadBuilderToolset({\n releaseName: `win-codesign@${version}`,\n filenameWithExt: file,\n checksums: { [file]: (wincodesignChecksums as Record<string, Record<string, string>>)[version][file] },\n })\n}\n\nexport async function getRceditBundle(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish, resourcesDir = \"\") {\n const ia32 = \"rcedit-ia32.exe\"\n const x86 = \"rcedit-x86.exe\"\n const x64 = \"rcedit-x64.exe\"\n if (typeof winCodeSign === \"object\" && winCodeSign != null) {\n const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined)\n return { x86: path.join(vendorPath, x86), x64: path.join(vendorPath, x64) }\n }\n const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST)\n if (version === \"0.0.0\") {\n const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin())\n return { x86: path.join(vendorPath, ia32), x64: path.join(vendorPath, x64) }\n }\n const file = \"rcedit-windows-2_0_0.zip\"\n const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file))\n return { x86: path.join(vendorPath, x86), x64: path.join(vendorPath, x64) }\n}\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Arch } from "builder-util";
|
|
2
|
+
import { Nullish } from "builder-util-runtime";
|
|
3
|
+
import { ToolsetConfig } from "../configuration.js";
|
|
4
|
+
export declare const wixChecksums: {
|
|
5
|
+
readonly "0.0.0": {
|
|
6
|
+
readonly "wix-4.0.0.5512.2.7z": "fe677fcd837b18c9b912985d91636bbd8a1e800c3b3a6a841b6f96e89624e839";
|
|
7
|
+
};
|
|
8
|
+
readonly "2.0.0": {
|
|
9
|
+
readonly "wix-3.14.1.tar.gz": "8f1a5a017042cb287b11b8056ed8e29f86ebe456b09086c4f510b56659e014d5";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The `.wxs` dialect a WiX bundle compiles. The legacy bundle is a WiX 4 preview (4.0.0.5512) that still ships `candle` /
|
|
14
|
+
* `light`: it reads the v4 namespace and accepts v4 conveniences (the inline directory syntax `Name="APPLICATIONFOLDER:\sub\"`,
|
|
15
|
+
* `Component/@Directory` inside a `ComponentGroup` that sets one) but has no `arm64`. WiX 3 needs every directory as a nested
|
|
16
|
+
* `Directory` element and every component in its own directory, and supports `-arch arm64`.
|
|
17
|
+
*/
|
|
18
|
+
export type WixSchema = "v3" | "v4-preview";
|
|
19
|
+
/** A WiX bundle on disk and the `.wxs` dialect it compiles. */
|
|
20
|
+
export interface WixToolset {
|
|
21
|
+
readonly path: string;
|
|
22
|
+
readonly schema: WixSchema;
|
|
23
|
+
}
|
|
24
|
+
/** The `xmlns` of a `.wxs` document in `schema`. */
|
|
25
|
+
export declare function getWixNamespace(schema: WixSchema): string;
|
|
26
|
+
/** The WiX 4 namespaces (`http://wixtoolset.org/schemas/v4/...`) that a `.wxs` project declares, each once. */
|
|
27
|
+
export declare function findWix4Namespaces(project: string): Array<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Fails a WiX 3 build whose project declares a WiX 4 namespace, which only an `msiProjectCreated` hook can add (the
|
|
30
|
+
* generated project uses the WiX 3 ones). candle would reject it with an "unhandled extension element" error that
|
|
31
|
+
* doesn't say the bundle is the cause.
|
|
32
|
+
*/
|
|
33
|
+
export declare function assertNoWix4Namespaces(project: string, schema: WixSchema): void;
|
|
34
|
+
/** Resolves a `toolsets.wix` version: unset or `"latest"` is the newest bundle, `"0.0.0"` the legacy one. */
|
|
35
|
+
export declare function resolveWixVersion(wix: Exclude<ToolsetConfig["wix"], object> | Nullish): "0.0.0" | "2.0.0";
|
|
36
|
+
export declare function getWixToolset(wix: ToolsetConfig["wix"] | Nullish, resourcesDir: string): Promise<WixToolset>;
|
|
37
|
+
/**
|
|
38
|
+
* The architecture an MSI is built for: arm64 needs a toolset that supports it, otherwise it falls back to x64 (the
|
|
39
|
+
* x64 package then runs on Windows on Arm under emulation).
|
|
40
|
+
*/
|
|
41
|
+
export declare function getWixArch(arch: Arch, schema: WixSchema): Arch;
|
|
42
|
+
/** The value of `candle -arch` for `wixArch`. */
|
|
43
|
+
export declare function getCandleArch(wixArch: Arch): "x86" | "x64" | "arm64";
|
|
44
|
+
//# sourceMappingURL=wix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wix.d.ts","sourceRoot":"","sources":["../../src/toolsets/wix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA6B,MAAM,cAAc,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AASnD,eAAO,MAAM,YAAY;;;;;;;CAQf,CAAA;AAEV;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,YAAY,CAAA;AAE3C,+DAA+D;AAC/D,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;CAC3B;AAED,oDAAoD;AACpD,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAEzD;AAID,+GAA+G;AAC/G,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAEjE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAe/E;AAED,6GAA6G;AAC7G,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAEzG;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAuBlH;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAE9D;AAED,iDAAiD;AACjD,wBAAgB,aAAa,CAAC,OAAO,EAAE,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,CASpE"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Arch, InvalidConfigurationError } from "builder-util";
|
|
2
|
+
import { BUILD_CHANGES_URL } from "../util/config/legacyOptions.js";
|
|
3
|
+
import { downloadBuilderToolset } from "../util/electronGet.js";
|
|
4
|
+
import { getCustomToolsetPath } from "./custom.js";
|
|
5
|
+
import { resolveToolsetVersion } from "./version.js";
|
|
6
|
+
// Newest WiX bundle — selected when the config is unset or "latest".
|
|
7
|
+
const WIX_LATEST = "2.0.0";
|
|
8
|
+
export const wixChecksums = {
|
|
9
|
+
"0.0.0": {
|
|
10
|
+
"wix-4.0.0.5512.2.7z": "fe677fcd837b18c9b912985d91636bbd8a1e800c3b3a6a841b6f96e89624e839",
|
|
11
|
+
},
|
|
12
|
+
"2.0.0": {
|
|
13
|
+
// WiX Toolset v3.14.1 (candle/light)
|
|
14
|
+
"wix-3.14.1.tar.gz": "8f1a5a017042cb287b11b8056ed8e29f86ebe456b09086c4f510b56659e014d5",
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
/** The `xmlns` of a `.wxs` document in `schema`. */
|
|
18
|
+
export function getWixNamespace(schema) {
|
|
19
|
+
return schema === "v3" ? "http://schemas.microsoft.com/wix/2006/wi" : "http://wixtoolset.org/schemas/v4/wxs";
|
|
20
|
+
}
|
|
21
|
+
const WIX4_NAMESPACE_PATTERN = /\bxmlns(?::[\w.-]+)?\s*=\s*(["'])(http:\/\/wixtoolset\.org\/schemas\/v4\/[^"']*)\1/g;
|
|
22
|
+
/** The WiX 4 namespaces (`http://wixtoolset.org/schemas/v4/...`) that a `.wxs` project declares, each once. */
|
|
23
|
+
export function findWix4Namespaces(project) {
|
|
24
|
+
return [...new Set(Array.from(project.matchAll(WIX4_NAMESPACE_PATTERN), it => it[2]))];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Fails a WiX 3 build whose project declares a WiX 4 namespace, which only an `msiProjectCreated` hook can add (the
|
|
28
|
+
* generated project uses the WiX 3 ones). candle would reject it with an "unhandled extension element" error that
|
|
29
|
+
* doesn't say the bundle is the cause.
|
|
30
|
+
*/
|
|
31
|
+
export function assertNoWix4Namespaces(project, schema) {
|
|
32
|
+
if (schema !== "v3") {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const namespaces = findWix4Namespaces(project);
|
|
36
|
+
if (namespaces.length === 0) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
throw new InvalidConfigurationError(`The MSI project declares the WiX 4 namespace ${namespaces.map(it => `"${it}"`).join(", ")}, most likely from an msiProjectCreated hook, ` +
|
|
40
|
+
`but the WiX 3 toolset reads WiX 3 namespaces only (electron-builder v27 builds MSIs with WiX 3.14.1 by default, toolsets.wix "latest"). ` +
|
|
41
|
+
`Use the WiX 3 namespace (for example "http://schemas.microsoft.com/wix/UtilExtension" instead of "http://wixtoolset.org/schemas/v4/wxs/util"), ` +
|
|
42
|
+
`or set toolsets.wix to "0.0.0" to keep the legacy WiX 4 preview bundle. ` +
|
|
43
|
+
`See ${BUILD_CHANGES_URL}#toolset-defaults-resolve-to-latest-newest-bundle`);
|
|
44
|
+
}
|
|
45
|
+
/** Resolves a `toolsets.wix` version: unset or `"latest"` is the newest bundle, `"0.0.0"` the legacy one. */
|
|
46
|
+
export function resolveWixVersion(wix) {
|
|
47
|
+
return resolveToolsetVersion(wix, WIX_LATEST);
|
|
48
|
+
}
|
|
49
|
+
export async function getWixToolset(wix, resourcesDir) {
|
|
50
|
+
if (typeof wix === "object" && wix != null) {
|
|
51
|
+
// a custom bundle must mirror the WiX v3 layout (candle.exe, light.exe and the extensions at its root)
|
|
52
|
+
return { path: await getCustomToolsetPath(wix, resourcesDir), schema: "v3" };
|
|
53
|
+
}
|
|
54
|
+
const resolved = resolveWixVersion(wix);
|
|
55
|
+
if (resolved === "0.0.0") {
|
|
56
|
+
const file = "wix-4.0.0.5512.2.7z";
|
|
57
|
+
// noinspection SpellCheckingInspection
|
|
58
|
+
const toolsetPath = await downloadBuilderToolset({
|
|
59
|
+
releaseName: "wix-4.0.0.5512.2",
|
|
60
|
+
filenameWithExt: file,
|
|
61
|
+
checksums: { [file]: wixChecksums["0.0.0"][file] },
|
|
62
|
+
});
|
|
63
|
+
return { path: toolsetPath, schema: "v4-preview" };
|
|
64
|
+
}
|
|
65
|
+
const file = "wix-3.14.1.tar.gz";
|
|
66
|
+
const toolsetPath = await downloadBuilderToolset({
|
|
67
|
+
releaseName: `wix@${resolved}`,
|
|
68
|
+
filenameWithExt: file,
|
|
69
|
+
checksums: { [file]: wixChecksums[resolved][file] },
|
|
70
|
+
});
|
|
71
|
+
return { path: toolsetPath, schema: "v3" };
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The architecture an MSI is built for: arm64 needs a toolset that supports it, otherwise it falls back to x64 (the
|
|
75
|
+
* x64 package then runs on Windows on Arm under emulation).
|
|
76
|
+
*/
|
|
77
|
+
export function getWixArch(arch, schema) {
|
|
78
|
+
return arch === Arch.arm64 && schema !== "v3" ? Arch.x64 : arch;
|
|
79
|
+
}
|
|
80
|
+
/** The value of `candle -arch` for `wixArch`. */
|
|
81
|
+
export function getCandleArch(wixArch) {
|
|
82
|
+
switch (wixArch) {
|
|
83
|
+
case Arch.ia32:
|
|
84
|
+
return "x86";
|
|
85
|
+
case Arch.arm64:
|
|
86
|
+
return "arm64";
|
|
87
|
+
default:
|
|
88
|
+
return "x64";
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=wix.js.map
|
|
@@ -0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AsB,CAAC;QAC/C,WAAW,EAAE,OAAO,QAAQ,EAAE;QAC9B,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE;KACpD,CAAC,CAAA;IACF,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;AAC5C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAAU,EAAE,MAAiB;IACtD,OAAO,IAAI,KAAK,IAAI,CAAC,KAAK,IAAI,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;AACjE,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,aAAa,CAAC,OAAa;IACzC,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,IAAI;YACZ,OAAO,KAAK,CAAA;QACd,KAAK,IAAI,CAAC,KAAK;YACb,OAAO,OAAO,CAAA;QAChB;YACE,OAAO,KAAK,CAAA;IAChB,CAAC;AACH,CAAC","sourcesContent":["import { Arch, InvalidConfigurationError } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport { ToolsetConfig } from \"../configuration.js\"\nimport { BUILD_CHANGES_URL } from \"../util/config/legacyOptions.js\"\nimport { downloadBuilderToolset } from \"../util/electronGet.js\"\nimport { getCustomToolsetPath } from \"./custom.js\"\nimport { resolveToolsetVersion } from \"./version.js\"\n\n// Newest WiX bundle — selected when the config is unset or \"latest\".\nconst WIX_LATEST = \"2.0.0\"\n\nexport const wixChecksums = {\n \"0.0.0\": {\n \"wix-4.0.0.5512.2.7z\": \"fe677fcd837b18c9b912985d91636bbd8a1e800c3b3a6a841b6f96e89624e839\",\n },\n \"2.0.0\": {\n // WiX Toolset v3.14.1 (candle/light)\n \"wix-3.14.1.tar.gz\": \"8f1a5a017042cb287b11b8056ed8e29f86ebe456b09086c4f510b56659e014d5\",\n },\n} as const\n\n/**\n * The `.wxs` dialect a WiX bundle compiles. The legacy bundle is a WiX 4 preview (4.0.0.5512) that still ships `candle` /\n * `light`: it reads the v4 namespace and accepts v4 conveniences (the inline directory syntax `Name=\"APPLICATIONFOLDER:\\sub\\\"`,\n * `Component/@Directory` inside a `ComponentGroup` that sets one) but has no `arm64`. WiX 3 needs every directory as a nested\n * `Directory` element and every component in its own directory, and supports `-arch arm64`.\n */\nexport type WixSchema = \"v3\" | \"v4-preview\"\n\n/** A WiX bundle on disk and the `.wxs` dialect it compiles. */\nexport interface WixToolset {\n readonly path: string\n readonly schema: WixSchema\n}\n\n/** The `xmlns` of a `.wxs` document in `schema`. */\nexport function getWixNamespace(schema: WixSchema): string {\n return schema === \"v3\" ? \"http://schemas.microsoft.com/wix/2006/wi\" : \"http://wixtoolset.org/schemas/v4/wxs\"\n}\n\nconst WIX4_NAMESPACE_PATTERN = /\\bxmlns(?::[\\w.-]+)?\\s*=\\s*([\"'])(http:\\/\\/wixtoolset\\.org\\/schemas\\/v4\\/[^\"']*)\\1/g\n\n/** The WiX 4 namespaces (`http://wixtoolset.org/schemas/v4/...`) that a `.wxs` project declares, each once. */\nexport function findWix4Namespaces(project: string): Array<string> {\n return [...new Set(Array.from(project.matchAll(WIX4_NAMESPACE_PATTERN), it => it[2]))]\n}\n\n/**\n * Fails a WiX 3 build whose project declares a WiX 4 namespace, which only an `msiProjectCreated` hook can add (the\n * generated project uses the WiX 3 ones). candle would reject it with an \"unhandled extension element\" error that\n * doesn't say the bundle is the cause.\n */\nexport function assertNoWix4Namespaces(project: string, schema: WixSchema): void {\n if (schema !== \"v3\") {\n return\n }\n const namespaces = findWix4Namespaces(project)\n if (namespaces.length === 0) {\n return\n }\n throw new InvalidConfigurationError(\n `The MSI project declares the WiX 4 namespace ${namespaces.map(it => `\"${it}\"`).join(\", \")}, most likely from an msiProjectCreated hook, ` +\n `but the WiX 3 toolset reads WiX 3 namespaces only (electron-builder v27 builds MSIs with WiX 3.14.1 by default, toolsets.wix \"latest\"). ` +\n `Use the WiX 3 namespace (for example \"http://schemas.microsoft.com/wix/UtilExtension\" instead of \"http://wixtoolset.org/schemas/v4/wxs/util\"), ` +\n `or set toolsets.wix to \"0.0.0\" to keep the legacy WiX 4 preview bundle. ` +\n `See ${BUILD_CHANGES_URL}#toolset-defaults-resolve-to-latest-newest-bundle`\n )\n}\n\n/** Resolves a `toolsets.wix` version: unset or `\"latest\"` is the newest bundle, `\"0.0.0\"` the legacy one. */\nexport function resolveWixVersion(wix: Exclude<ToolsetConfig[\"wix\"], object> | Nullish): \"0.0.0\" | \"2.0.0\" {\n return resolveToolsetVersion(wix, WIX_LATEST)\n}\n\nexport async function getWixToolset(wix: ToolsetConfig[\"wix\"] | Nullish, resourcesDir: string): Promise<WixToolset> {\n if (typeof wix === \"object\" && wix != null) {\n // a custom bundle must mirror the WiX v3 layout (candle.exe, light.exe and the extensions at its root)\n return { path: await getCustomToolsetPath(wix, resourcesDir), schema: \"v3\" }\n }\n const resolved = resolveWixVersion(wix)\n if (resolved === \"0.0.0\") {\n const file = \"wix-4.0.0.5512.2.7z\"\n // noinspection SpellCheckingInspection\n const toolsetPath = await downloadBuilderToolset({\n releaseName: \"wix-4.0.0.5512.2\",\n filenameWithExt: file,\n checksums: { [file]: wixChecksums[\"0.0.0\"][file] },\n })\n return { path: toolsetPath, schema: \"v4-preview\" }\n }\n const file = \"wix-3.14.1.tar.gz\"\n const toolsetPath = await downloadBuilderToolset({\n releaseName: `wix@${resolved}`,\n filenameWithExt: file,\n checksums: { [file]: wixChecksums[resolved][file] },\n })\n return { path: toolsetPath, schema: \"v3\" }\n}\n\n/**\n * The architecture an MSI is built for: arm64 needs a toolset that supports it, otherwise it falls back to x64 (the\n * x64 package then runs on Windows on Arm under emulation).\n */\nexport function getWixArch(arch: Arch, schema: WixSchema): Arch {\n return arch === Arch.arm64 && schema !== \"v3\" ? Arch.x64 : arch\n}\n\n/** The value of `candle -arch` for `wixArch`. */\nexport function getCandleArch(wixArch: Arch): \"x86\" | \"x64\" | \"arm64\" {\n switch (wixArch) {\n case Arch.ia32:\n return \"x86\"\n case Arch.arm64:\n return \"arm64\"\n default:\n return \"x64\"\n }\n}\n"]}
|
|
@@ -27,7 +27,8 @@ export interface VerifyBuildOutputOptions {
|
|
|
27
27
|
* Verifies the built artifacts in an output directory, the checks `forceCodeSigning` makes during a build plus what can
|
|
28
28
|
* only be seen afterwards:
|
|
29
29
|
* - every update manifest (`latest*.yml`, found by its shape) is signed by a key in the trust list (`updateManifestPublicKey`)
|
|
30
|
-
* of every packaged app of its platform, and each file it lists
|
|
30
|
+
* of every packaged app of its platform, uses no YAML aliases, and each file it lists (nsis-web `packages` included) matches an
|
|
31
|
+
* artifact (sha512 and size); a `.yml` that is not valid YAML fails;
|
|
31
32
|
* - macOS (on macOS only): every `.app` has a valid code signature and, outside the Mac App Store, a stapled notarization
|
|
32
33
|
* ticket; a `.pkg` is signed (and notarized); a DMG with `dmg.sign: true` is signed;
|
|
33
34
|
* - Windows: every installer, package and app executable carries a valid Authenticode signature (whose hash only Windows
|