update electron to v43

This commit is contained in:
olcxja 2026-07-09 22:38:33 +02:00
commit fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions

View file

@ -0,0 +1,2 @@
/** Returns the path to the 7za executable, downloading it on first call. Resets on failure so callers can retry. */
export declare function getPath7za(): Promise<string>;

View file

@ -0,0 +1,72 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPath7za = getPath7za;
const fs_extra_1 = require("fs-extra");
const path = require("path");
const builder_util_1 = require("builder-util");
const electronGet_1 = require("../util/electronGet");
const checksums = {
"7zip-linux-ia32.tar.gz": "24a5d5bfe81506d0bfe21a812588119ae3deb757e8ba084b2339d8e899543686",
"7zip-darwin-arm64.tar.gz": "496a341abe210aae1a25bc202ee97f6de6c76a3dc80f91d96616be05502d72c1",
"7zip-darwin-x86_64.tar.gz": "496a341abe210aae1a25bc202ee97f6de6c76a3dc80f91d96616be05502d72c1",
"7zip-linux-arm64.tar.gz": "5aff5034206b78f8261249ceb922b5c7e04c9bdb733784d8f5b6df9732cf1f79",
"7zip-win-arm64.tar.gz": "ac3f38f96ce7498096a123bb0862dd6db863a7353c9e9e1c15f73c183adf6620",
"7zip-win-ia32.tar.gz": "ac3f38f96ce7498096a123bb0862dd6db863a7353c9e9e1c15f73c183adf6620",
"7zip-win-x64.tar.gz": "be071f15bd6da2f78fe81c6ddef2009b0c4d8a51f36b780cb806c7e6df95e1b3",
"7zip-linux-x64.tar.gz": "d151bb44b2a9d9bfc52813ce4cac042916394a0ab8a56bd5d221a5dc9ef8d5d7",
};
function getFilename() {
const { platform, arch } = process;
if (platform === "darwin") {
return arch === "arm64" ? "7zip-darwin-arm64.tar.gz" : "7zip-darwin-x86_64.tar.gz";
}
if (platform === "linux") {
if (arch === "arm64") {
return "7zip-linux-arm64.tar.gz";
}
if (arch === "ia32") {
return "7zip-linux-ia32.tar.gz";
}
return "7zip-linux-x64.tar.gz";
}
if (platform === "win32") {
if (arch === "arm64") {
return "7zip-win-arm64.tar.gz";
}
if (arch === "ia32") {
return "7zip-win-ia32.tar.gz";
}
return "7zip-win-x64.tar.gz";
}
throw new Error(`Unsupported platform for 7zip toolset: ${platform}/${arch}`);
}
let _resolvedPath = null;
/** Returns the path to the 7za executable, downloading it on first call. Resets on failure so callers can retry. */
function getPath7za() {
if (_resolvedPath == null) {
_resolvedPath = resolve().catch(err => {
_resolvedPath = null;
throw err;
});
}
return _resolvedPath;
}
async function resolve() {
const envExec = await (0, builder_util_1.resolveEnvToolsetPath)("ELECTRON_BUILDER_7ZIP_PATH", "file");
if (envExec != null) {
return envExec;
}
const filename = getFilename();
const toolDir = await (0, electronGet_1.downloadBuilderToolset)({
releaseName: `7zip@1.0.0`,
filenameWithExt: filename,
checksums: checksums,
githubOrgRepo: "electron-userland/electron-builder-binaries",
});
const bin = path.join(toolDir, "bin", process.platform === "win32" ? "7za.exe" : "7za");
if (process.platform !== "win32") {
await (0, fs_extra_1.chmod)(bin, 0o755);
}
return bin;
}
//# sourceMappingURL=7zip.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"7zip.js","sourceRoot":"","sources":["../../src/toolsets/7zip.ts"],"names":[],"mappings":";;AA6CA,gCAQC;AArDD,uCAAgC;AAChC,6BAA4B;AAC5B,+CAAoD;AACpD,qDAA4D;AAE5D,MAAM,SAAS,GAAG;IAChB,wBAAwB,EAAE,kEAAkE;IAC5F,0BAA0B,EAAE,kEAAkE;IAC9F,2BAA2B,EAAE,kEAAkE;IAC/F,yBAAyB,EAAE,kEAAkE;IAC7F,uBAAuB,EAAE,kEAAkE;IAC3F,sBAAsB,EAAE,kEAAkE;IAC1F,qBAAqB,EAAE,kEAAkE;IACzF,uBAAuB,EAAE,kEAAkE;CACnF,CAAA;AAEV,SAAS,WAAW;IAClB,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IAClC,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,2BAA2B,CAAA;IACpF,CAAC;IACD,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;YACrB,OAAO,yBAAyB,CAAA;QAClC,CAAC;QACD,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;YACpB,OAAO,wBAAwB,CAAA;QACjC,CAAC;QACD,OAAO,uBAAuB,CAAA;IAChC,CAAC;IACD,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;YACrB,OAAO,uBAAuB,CAAA;QAChC,CAAC;QACD,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;YACpB,OAAO,sBAAsB,CAAA;QAC/B,CAAC;QACD,OAAO,qBAAqB,CAAA;IAC9B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,0CAA0C,QAAQ,IAAI,IAAI,EAAE,CAAC,CAAA;AAC/E,CAAC;AAED,IAAI,aAAa,GAA2B,IAAI,CAAA;AAEhD,oHAAoH;AACpH,SAAgB,UAAU;IACxB,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;QAC1B,aAAa,GAAG,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACpC,aAAa,GAAG,IAAI,CAAA;YACpB,MAAM,GAAG,CAAA;QACX,CAAC,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,aAAa,CAAA;AACtB,CAAC;AAED,KAAK,UAAU,OAAO;IACpB,MAAM,OAAO,GAAG,MAAM,IAAA,oCAAqB,EAAC,4BAA4B,EAAE,MAAM,CAAC,CAAA;IACjF,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;IAC9B,MAAM,OAAO,GAAG,MAAM,IAAA,oCAAsB,EAAC;QAC3C,WAAW,EAAE,YAAY;QACzB,eAAe,EAAE,QAAQ;QACzB,SAAS,EAAE,SAAS;QACpB,aAAa,EAAE,6CAA6C;KAC7D,CAAC,CAAA;IAEF,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;IACvF,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,MAAM,IAAA,gBAAK,EAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACzB,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC","sourcesContent":["import { chmod } from \"fs-extra\"\nimport * as path from \"path\"\nimport { resolveEnvToolsetPath } from \"builder-util\"\nimport { downloadBuilderToolset } from \"../util/electronGet\"\n\nconst checksums = {\n \"7zip-linux-ia32.tar.gz\": \"24a5d5bfe81506d0bfe21a812588119ae3deb757e8ba084b2339d8e899543686\",\n \"7zip-darwin-arm64.tar.gz\": \"496a341abe210aae1a25bc202ee97f6de6c76a3dc80f91d96616be05502d72c1\",\n \"7zip-darwin-x86_64.tar.gz\": \"496a341abe210aae1a25bc202ee97f6de6c76a3dc80f91d96616be05502d72c1\",\n \"7zip-linux-arm64.tar.gz\": \"5aff5034206b78f8261249ceb922b5c7e04c9bdb733784d8f5b6df9732cf1f79\",\n \"7zip-win-arm64.tar.gz\": \"ac3f38f96ce7498096a123bb0862dd6db863a7353c9e9e1c15f73c183adf6620\",\n \"7zip-win-ia32.tar.gz\": \"ac3f38f96ce7498096a123bb0862dd6db863a7353c9e9e1c15f73c183adf6620\",\n \"7zip-win-x64.tar.gz\": \"be071f15bd6da2f78fe81c6ddef2009b0c4d8a51f36b780cb806c7e6df95e1b3\",\n \"7zip-linux-x64.tar.gz\": \"d151bb44b2a9d9bfc52813ce4cac042916394a0ab8a56bd5d221a5dc9ef8d5d7\",\n} as const\n\nfunction getFilename(): keyof typeof checksums {\n const { platform, arch } = process\n if (platform === \"darwin\") {\n return arch === \"arm64\" ? \"7zip-darwin-arm64.tar.gz\" : \"7zip-darwin-x86_64.tar.gz\"\n }\n if (platform === \"linux\") {\n if (arch === \"arm64\") {\n return \"7zip-linux-arm64.tar.gz\"\n }\n if (arch === \"ia32\") {\n return \"7zip-linux-ia32.tar.gz\"\n }\n return \"7zip-linux-x64.tar.gz\"\n }\n if (platform === \"win32\") {\n if (arch === \"arm64\") {\n return \"7zip-win-arm64.tar.gz\"\n }\n if (arch === \"ia32\") {\n return \"7zip-win-ia32.tar.gz\"\n }\n return \"7zip-win-x64.tar.gz\"\n }\n throw new Error(`Unsupported platform for 7zip toolset: ${platform}/${arch}`)\n}\n\nlet _resolvedPath: Promise<string> | null = null\n\n/** Returns the path to the 7za executable, downloading it on first call. Resets on failure so callers can retry. */\nexport function getPath7za(): Promise<string> {\n if (_resolvedPath == null) {\n _resolvedPath = resolve().catch(err => {\n _resolvedPath = null\n throw err\n })\n }\n return _resolvedPath\n}\n\nasync function resolve(): Promise<string> {\n const envExec = await resolveEnvToolsetPath(\"ELECTRON_BUILDER_7ZIP_PATH\", \"file\")\n if (envExec != null) {\n return envExec\n }\n\n const filename = getFilename()\n const toolDir = await downloadBuilderToolset({\n releaseName: `7zip@1.0.0`,\n filenameWithExt: filename,\n checksums: checksums,\n githubOrgRepo: \"electron-userland/electron-builder-binaries\",\n })\n\n const bin = path.join(toolDir, \"bin\", process.platform === \"win32\" ? \"7za.exe\" : \"7za\")\n if (process.platform !== \"win32\") {\n await chmod(bin, 0o755)\n }\n return bin\n}\n"]}

View file

@ -0,0 +1,8 @@
export declare function getIconsToolsetPath(): Promise<string>;
type IconConversionOptions = {
inputFile: string;
outputFormat: "icns" | "ico" | "set";
outDir: string;
};
export declare function runIconsTool({ inputFile, outputFormat, outDir }: IconConversionOptions): Promise<void>;
export {};

View file

@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getIconsToolsetPath = getIconsToolsetPath;
exports.runIconsTool = runIconsTool;
const builder_util_1 = require("builder-util");
const path = require("path");
const electronGet_1 = require("../util/electronGet");
const iconsToolsChecksums = {
"icons-bundle.tar.gz": "2241c9501aa5ddd19317956449f50a1bc311df2c34058aae9bf8bfe62081eaec",
};
async function getIconsToolsetPath() {
const envPath = await (0, builder_util_1.resolveEnvToolsetPath)("ELECTRON_BUILDER_ICONS_TOOLSET_DIR", "directory");
if (envPath != null) {
return envPath;
}
return (0, electronGet_1.downloadBuilderToolset)({
releaseName: "icons@1.1.0",
filenameWithExt: "icons-bundle.tar.gz",
checksums: iconsToolsChecksums,
githubOrgRepo: "electron-userland/electron-builder-binaries",
});
}
const VALID_OUTPUT_FORMATS = ["icns", "ico", "set"];
async function runIconsTool({ inputFile, outputFormat, outDir }) {
if (!VALID_OUTPUT_FORMATS.includes(outputFormat)) {
throw new builder_util_1.InvalidConfigurationError(`Invalid icon output format: ${outputFormat}`);
}
const safeInput = (0, builder_util_1.sanitizeDirPath)(inputFile);
const safeOutDir = (0, builder_util_1.sanitizeDirPath)(outDir);
const toolsetPath = await getIconsToolsetPath();
const scriptPath = path.resolve(toolsetPath, "icon-tool.js");
if (!(await (0, builder_util_1.exists)(scriptPath))) {
throw new builder_util_1.InvalidConfigurationError(`Icons tool not found at expected path: ${scriptPath}`);
}
await (0, builder_util_1.exec)(process.execPath, [scriptPath, `--input=${safeInput}`, `--format=${outputFormat}`, `--out=${safeOutDir}`], { shell: false });
}
//# sourceMappingURL=icons.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/toolsets/icons.ts"],"names":[],"mappings":";;AAQA,kDAWC;AAUD,oCAaC;AA1CD,+CAA8G;AAC9G,6BAA4B;AAC5B,qDAA4D;AAE5D,MAAM,mBAAmB,GAAG;IAC1B,qBAAqB,EAAE,kEAAkE;CACjF,CAAA;AAEH,KAAK,UAAU,mBAAmB;IACvC,MAAM,OAAO,GAAG,MAAM,IAAA,oCAAqB,EAAC,oCAAoC,EAAE,WAAW,CAAC,CAAA;IAC9F,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,OAAO,OAAO,CAAA;IAChB,CAAC;IACD,OAAO,IAAA,oCAAsB,EAAC;QAC5B,WAAW,EAAE,aAAa;QAC1B,eAAe,EAAE,qBAAqB;QACtC,SAAS,EAAE,mBAAmB;QAC9B,aAAa,EAAE,6CAA6C;KAC7D,CAAC,CAAA;AACJ,CAAC;AAQD,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAU,CAAA;AAErD,KAAK,UAAU,YAAY,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAyB;IAC3F,IAAI,CAAE,oBAA0C,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,wCAAyB,CAAC,+BAA+B,YAAY,EAAE,CAAC,CAAA;IACpF,CAAC;IACD,MAAM,SAAS,GAAG,IAAA,8BAAe,EAAC,SAAS,CAAC,CAAA;IAC5C,MAAM,UAAU,GAAG,IAAA,8BAAe,EAAC,MAAM,CAAC,CAAA;IAE1C,MAAM,WAAW,GAAG,MAAM,mBAAmB,EAAE,CAAA;IAC/C,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,cAAc,CAAC,CAAA;IAC5D,IAAI,CAAC,CAAC,MAAM,IAAA,qBAAM,EAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,wCAAyB,CAAC,0CAA0C,UAAU,EAAE,CAAC,CAAA;IAC7F,CAAC;IACD,MAAM,IAAA,mBAAI,EAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,WAAW,SAAS,EAAE,EAAE,YAAY,YAAY,EAAE,EAAE,SAAS,UAAU,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;AACzI,CAAC","sourcesContent":["import { exec, exists, InvalidConfigurationError, resolveEnvToolsetPath, sanitizeDirPath } from \"builder-util\"\nimport * as path from \"path\"\nimport { downloadBuilderToolset } from \"../util/electronGet\"\n\nconst iconsToolsChecksums = {\n \"icons-bundle.tar.gz\": \"2241c9501aa5ddd19317956449f50a1bc311df2c34058aae9bf8bfe62081eaec\",\n} as const\n\nexport async function getIconsToolsetPath(): Promise<string> {\n const envPath = await resolveEnvToolsetPath(\"ELECTRON_BUILDER_ICONS_TOOLSET_DIR\", \"directory\")\n if (envPath != null) {\n return envPath\n }\n return downloadBuilderToolset({\n releaseName: \"icons@1.1.0\",\n filenameWithExt: \"icons-bundle.tar.gz\",\n checksums: iconsToolsChecksums,\n githubOrgRepo: \"electron-userland/electron-builder-binaries\",\n })\n}\n\ntype IconConversionOptions = {\n inputFile: string\n outputFormat: \"icns\" | \"ico\" | \"set\"\n outDir: string\n}\n\nconst VALID_OUTPUT_FORMATS = [\"icns\", \"ico\", \"set\"] as const\n\nexport async function runIconsTool({ inputFile, outputFormat, outDir }: IconConversionOptions): Promise<void> {\n if (!(VALID_OUTPUT_FORMATS as readonly string[]).includes(outputFormat)) {\n throw new InvalidConfigurationError(`Invalid icon output format: ${outputFormat}`)\n }\n const safeInput = sanitizeDirPath(inputFile)\n const safeOutDir = sanitizeDirPath(outDir)\n\n const toolsetPath = await getIconsToolsetPath()\n const scriptPath = path.resolve(toolsetPath, \"icon-tool.js\")\n if (!(await exists(scriptPath))) {\n throw new InvalidConfigurationError(`Icons tool not found at expected path: ${scriptPath}`)\n }\n await exec(process.execPath, [scriptPath, `--input=${safeInput}`, `--format=${outputFormat}`, `--out=${safeOutDir}`], { shell: false })\n}\n"]}

View file

@ -0,0 +1,26 @@
import { Arch } from "builder-util";
import { ToolsetConfig } from "../configuration";
export declare const appimageChecksums: {
readonly "0.0.0": {
readonly "appimage-12.0.1.7z": "d12ff7eb8f1d1ec4652ca5237a7fbdca33acc0c758045636feca62dc6ecb8ec4";
};
readonly "1.0.2": {
readonly "appimage-tools-runtime-20251108.tar.gz": "a784a8c26331ec2e945c23d6bdb14af5c9df27f5939825d84b8709c61dc81eb0";
};
readonly "1.0.3": {
readonly "appimage-tools-runtime-20251108.tar.gz": "84021a78ee214ae6fd33a2d62a92ba25542dd10bc86bf117a9b2d0bba44e7665";
};
};
export declare function getLinuxToolsPath(): Promise<string>;
export declare function getLinuxToolsMacToolset(): Promise<{
ar: string;
lzip: string;
gtar: string;
}>;
export declare function getFpmPath(): Promise<string>;
export declare function getAppImageTools(appimageToolVersion: ToolsetConfig["appimage"], targetArch: Arch): Promise<{
mksquashfs: string;
desktopFileValidate: string;
runtime: string;
runtimeLibraries: string;
}>;

View file

@ -0,0 +1,146 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.appimageChecksums = void 0;
exports.getLinuxToolsPath = getLinuxToolsPath;
exports.getLinuxToolsMacToolset = getLinuxToolsMacToolset;
exports.getFpmPath = getFpmPath;
exports.getAppImageTools = getAppImageTools;
const builder_util_1 = require("builder-util");
const path = require("path");
const binDownload_1 = require("../binDownload");
const electronGet_1 = require("../util/electronGet");
const fpmChecksums = {
"fpm-1.17.0-ruby-3.4.3-darwin-arm64.7z": "6cc6d4785875bc7d79bdf52ca146080a4c300e1d663376ae79615fb548030ede",
"fpm-1.17.0-ruby-3.4.3-darwin-x86_64.7z": "f7cb468c5e64177124c9d3a5f400ac20ffcb411aa5aa0ea224a808ff5a2d3bbf",
"fpm-1.17.0-ruby-3.4.3-linux-amd64.7z": "44b0ec6025c14ec137f56180e62675c0eae36233cdce53d0953d9c73ced8989f",
"fpm-1.17.0-ruby-3.4.3-linux-arm64v8.7z": "338b50cfa7f12d745a997d1a3d000bcd0410008050fa7d8c4476a78a61c0564e",
"fpm-1.17.0-ruby-3.4.3-linux-i386.7z": "181124e2e9856855c21229ea9096bb7006a9e3e712d133ce332597ba878cd7b6",
};
exports.appimageChecksums = {
"0.0.0": {
"appimage-12.0.1.7z": "d12ff7eb8f1d1ec4652ca5237a7fbdca33acc0c758045636feca62dc6ecb8ec4",
},
"1.0.2": {
"appimage-tools-runtime-20251108.tar.gz": "a784a8c26331ec2e945c23d6bdb14af5c9df27f5939825d84b8709c61dc81eb0",
},
"1.0.3": {
"appimage-tools-runtime-20251108.tar.gz": "84021a78ee214ae6fd33a2d62a92ba25542dd10bc86bf117a9b2d0bba44e7665",
},
};
// no legacy toolset as macos arm64 BSD gtar/ar/lzip are not compatible with linux targets, so we always use newer toolset on macos for linux archives
const linuxToolsMacChecksums = {
"linux-tools-mac-darwin-arm64.tar.gz": "204e76f08364352edb28a6a4be87e8f9bd9340213865d9a0d1c664aa46fcf053",
"linux-tools-mac-darwin-x86_64.tar.gz": "7ee26dfbd0d2a4c2c83b55a9416a30cc84876eef01c6497ca49bb016a190c726",
};
async function getLinuxToolsPath() {
const envPath = await (0, builder_util_1.resolveEnvToolsetPath)("LINUX_TOOLS_MAC_PATH", "directory");
if (envPath != null) {
return envPath;
}
const arch = process.arch === "arm64" ? "arm64" : "x86_64";
const toolsetVersion = "1.0.0";
const filename = `linux-tools-mac-darwin-${arch}.tar.gz`;
return await (0, electronGet_1.downloadBuilderToolset)({
releaseName: `linux-tools-mac@${toolsetVersion}`,
filenameWithExt: filename,
checksums: {
[filename]: linuxToolsMacChecksums[filename],
},
githubOrgRepo: "electron-userland/electron-builder-binaries",
});
}
async function getLinuxToolsMacToolset() {
const linuxToolsPath = await getLinuxToolsPath();
const bin = (pkg) => path.join(linuxToolsPath, "bin", pkg);
return {
ar: bin("ar"),
lzip: bin("lzip"),
gtar: bin("gtar"),
};
}
async function getFpmPath() {
const customFpmPath = await (0, builder_util_1.resolveEnvToolsetPath)("CUSTOM_FPM_PATH", "file");
if (customFpmPath != null) {
return customFpmPath;
}
const exec = "fpm";
if (process.platform === "win32" || process.env.USE_SYSTEM_FPM === "true") {
return exec;
}
const getKey = () => {
if (process.platform === "linux") {
if (process.arch == "x64") {
return "fpm-1.17.0-ruby-3.4.3-linux-amd64.7z";
}
else if (process.arch === "arm64") {
return "fpm-1.17.0-ruby-3.4.3-linux-arm64v8.7z";
}
return "fpm-1.17.0-ruby-3.4.3-linux-i386.7z";
}
// darwin arm64
if (process.arch === "arm64") {
return "fpm-1.17.0-ruby-3.4.3-darwin-arm64.7z";
}
return "fpm-1.17.0-ruby-3.4.3-darwin-x86_64.7z";
};
const filename = getKey();
const fpmPath = await (0, binDownload_1.getBinFromUrl)("fpm@2.1.4", filename, fpmChecksums[filename]);
return path.join(fpmPath, exec);
}
async function getAppImageTools(appimageToolVersion, targetArch) {
var _a;
const runtimeArch = targetArch === builder_util_1.Arch.armv7l ? "arm32" : targetArch === builder_util_1.Arch.arm64 ? "arm64" : targetArch === builder_util_1.Arch.ia32 ? "ia32" : "x64";
// Static-runtime layout: tools at root, runtimes/ subdir, lib/{arch}/ subdir
const getPaths = (artifactPath) => ({
mksquashfs: path.resolve(artifactPath, "mksquashfs"),
desktopFileValidate: path.resolve(artifactPath, "desktop-file-validate"),
runtime: path.resolve(artifactPath, "runtimes", `runtime-${runtimeArch}`),
runtimeLibraries: path.resolve(artifactPath, "lib", runtimeArch),
});
// FUSE2 layout: tools under a host-platform subdir; runtime files at root with target-arch suffix
const getFuse2Paths = (artifactPath) => {
// mksquashfs/desktop-file-validate are HOST binaries — use process.arch, not targetArch
const hostArch = process.arch === "arm" ? "arm32" : process.arch === "arm64" ? "arm64" : process.arch === "ia32" ? "ia32" : "x64";
const toolRoot = process.platform === "linux" ? `linux-${hostArch}` : "darwin";
// Runtime files live at root; armv7l target uses "armv7l" filename, not the internal "arm32" alias
const runtimeSuffix = targetArch === builder_util_1.Arch.armv7l ? "armv7l" : runtimeArch;
// FUSE2 tree only ships lib/ia32 and lib/x64; arm targets fall back to x64 here
// but buildLegacyFuse2AppImage only copies runtimeLibraries for x64/ia32.
const libArch = targetArch === builder_util_1.Arch.ia32 ? "ia32" : "x64";
return {
mksquashfs: path.resolve(artifactPath, toolRoot, "mksquashfs"),
desktopFileValidate: path.resolve(artifactPath, toolRoot, "desktop-file-validate"),
runtime: path.resolve(artifactPath, `runtime-${runtimeSuffix}`),
runtimeLibraries: path.resolve(artifactPath, "lib", libArch),
};
};
const isFuse2 = appimageToolVersion === "0.0.0" || appimageToolVersion == null;
const download = async () => {
if (isFuse2) {
const filenameWithExt = "appimage-12.0.1.7z";
const artifactPath = await (0, electronGet_1.downloadBuilderToolset)({
releaseName: "appimage-12.0.1",
filenameWithExt,
checksums: { [filenameWithExt]: exports.appimageChecksums["0.0.0"][filenameWithExt] },
githubOrgRepo: "electron-userland/electron-builder-binaries",
});
return getFuse2Paths(artifactPath);
}
const filenameWithExt = "appimage-tools-runtime-20251108.tar.gz";
const artifactPath = await (0, electronGet_1.downloadBuilderToolset)({
releaseName: `appimage@${appimageToolVersion}`,
filenameWithExt,
checksums: { [filenameWithExt]: exports.appimageChecksums[appimageToolVersion][filenameWithExt] },
githubOrgRepo: "electron-userland/electron-builder-binaries",
});
return getPaths(artifactPath);
};
const artifact = (_a = (0, builder_util_1.use)(await (0, builder_util_1.resolveEnvToolsetPath)("APPIMAGE_TOOLS_PATH", "directory"), it => (isFuse2 ? getFuse2Paths(it) : getPaths(it)))) !== null && _a !== void 0 ? _a : (await download());
for (const entry of Object.entries(artifact)) {
if (!(await (0, builder_util_1.exists)(entry[1]))) {
throw new Error(`AppImage tool ${entry[0]} not found at path: ${entry[1]}`);
}
}
return artifact;
}
//# sourceMappingURL=linux.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,61 @@
import { Arch } from "builder-util";
import { Nullish } from "builder-util-runtime";
import { ToolsetConfig } from "../configuration";
import { ToolInfo } from "../util/bundledTool";
export declare const wincodesignChecksums: {
readonly "0.0.0": {};
readonly "1.0.0": {
readonly "rcedit-windows-2_0_0.zip": "589709935902545a8335190b08644cf61b46a9042e34c0c3ef0660a5aeddeaae";
readonly "win-codesign-darwin-arm64.zip": "7eb41c3e6e48a75ced6b3384de22185da4bb458960fa410970eedd4e838c5c14";
readonly "win-codesign-darwin-x86_64.zip": "3986c97429f002df63490193d7f787281836f055934e3cdd9e69c70a8acb695e";
readonly "win-codesign-linux-amd64.zip": "d362a1a981053841554867e3e9dff51fe420fd577b44653df89bd7d3c916b156";
readonly "win-codesign-linux-arm64.zip": "fb848d498281f081c937be48dd6ddaf49b0201f32210dfc816ad061c47ecd37b";
readonly "win-codesign-linux-i386.zip": "11f8d9ffbf5b01e3bf6321c6d93b9b5e43d0c2d2a9fde1bca07698f2eb967cdf";
readonly "win-codesign-windows-x64.zip": "1bd27f9fa553cb14bec8df530cb3caffcfb095f9dd187dab6eaf5e9b7d6e7bff";
readonly "windows-kits-bundle-10_0_26100_0.zip": "1a12c81024c3499c212fdc5fac34a918e6d199271a39dfc524f6d8da484329bd";
};
readonly "1.1.0": {
readonly "rcedit-windows-2_0_0.zip": "c66591ebe0919c60231f0bf79ff223e6504bfa69bc13edc1fa8bfc6177b73402";
readonly "win-codesign-darwin-arm64.zip": "3f263b0e53cdc5410f6165471b2e808aee3148dc792efa23a7c303e7a01e67b7";
readonly "win-codesign-darwin-x86_64.zip": "143fbdfcbc53bc273fa181356be8416829778452621484d39eadbe1ce49979ba";
readonly "win-codesign-linux-amd64.zip": "65477fe8e40709b0f998928afb8336f82413b123310bf5adaa8efb7ed6ed0eeb";
readonly "win-codesign-linux-arm64.zip": "575b01a966f2b775bbea119de263957378e2bd28cbd064d35f9e981827e37b59";
readonly "win-codesign-linux-i386.zip": "aa3ce90e9aaa3449a228a3fa30633cdeb6b2791913786677a85c59db1d985598";
readonly "win-codesign-windows-x64.zip": "6e5dcc5d7af7c00a7387e2101d1ad986aef80e963a3526da07bd0e65de484c30";
readonly "windows-kits-bundle-10_0_26100_0.zip": "284f18a2fde66e6ecfbefc3065926c9bfdf641761a9e6cd2bd26e18d1e328bf7";
};
};
type CodeSignVersionKey = keyof typeof wincodesignChecksums;
export declare function getSignToolPath(winCodeSign: ToolsetConfig["winCodeSign"] | Nullish, isWin: boolean): Promise<ToolInfo>;
export declare function getWindowsKitsBundle({ winCodeSign, arch }: {
winCodeSign: CodeSignVersionKey | Nullish;
arch: Arch;
}): Promise<{
kit: string;
appxAssets: string;
}>;
export declare function isOldWin6(): boolean;
export declare function getRceditBundle(winCodeSign: ToolsetConfig["winCodeSign"] | Nullish): Promise<{
x86: string;
x64: string;
}>;
export declare const nsisChecksums: {
readonly "0.0.0": {};
readonly "1.2.1": {
readonly "nsis-bundle-3.12.tar.gz": "56997fdefe25e7928a1a68b4583d08b240b66cf660234053b20131a74cc082f4";
};
};
type CustomNsisBinaryConfig = {
url: string | null;
checksum?: string | null;
version?: string | null;
};
export declare function getMakeNsisPath(nsis: ToolsetConfig["nsis"] | Nullish, customBinary?: CustomNsisBinaryConfig | null): Promise<ToolInfo>;
type CustomNsisResourcesConfig = {
url: string;
checksum: string;
version: string;
};
export declare function getNsisPluginsPath(nsis: ToolsetConfig["nsis"] | Nullish, customNsisResources?: CustomNsisResourcesConfig | null): Promise<string>;
export declare function getNsisElevatePath(nsis: ToolsetConfig["nsis"] | Nullish, customBinary?: CustomNsisBinaryConfig | null): Promise<string>;
export {};

View file

@ -0,0 +1,259 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.nsisChecksums = exports.wincodesignChecksums = void 0;
exports.getSignToolPath = getSignToolPath;
exports.getWindowsKitsBundle = getWindowsKitsBundle;
exports.isOldWin6 = isOldWin6;
exports.getRceditBundle = getRceditBundle;
exports.getMakeNsisPath = getMakeNsisPath;
exports.getNsisPluginsPath = getNsisPluginsPath;
exports.getNsisElevatePath = getNsisElevatePath;
const builder_util_1 = require("builder-util");
const fs_extra_1 = require("fs-extra");
const os = require("os");
const path = require("path");
const binDownload_1 = require("../binDownload");
const bundledTool_1 = require("../util/bundledTool");
const electronGet_1 = require("../util/electronGet");
const flags_1 = require("../util/flags");
function getLegacyWinCodeSignBin() {
return (0, electronGet_1.downloadBuilderToolset)({
releaseName: "winCodeSign-2.6.0",
filenameWithExt: "winCodeSign-2.6.0.7z",
checksums: { ["winCodeSign-2.6.0.7z"]: "cdaec7154dda7cc31f88d886e2489379a0625a737d610b5ae7f62a12f16743a4" },
});
}
exports.wincodesignChecksums = {
"0.0.0": {
// legacy — downloads winCodeSign-2.6.0 via getLegacyWinCodeSignBin()
},
"1.0.0": {
"rcedit-windows-2_0_0.zip": "589709935902545a8335190b08644cf61b46a9042e34c0c3ef0660a5aeddeaae",
"win-codesign-darwin-arm64.zip": "7eb41c3e6e48a75ced6b3384de22185da4bb458960fa410970eedd4e838c5c14",
"win-codesign-darwin-x86_64.zip": "3986c97429f002df63490193d7f787281836f055934e3cdd9e69c70a8acb695e",
"win-codesign-linux-amd64.zip": "d362a1a981053841554867e3e9dff51fe420fd577b44653df89bd7d3c916b156",
"win-codesign-linux-arm64.zip": "fb848d498281f081c937be48dd6ddaf49b0201f32210dfc816ad061c47ecd37b",
"win-codesign-linux-i386.zip": "11f8d9ffbf5b01e3bf6321c6d93b9b5e43d0c2d2a9fde1bca07698f2eb967cdf",
"win-codesign-windows-x64.zip": "1bd27f9fa553cb14bec8df530cb3caffcfb095f9dd187dab6eaf5e9b7d6e7bff",
"windows-kits-bundle-10_0_26100_0.zip": "1a12c81024c3499c212fdc5fac34a918e6d199271a39dfc524f6d8da484329bd",
},
"1.1.0": {
"rcedit-windows-2_0_0.zip": "c66591ebe0919c60231f0bf79ff223e6504bfa69bc13edc1fa8bfc6177b73402",
"win-codesign-darwin-arm64.zip": "3f263b0e53cdc5410f6165471b2e808aee3148dc792efa23a7c303e7a01e67b7",
"win-codesign-darwin-x86_64.zip": "143fbdfcbc53bc273fa181356be8416829778452621484d39eadbe1ce49979ba",
"win-codesign-linux-amd64.zip": "65477fe8e40709b0f998928afb8336f82413b123310bf5adaa8efb7ed6ed0eeb",
"win-codesign-linux-arm64.zip": "575b01a966f2b775bbea119de263957378e2bd28cbd064d35f9e981827e37b59",
"win-codesign-linux-i386.zip": "aa3ce90e9aaa3449a228a3fa30633cdeb6b2791913786677a85c59db1d985598",
"win-codesign-windows-x64.zip": "6e5dcc5d7af7c00a7387e2101d1ad986aef80e963a3526da07bd0e65de484c30",
"windows-kits-bundle-10_0_26100_0.zip": "284f18a2fde66e6ecfbefc3065926c9bfdf641761a9e6cd2bd26e18d1e328bf7",
},
};
function _getWindowsToolsBin(winCodeSign, file) {
return (0, binDownload_1.getBinFromUrl)(`win-codesign@${winCodeSign}`, file, exports.wincodesignChecksums[winCodeSign][file]);
}
async function getSignToolPath(winCodeSign, isWin) {
if ((0, flags_1.isUseSystemSigncode)()) {
return { path: "osslsigncode" };
}
const signToolPath = await (0, builder_util_1.resolveEnvToolsetPath)("SIGNTOOL_PATH", "file");
if (signToolPath != null) {
return { path: signToolPath };
}
if (isWin) {
// windows kits are always the target arch; signtool can be used by either arch.
const signtoolArch = process.arch === "x64" ? builder_util_1.Arch.x64 : process.arch === "arm64" ? builder_util_1.Arch.arm64 : builder_util_1.Arch.ia32;
return { path: await getWindowsSignToolExe({ winCodeSign, arch: signtoolArch }) };
}
else {
const vendor = await getOsslSigncodeBundle(winCodeSign);
return { path: vendor.path, env: vendor.env };
}
}
async function getWindowsKitsBundle({ winCodeSign, arch }) {
const kitPath = await (0, builder_util_1.resolveEnvToolsetPath)("ELECTRON_BUILDER_WINDOWS_KITS_PATH", "directory");
if (kitPath != null) {
return { kit: kitPath, appxAssets: kitPath };
}
const useLegacy = winCodeSign == null || winCodeSign === "0.0.0";
if (useLegacy) {
const vendorPath = await getLegacyWinCodeSignBin();
return { kit: path.resolve(vendorPath, "windows-10", arch === builder_util_1.Arch.arm64 ? "x64" : builder_util_1.Arch[arch]), appxAssets: vendorPath };
}
const file = "windows-kits-bundle-10_0_26100_0.zip";
const vendorPath = await _getWindowsToolsBin(winCodeSign, file);
return { kit: path.resolve(vendorPath, arch === builder_util_1.Arch.ia32 ? "x86" : builder_util_1.Arch[arch]), appxAssets: vendorPath };
}
function isOldWin6() {
const winVersion = os.release();
return winVersion.startsWith("6.") && !winVersion.startsWith("6.3");
}
async function getWindowsSignToolExe({ winCodeSign, arch }) {
if (winCodeSign === "0.0.0" || winCodeSign == null) {
// use modern signtool on Windows Server 2012 R2 to be able to sign AppX
const vendorPath = await getLegacyWinCodeSignBin();
if (isOldWin6()) {
return path.resolve(vendorPath, "windows-6", "signtool.exe");
}
else {
return path.resolve(vendorPath, "windows-10", process.arch === "ia32" ? "ia32" : "x64", "signtool.exe");
}
}
const vendorPath = await getWindowsKitsBundle({ winCodeSign, arch });
return path.resolve(vendorPath.kit, "signtool.exe");
}
async function getOsslSigncodeBundle(winCodeSign) {
const osslSigncodePath = await (0, builder_util_1.resolveEnvToolsetPath)("ELECTRON_BUILDER_OSSL_SIGNCODE_PATH", "file");
if (osslSigncodePath != null) {
return { path: osslSigncodePath };
}
if (process.platform === "win32" || process.env.USE_SYSTEM_OSSLSIGNCODE === "true") {
return { path: "osslsigncode" };
}
if (winCodeSign === "0.0.0" || winCodeSign == null) {
const vendorBase = path.resolve(await getLegacyWinCodeSignBin(), process.platform);
const vendorPath = process.platform === "darwin" ? path.resolve(vendorBase, "10.12") : vendorBase;
return { path: path.resolve(vendorPath, "osslsigncode"), env: process.platform === "darwin" ? (0, bundledTool_1.computeToolEnv)([path.resolve(vendorPath, "lib")]) : undefined };
}
const file = (() => {
if (process.platform === "linux") {
if (process.arch == "x64") {
return "win-codesign-linux-amd64.zip";
}
else if (process.arch === "arm64") {
return "win-codesign-linux-arm64.zip";
}
return "win-codesign-linux-i386.zip";
}
// darwin arm64
if (process.arch === "arm64") {
return "win-codesign-darwin-arm64.zip";
}
return "win-codesign-darwin-x86_64.zip";
})();
const vendorPath = await _getWindowsToolsBin(winCodeSign, file);
return { path: path.resolve(vendorPath, "osslsigncode") };
}
async function getRceditBundle(winCodeSign) {
const ia32 = "rcedit-ia32.exe";
const x86 = "rcedit-x86.exe";
const x64 = "rcedit-x64.exe";
const rcedit = await (0, builder_util_1.resolveEnvToolsetPath)("ELECTRON_BUILDER_RCEDIT_PATH", "directory");
if (rcedit != null) {
const overridePath = rcedit;
return { x86: path.resolve(overridePath, x86), x64: path.resolve(overridePath, x64) };
}
if (winCodeSign === "0.0.0" || winCodeSign == null) {
const vendorPath = await getLegacyWinCodeSignBin();
return { x86: path.resolve(vendorPath, ia32), x64: path.resolve(vendorPath, x64) };
}
const file = "rcedit-windows-2_0_0.zip";
const vendorPath = await _getWindowsToolsBin(winCodeSign, file);
return { x86: path.resolve(vendorPath, x86), x64: path.resolve(vendorPath, x64) };
}
// ─── NSIS toolset ────────────────────────────────────────────────────────────
function getLegacyNsisBin() {
// Warning: Don't use v3.0.4.2 - https://github.com/electron-userland/electron-builder/issues/6334
return (0, binDownload_1.getBinFromUrl)("nsis-3.0.4.1", "nsis-3.0.4.1.7z", "9877df902530f96357d13a7a31ae2b9df67f48b11ffc9a1700a7c961574ec5fa");
}
function getLegacyNsisResourcesBin() {
return (0, binDownload_1.getBinFromUrl)("nsis-resources-3.4.1", "nsis-resources-3.4.1.7z", "593a9a92ef958321293ac6a2ee61e64bf1bd543142a5bd6b3d310709cc924103");
}
exports.nsisChecksums = {
"0.0.0": {
// legacy — uses getLegacyNsisBin() / getLegacyNsisResourcesBin()
},
"1.2.1": {
// unified bundle
"nsis-bundle-3.12.tar.gz": "56997fdefe25e7928a1a68b4583d08b240b66cf660234053b20131a74cc082f4",
},
};
async function getNsisBundlePath(nsis, customBinary) {
var _a;
if ((customBinary === null || customBinary === void 0 ? void 0 : customBinary.url) && (customBinary === null || customBinary === void 0 ? void 0 : customBinary.checksum)) {
const binaryVersion = (_a = customBinary.version) !== null && _a !== void 0 ? _a : customBinary.checksum.substring(0, 8);
return (0, binDownload_1.getBinFromCustomLoc)("nsis", binaryVersion, customBinary.url, customBinary.checksum);
}
if (nsis === "0.0.0" || nsis == null) {
return getLegacyNsisBin();
}
const file = `nsis-bundle-3.12.tar.gz`;
return (0, electronGet_1.downloadBuilderToolset)({
releaseName: `nsis@${nsis}`,
filenameWithExt: file,
checksums: { [file]: exports.nsisChecksums[nsis][file] },
});
}
async function getMakeNsisPath(nsis, customBinary) {
const legacyBundle = (bundlePath) => {
// legacy bundle: platform-specific subdirectories, NSISDIR must be set explicitly
const env = { NSISDIR: bundlePath };
if (process.platform === "darwin") {
return { path: path.resolve(bundlePath, "mac", "makensis"), env };
}
else if (process.platform === "win32") {
return { path: path.resolve(bundlePath, "Bin", "makensis.exe"), env };
}
return { path: path.resolve(bundlePath, "linux", "makensis"), env };
};
const entrypointBundle = (bundlePath) => {
// the entrypoint script auto-sets NSISDIR
return { path: path.resolve(bundlePath, process.platform === "win32" ? "makensis.cmd" : "makensis") };
};
const overridePath = await (0, builder_util_1.resolveEnvToolsetPath)("ELECTRON_BUILDER_NSIS_DIR", "directory");
if (overridePath != null) {
// we have to search both to maintain backward compatibility
let potentialBundle = legacyBundle(overridePath);
if (await (0, builder_util_1.exists)(potentialBundle.path)) {
return potentialBundle;
}
potentialBundle = entrypointBundle(overridePath);
if (await (0, builder_util_1.exists)(potentialBundle.path)) {
return potentialBundle;
}
throw new Error(`${path.basename(potentialBundle.path)} executable not found in ELECTRON_BUILDER_NSIS_DIR: ${overridePath}`);
}
const bundlePath = await getNsisBundlePath(nsis, customBinary);
if (nsis === "0.0.0" || nsis == null) {
return legacyBundle(bundlePath);
}
return entrypointBundle(bundlePath);
}
async function getNsisPluginsPath(nsis, customNsisResources) {
const resolveCustomBundle = async (bundlePath, type) => {
// we have to search both to maintain backward compatibility
const potentialPaths = [path.resolve(bundlePath, "plugins"), path.resolve(bundlePath, "windows", "Plugins")];
for (const p of potentialPaths) {
if ((await (0, builder_util_1.exists)(p)) && (await (0, fs_extra_1.stat)(p)).isDirectory()) {
return p;
}
}
throw new Error(`Plugins directory not found in ${type}: ${bundlePath}. Expected to find in one of: ${potentialPaths.join(", ")}`);
};
const overridePath = await (0, builder_util_1.resolveEnvToolsetPath)("ELECTRON_BUILDER_NSIS_RESOURCES_DIR", "directory");
if (overridePath != null) {
return resolveCustomBundle(overridePath, "ELECTRON_BUILDER_NSIS_RESOURCES_DIR");
}
if (customNsisResources) {
const bundle = await (0, binDownload_1.getBinFromCustomLoc)("nsis-resources", customNsisResources.version, customNsisResources.url, customNsisResources.checksum);
return resolveCustomBundle(bundle, "CUSTOM_NSIS_RESOURCES");
}
if (nsis === "0.0.0" || nsis == null) {
return path.resolve(await getLegacyNsisResourcesBin(), "plugins");
}
return path.resolve(await getNsisBundlePath(nsis), "windows", "Plugins");
}
async function getNsisElevatePath(nsis, customBinary) {
const resolveElevate = async (dir, label) => {
const p = path.resolve(dir, "elevate.exe");
if ((await (0, builder_util_1.exists)(p)) && (await (0, fs_extra_1.stat)(p)).isFile()) {
return p;
}
throw new Error(`elevate.exe not found in ${label} directory: ${dir}. Expected path: ${p}`);
};
const overridePath = await (0, builder_util_1.resolveEnvToolsetPath)("ELECTRON_BUILDER_NSIS_DIR", "directory");
if (overridePath != null) {
return resolveElevate(overridePath, "ELECTRON_BUILDER_NSIS_DIR");
}
return resolveElevate(await getNsisBundlePath(nsis, customBinary), "NSIS bundle");
}
//# sourceMappingURL=windows.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,5 @@
import { ToolsetConfig } from "../configuration";
export declare function getWineToolset(wine: ToolsetConfig["wine"]): Promise<{
execPath: string;
env: Record<string, string>;
}>;

View file

@ -0,0 +1,100 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWineToolset = getWineToolset;
const builder_util_1 = require("builder-util");
const path = require("path");
const electronGet_1 = require("../util/electronGet");
const wineToolsChecksums = {
"0.0.0": {
"wine-4.0.1-mac.7z": "1baac808a67975b68b9226beea7b64ad0acc3e598a4b45c25bb5d2ae8cac655e",
},
"1.0.1": {
"wine-11.0-darwin-x86_64.tar.xz": "0a4a43867ef225c70ed8d4198aaba24a55cb0e52e5d67b0ac99563e6351a3c61",
"wine-11.0-linux-x86_64.tar.xz": "d8cf95442957b75c07166540142c96d8f7be6a68a572cc656194e7b42e8a0f13",
},
};
async function getWineToolset(wine) {
if (process.platform === "win32") {
throw new builder_util_1.InvalidConfigurationError(`Wine toolset is not supported on Windows, but got: ${wine}`);
}
const defaultEnv = { WINEDEBUG: "-all,err+all", WINEDLLOVERRIDES: "winemenubuilder.exe=d" };
const envPath = await (0, builder_util_1.resolveEnvToolsetPath)("ELECTRON_BUILDER_WINE_TOOLSET_DIR", "directory");
if (envPath != null) {
// Probe for the wine binary: modern bundles ship bin/wine; legacy bundles (e.g. wine-4.0.1-mac) ship bin/wine64.
const wineExecSubPath = (await (0, builder_util_1.exists)(path.join(envPath, "bin", "wine"))) ? "bin/wine" : "bin/wine64";
const { execPath, winePrefix, wineLibPath } = await createWineEnvironment(envPath, wineExecSubPath);
return {
execPath,
env: {
...defaultEnv,
WINEPREFIX: winePrefix,
DYLD_FALLBACK_LIBRARY_PATH: [wineLibPath, process.env.DYLD_FALLBACK_LIBRARY_PATH].filter(Boolean).join(path.delimiter),
LD_LIBRARY_PATH: [wineLibPath, process.env.LD_LIBRARY_PATH].filter(Boolean).join(path.delimiter),
},
};
}
const useSystemWine = process.env.USE_SYSTEM_WINE === "true";
const isLegacy = wine === "0.0.0" || wine == null;
const isLegacyOnLinux = isLegacy && process.platform === "linux";
if (useSystemWine || isLegacyOnLinux) {
return { execPath: "wine", env: defaultEnv };
}
const pkgConfig = () => {
if (isLegacy) {
return {
releaseName: "wine-4.0.1-mac",
filenameWithExt: "wine-4.0.1-mac.7z",
checksums: wineToolsChecksums["0.0.0"],
execPath: path.join("bin", "wine64"),
};
}
const filenameWithExt = process.platform === "darwin" ? "wine-11.0-darwin-x86_64.tar.xz" : "wine-11.0-linux-x86_64.tar.xz";
return {
releaseName: `wine@${wine}`,
filenameWithExt,
checksums: wineToolsChecksums[wine],
execPath: path.join("bin", "wine"),
};
};
const pkg = pkgConfig();
const toolsetPath = await (0, electronGet_1.downloadBuilderToolset)({
releaseName: pkg.releaseName,
filenameWithExt: pkg.filenameWithExt,
checksums: pkg.checksums,
githubOrgRepo: "electron-userland/electron-builder-binaries",
});
const { execPath, winePrefix, wineLibPath } = await createWineEnvironment(toolsetPath, pkg.execPath);
return {
execPath,
env: {
...defaultEnv,
WINEPREFIX: winePrefix,
DYLD_FALLBACK_LIBRARY_PATH: [wineLibPath, process.env.DYLD_FALLBACK_LIBRARY_PATH].filter(Boolean).join(path.delimiter),
LD_LIBRARY_PATH: [wineLibPath, process.env.LD_LIBRARY_PATH].filter(Boolean).join(path.delimiter),
},
};
async function createWineEnvironment(toolsetPath, execSubPath) {
const sanitizedWinePath = (0, builder_util_1.sanitizeDirPath)(toolsetPath);
const execPath = path.resolve(sanitizedWinePath, execSubPath);
const winePrefix = path.resolve(sanitizedWinePath, "wine-home");
for (const p of [execPath, winePrefix]) {
if (!(await (0, builder_util_1.exists)(p))) {
throw new builder_util_1.InvalidConfigurationError(`Wine toolset at "${toolsetPath}" is missing expected path: ${p}`);
}
}
// Modern bundles ship a `lib` dir; the legacy wine-4.0.1-mac bundle ships `lib64` instead.
let wineLibPath = null;
for (const libDir of ["lib", "lib64"]) {
const candidate = path.resolve(sanitizedWinePath, libDir);
if (await (0, builder_util_1.exists)(candidate)) {
wineLibPath = candidate;
break;
}
}
if (wineLibPath == null) {
throw new builder_util_1.InvalidConfigurationError(`Wine toolset at "${toolsetPath}" is missing expected library directory (lib or lib64)`);
}
return { execPath, winePrefix, wineLibPath };
}
}
//# sourceMappingURL=wine.js.map

File diff suppressed because one or more lines are too long