update electron to v43
All checks were successful
Android Build / publish (push) Successful in 55s
Linux Build / publish (push) Successful in 1m6s

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

@ -1,13 +1,49 @@
import { DmgOptions, Target } from "app-builder-lib";
import MacPackager from "app-builder-lib/out/macPackager";
import { MacPackager } from "app-builder-lib/out/macPackager";
import { Arch } from "builder-util";
import type { DmgBuildLicenseConfig } from "./dmgLicense";
export interface DmgBuildConfig {
title: string;
icon?: string | null;
"badge-icon"?: string | null;
background?: string | null;
"background-color"?: string | null;
"icon-size"?: number | null;
"text-size"?: number | null;
window?: {
position?: {
x?: number;
y?: number;
};
size?: {
width?: number;
height?: number;
};
};
format?: string;
size?: string | null;
shrink?: boolean;
filesystem?: string;
"compression-level"?: number | null;
license?: DmgBuildLicenseConfig | null;
contents?: Array<{
path: string;
x: number;
y: number;
name?: string;
type?: "file" | "link" | "position";
hide_extension?: boolean;
hidden?: boolean;
}>;
}
export declare class DmgTarget extends Target {
private readonly packager;
readonly outDir: string;
readonly options: DmgOptions;
isAsyncSupported: boolean;
constructor(packager: MacPackager, outDir: string);
build(appPath: string, arch: Arch): Promise<void>;
private signDmg;
computeVolumeName(arch: Arch, custom?: string | null): string;
computeDmgOptions(): Promise<DmgOptions>;
computeDmgOptions(appPath: string): Promise<DmgOptions>;
}

View file

@ -4,58 +4,40 @@ exports.DmgTarget = void 0;
const app_builder_lib_1 = require("app-builder-lib");
const macCodeSign_1 = require("app-builder-lib/out/codeSign/macCodeSign");
const differentialUpdateInfoBuilder_1 = require("app-builder-lib/out/targets/differentialUpdateInfoBuilder");
const appBuilder_1 = require("app-builder-lib/out/util/appBuilder");
const filename_1 = require("app-builder-lib/out/util/filename");
const builder_util_1 = require("builder-util");
const fs_1 = require("builder-util/out/fs");
const fs_extra_1 = require("fs-extra");
const filename_1 = require("builder-util/out/filename");
const os_1 = require("os");
const path = require("path");
const dmgLicense_1 = require("./dmgLicense");
const dmgUtil_1 = require("./dmgUtil");
const os_1 = require("os");
const hdiuil_1 = require("./hdiuil");
class DmgTarget extends app_builder_lib_1.Target {
constructor(packager, outDir) {
super("dmg");
this.packager = packager;
this.outDir = outDir;
this.options = this.packager.config.dmg || Object.create(null);
this.isAsyncSupported = false;
}
async build(appPath, arch) {
const packager = this.packager;
// tslint:disable-next-line:no-invalid-template-strings
const artifactName = packager.expandArtifactNamePattern(this.options, "dmg", arch, "${productName}-" + (packager.platformSpecificBuildOptions.bundleShortVersion || "${version}") + "-${arch}.${ext}", true, packager.platformSpecificBuildOptions.defaultArch);
const artifactPath = path.join(this.outDir, artifactName);
await packager.info.callArtifactBuildStarted({
await packager.info.emitArtifactBuildStarted({
targetPresentableName: "DMG",
file: artifactPath,
arch,
});
const volumeName = filename_1.sanitizeFileName(this.computeVolumeName(arch, this.options.title));
const tempDmg = await createStageDmg(await packager.getTempFile(".dmg"), appPath, volumeName);
const specification = await this.computeDmgOptions();
// https://github.com/electron-userland/electron-builder/issues/2115
const backgroundFile = specification.background == null ? null : await transformBackgroundFileIfNeed(specification.background, packager.info.tempDirManager);
const finalSize = await computeAssetSize(packager.info.cancellationToken, tempDmg, specification, backgroundFile);
const expandingFinalSize = finalSize * 0.1 + finalSize;
await builder_util_1.exec("hdiutil", ["resize", "-size", expandingFinalSize.toString(), tempDmg]);
const volumePath = path.join("/Volumes", volumeName);
if (await fs_1.exists(volumePath)) {
builder_util_1.log.debug({ volumePath }, "unmounting previous disk image");
await dmgUtil_1.detach(volumePath);
}
if (!(await dmgUtil_1.attachAndExecute(tempDmg, true, () => customizeDmg(volumePath, specification, packager, backgroundFile)))) {
const volumeName = (0, filename_1.sanitizeFileName)(this.computeVolumeName(arch, this.options.title));
const specification = await this.computeDmgOptions(appPath);
const licenseData = await (0, dmgLicense_1.addLicenseToDmg)(packager, this.options.license);
if (!(await (0, dmgUtil_1.customizeDmg)({ appPath, artifactPath, volumeName, specification, packager, licenseData }))) {
return;
}
// dmg file must not exist otherwise hdiutil failed (https://github.com/electron-userland/electron-builder/issues/1308#issuecomment-282847594), so, -ov must be specified
const args = ["convert", tempDmg, "-ov", "-format", specification.format, "-o", artifactPath];
if (specification.format === "UDZO") {
args.push("-imagekey", `zlib-level=${process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL || "9"}`);
if (this.options.internetEnabled && parseInt((0, os_1.release)().split(".")[0], 10) < 19) {
await (0, hdiuil_1.hdiUtil)(addLogLevel(["internet-enable"]).concat(artifactPath));
}
await builder_util_1.spawn("hdiutil", addLogLevel(args));
if (this.options.internetEnabled && parseInt(os_1.release().split(".")[0], 10) < 19) {
await builder_util_1.exec("hdiutil", addLogLevel(["internet-enable"]).concat(artifactPath));
}
const licenseData = await dmgLicense_1.addLicenseToDmg(packager, artifactPath);
if (packager.packagerOptions.effectiveOptionComputed != null) {
await packager.packagerOptions.effectiveOptionComputed({ licenseData });
}
@ -63,8 +45,8 @@ class DmgTarget extends app_builder_lib_1.Target {
await this.signDmg(artifactPath);
}
const safeArtifactName = packager.computeSafeArtifactName(artifactName, "dmg");
const updateInfo = this.options.writeUpdateInfo === false ? null : await differentialUpdateInfoBuilder_1.createBlockmap(artifactPath, this, packager, safeArtifactName);
await packager.info.callArtifactBuildCompleted({
const updateInfo = this.options.writeUpdateInfo === false ? null : await (0, differentialUpdateInfoBuilder_1.createBlockmap)(artifactPath, this, packager, safeArtifactName);
await packager.info.emitArtifactBuildCompleted({
file: artifactPath,
safeArtifactName,
target: this,
@ -75,7 +57,7 @@ class DmgTarget extends app_builder_lib_1.Target {
});
}
async signDmg(artifactPath) {
if (!macCodeSign_1.isSignAllowed(false)) {
if (!(0, macCodeSign_1.isSignAllowed)(false)) {
return;
}
const packager = this.packager;
@ -87,9 +69,9 @@ class DmgTarget extends app_builder_lib_1.Target {
}
const keychainFile = (await packager.codeSigningInfo.value).keychainFile;
const certificateType = "Developer ID Application";
let identity = await macCodeSign_1.findIdentity(certificateType, qualifier, keychainFile);
let identity = await (0, macCodeSign_1.findIdentity)(certificateType, qualifier, keychainFile);
if (identity == null) {
identity = await macCodeSign_1.findIdentity("Mac Developer", qualifier, keychainFile);
identity = await (0, macCodeSign_1.findIdentity)("Mac Developer", qualifier, keychainFile);
if (identity == null) {
return;
}
@ -99,12 +81,12 @@ class DmgTarget extends app_builder_lib_1.Target {
args.push("--keychain", keychainFile);
}
args.push(artifactPath);
await builder_util_1.exec("codesign", args);
await (0, builder_util_1.exec)("codesign", args);
}
computeVolumeName(arch, custom) {
const appInfo = this.packager.appInfo;
const shortVersion = this.packager.platformSpecificBuildOptions.bundleShortVersion || appInfo.version;
const archString = builder_util_1.getArchSuffix(arch, this.packager.platformSpecificBuildOptions.defaultArch);
const archString = (0, builder_util_1.getArchSuffix)(arch, this.packager.platformSpecificBuildOptions.defaultArch);
if (custom == null) {
return `${appInfo.productFilename} ${shortVersion}${archString}`;
}
@ -116,13 +98,13 @@ class DmgTarget extends app_builder_lib_1.Target {
.replace(/\${productName}/g, appInfo.productName);
}
// public to test
async computeDmgOptions() {
async computeDmgOptions(appPath) {
const packager = this.packager;
const specification = { ...this.options };
if (specification.icon == null && specification.icon !== null) {
specification.icon = await packager.getIconPath();
}
if (specification.icon != null && builder_util_1.isEmptyOrSpaces(specification.icon)) {
if (specification.icon != null && (0, builder_util_1.isEmptyOrSpaces)(specification.icon)) {
throw new builder_util_1.InvalidConfigurationError("dmg.icon cannot be specified as empty string");
}
const background = specification.background;
@ -132,14 +114,13 @@ class DmgTarget extends app_builder_lib_1.Target {
}
}
else if (background == null) {
specification.background = await dmgUtil_1.computeBackground(packager);
specification.background = await (0, dmgUtil_1.computeBackground)(packager);
}
else {
specification.background = path.resolve(packager.info.projectDir, background);
specification.background = await packager.getResource(background);
}
if (specification.format == null) {
if (process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL != null) {
;
specification.format = "UDZO";
}
else if (packager.compression === "store") {
@ -154,6 +135,9 @@ class DmgTarget extends app_builder_lib_1.Target {
{
x: 130,
y: 220,
path: appPath,
type: "file",
name: `${packager.appInfo.productFilename}.app`,
},
{
x: 410,
@ -167,154 +151,8 @@ class DmgTarget extends app_builder_lib_1.Target {
}
}
exports.DmgTarget = DmgTarget;
async function createStageDmg(tempDmg, appPath, volumeName) {
//noinspection SpellCheckingInspection
const imageArgs = addLogLevel(["create", "-srcfolder", appPath, "-volname", volumeName, "-anyowners", "-nospotlight", "-format", "UDRW"]);
if (builder_util_1.log.isDebugEnabled) {
imageArgs.push("-debug");
}
let filesystem = ["HFS+", "-fsargs", "-c c=64,a=16,e=16"];
if (process.arch === "arm64") {
// Apple Silicon `hdiutil` dropped support for HFS+, so we force the latest type
// https://github.com/electron-userland/electron-builder/issues/4606
filesystem = ["APFS"];
builder_util_1.log.warn(null, "Detected arm64 process, HFS+ is unavailable. Creating dmg with APFS - supports Mac OSX 10.12+");
}
imageArgs.push("-fs", ...filesystem);
imageArgs.push(tempDmg);
// The reason for retrying up to ten times is that hdiutil create in some cases fail to unmount due to "resource busy".
// https://github.com/electron-userland/electron-builder/issues/5431
await builder_util_1.retry(() => builder_util_1.spawn("hdiutil", imageArgs), 5, 1000);
return tempDmg;
}
function addLogLevel(args) {
args.push(process.env.DEBUG_DMG === "true" ? "-verbose" : "-quiet");
function addLogLevel(args, isVerbose = process.env.DEBUG_DMG === "true") {
args.push(isVerbose ? "-verbose" : "-quiet");
return args;
}
async function computeAssetSize(cancellationToken, dmgFile, specification, backgroundFile) {
const asyncTaskManager = new builder_util_1.AsyncTaskManager(cancellationToken);
asyncTaskManager.addTask(fs_extra_1.stat(dmgFile));
if (specification.icon != null) {
asyncTaskManager.addTask(fs_1.statOrNull(specification.icon));
}
if (backgroundFile != null) {
asyncTaskManager.addTask(fs_extra_1.stat(backgroundFile));
}
let result = 32 * 1024;
for (const stat of await asyncTaskManager.awaitTasks()) {
if (stat != null) {
result += stat.size;
}
}
return result;
}
async function customizeDmg(volumePath, specification, packager, backgroundFile) {
const window = specification.window;
const env = {
...process.env,
volumePath,
appFileName: `${packager.appInfo.productFilename}.app`,
iconSize: specification.iconSize || 80,
iconTextSize: specification.iconTextSize || 12,
PYTHONIOENCODING: "utf8",
};
if (specification.backgroundColor != null || specification.background == null) {
env.backgroundColor = specification.backgroundColor || "#ffffff";
if (window != null) {
env.windowX = (window.x == null ? 100 : window.x).toString();
env.windowY = (window.y == null ? 400 : window.y).toString();
env.windowWidth = (window.width || 540).toString();
env.windowHeight = (window.height || 380).toString();
}
}
else {
delete env.backgroundColor;
}
const args = ["dmg", "--volume", volumePath];
if (specification.icon != null) {
args.push("--icon", (await packager.getResource(specification.icon)));
}
if (backgroundFile != null) {
args.push("--background", backgroundFile);
}
const data = await appBuilder_1.executeAppBuilderAsJson(args);
if (data.backgroundWidth != null) {
env.windowWidth = window == null ? null : window.width;
env.windowHeight = window == null ? null : window.height;
if (env.windowWidth == null) {
env.windowWidth = data.backgroundWidth.toString();
}
if (env.windowHeight == null) {
env.windowHeight = data.backgroundHeight.toString();
}
if (env.windowX == null) {
env.windowX = 400;
}
if (env.windowY == null) {
env.windowY = Math.round((1440 - env.windowHeight) / 2).toString();
}
}
Object.assign(env, data);
const asyncTaskManager = new builder_util_1.AsyncTaskManager(packager.info.cancellationToken);
env.iconLocations = await computeDmgEntries(specification, volumePath, packager, asyncTaskManager);
await asyncTaskManager.awaitTasks();
const executePython = async (execName) => {
let pythonPath = process.env.PYTHON_PATH;
if (!pythonPath) {
pythonPath = (await builder_util_1.exec("which", [execName])).trim();
}
await builder_util_1.exec(pythonPath, [path.join(dmgUtil_1.getDmgVendorPath(), "dmgbuild/core.py")], {
cwd: dmgUtil_1.getDmgVendorPath(),
env,
});
};
try {
await executePython("python3");
}
catch (error) {
await executePython("python");
}
return packager.packagerOptions.effectiveOptionComputed == null || !(await packager.packagerOptions.effectiveOptionComputed({ volumePath, specification, packager }));
}
async function computeDmgEntries(specification, volumePath, packager, asyncTaskManager) {
let result = "";
for (const c of specification.contents) {
if (c.path != null && c.path.endsWith(".app") && c.type !== "link") {
builder_util_1.log.warn({ path: c.path, reason: "actual path to app will be used instead" }, "do not specify path for application");
}
const entryPath = c.path || `${packager.appInfo.productFilename}.app`;
const entryName = c.name || path.basename(entryPath);
const escapedEntryName = entryName.replace(/['\\]/g, match => `\\${match}`);
if (result.length !== 0) {
result += ",\n";
}
result += `'${escapedEntryName}': (${c.x}, ${c.y})`;
if (c.type === "link") {
asyncTaskManager.addTask(builder_util_1.exec("ln", ["-s", `/${entryPath.startsWith("/") ? entryPath.substring(1) : entryPath}`, `${volumePath}/${entryName}`]));
}
// use c.path instead of entryPath (to be sure that this logic is not applied to .app bundle) https://github.com/electron-userland/electron-builder/issues/2147
else if (!builder_util_1.isEmptyOrSpaces(c.path) && (c.type === "file" || c.type === "dir")) {
const source = await packager.getResource(c.path);
if (source == null) {
builder_util_1.log.warn({ entryPath, reason: "doesn't exist" }, "skipped DMG item copying");
continue;
}
const destination = `${volumePath}/${entryName}`;
asyncTaskManager.addTask(c.type === "dir" || (await fs_extra_1.stat(source)).isDirectory() ? fs_1.copyDir(source, destination) : fs_1.copyFile(source, destination));
}
}
return result;
}
async function transformBackgroundFileIfNeed(file, tmpDir) {
if (file.endsWith(".tiff") || file.endsWith(".TIFF")) {
return file;
}
const retinaFile = file.replace(/\.([a-z]+)$/, "@2x.$1");
if (await fs_1.exists(retinaFile)) {
const tiffFile = await tmpDir.getTempFile({ suffix: ".tiff" });
await builder_util_1.exec("tiffutil", ["-cathidpicheck", file, retinaFile, "-out", tiffFile]);
return tiffFile;
}
return file;
}
//# sourceMappingURL=dmg.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,8 +1,14 @@
import { PlatformPackager } from "app-builder-lib";
declare type LicenseConfig = {
$schema: string;
body: any[];
labels: any[];
export type DmgBuildLicenseConfig = {
"default-language": string;
licenses: Record<string, string>;
buttons?: Record<string, {
language?: string;
agree?: string;
disagree?: string;
print?: string;
save?: string;
message?: string;
}>;
};
export declare function addLicenseToDmg(packager: PlatformPackager<any>, dmgPath: string): Promise<LicenseConfig | null>;
export {};
export declare function addLicenseToDmg(packager: PlatformPackager<any>, explicitLicense?: string | Record<string, string> | null): Promise<DmgBuildLicenseConfig | null>;

View file

@ -1,48 +1,98 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addLicenseToDmg = void 0;
const builder_util_1 = require("builder-util");
const js_yaml_1 = require("js-yaml");
exports.addLicenseToDmg = addLicenseToDmg;
const license_1 = require("app-builder-lib/out/util/license");
const builder_util_1 = require("builder-util");
const fs_extra_1 = require("fs-extra");
const js_yaml_1 = require("js-yaml");
const licenseButtons_1 = require("./licenseButtons");
const dmg_license_1 = require("dmg-license");
async function addLicenseToDmg(packager, dmgPath) {
const licenseFiles = await license_1.getLicenseFiles(packager);
async function addLicenseToDmg(packager, explicitLicense) {
// null = explicitly disabled; skip both explicit and convention paths
if (explicitLicense === null) {
return null;
}
// Explicit config overrides file-naming convention
if (explicitLicense !== undefined) {
return buildExplicitLicenseConfig(packager, explicitLicense);
}
// File-naming convention: license_LANG.{rtf,txt,html}
return buildConventionLicenseConfig(packager);
}
async function buildExplicitLicenseConfig(packager, license) {
if (typeof license === "string") {
const resolvedPath = await packager.getResource(license);
if (resolvedPath == null) {
throw new builder_util_1.InvalidConfigurationError(`dmg.license file not found: "${license}"`);
}
return { "default-language": "en_US", licenses: { en_US: resolvedPath } };
}
// Record<langCode, filePath>
const licenses = {};
for (const [lang, filePath] of Object.entries(license)) {
const resolvedPath = await packager.getResource(filePath);
if (resolvedPath == null) {
throw new builder_util_1.InvalidConfigurationError(`dmg.license file not found for language "${lang}": "${filePath}"`);
}
licenses[lang] = resolvedPath;
}
if (Object.keys(licenses).length === 0) {
return null;
}
return {
"default-language": Object.keys(licenses)[0],
licenses,
};
}
async function buildConventionLicenseConfig(packager) {
var _a;
const licenseFiles = await (0, license_1.getLicenseFiles)(packager);
if (licenseFiles.length === 0) {
return null;
}
const licenseButtonFiles = await licenseButtons_1.getLicenseButtonsFile(packager);
const licenseButtonFiles = await (0, licenseButtons_1.getLicenseButtonsFile)(packager);
packager.debugLogger.add("dmg.licenseFiles", licenseFiles);
packager.debugLogger.add("dmg.licenseButtons", licenseButtonFiles);
const jsonFile = {
$schema: "https://github.com/argv-minus-one/dmg-license/raw/master/schema.json",
// defaultLang: '',
body: [],
labels: [],
};
const licenses = {};
for (const file of licenseFiles) {
jsonFile.body.push({
file: file.file,
lang: file.langWithRegion.replace("_", "-"),
});
}
for (const button of licenseButtonFiles) {
const filepath = button.file;
const label = filepath.endsWith(".yml") ? js_yaml_1.load(await fs_extra_1.readFile(filepath, "utf-8")) : await fs_extra_1.readJson(filepath);
if (label.description) {
// to support original button file format
label.message = label.description;
delete label.description;
if (licenses[file.langWithRegion] != null) {
throw new builder_util_1.InvalidConfigurationError(`Multiple license files found for language "${file.langWithRegion}": "${licenses[file.langWithRegion]}" and "${file.file}". Only one license file per language is supported.`);
}
jsonFile.labels.push(Object.assign({
lang: button.langWithRegion.replace("_", "-"),
}, label));
licenses[file.langWithRegion] = file.file;
}
await dmg_license_1.dmgLicenseFromJSON(dmgPath, jsonFile, {
onNonFatalError: builder_util_1.log.warn.bind(builder_util_1.log),
});
return jsonFile;
const result = {
"default-language": licenseFiles[0].langWithRegion,
licenses,
};
if (licenseButtonFiles.length > 0) {
const buttons = {};
for (const button of licenseButtonFiles) {
const filepath = button.file;
const raw = filepath.endsWith(".yml") ? (0, js_yaml_1.load)(await (0, fs_extra_1.readFile)(filepath, "utf-8"), { schema: js_yaml_1.CORE_SCHEMA }) : await (0, fs_extra_1.readJson)(filepath);
const entry = {};
if (raw.languageName != null) {
entry.language = raw.languageName;
}
if (raw.agree != null) {
entry.agree = raw.agree;
}
if (raw.disagree != null) {
entry.disagree = raw.disagree;
}
if (raw.print != null) {
entry.print = raw.print;
}
if (raw.save != null) {
entry.save = raw.save;
}
// support legacy `description` field as well as `message`
const msg = (_a = raw.message) !== null && _a !== void 0 ? _a : raw.description;
if (msg != null) {
entry.message = msg;
}
buttons[button.langWithRegion] = entry;
}
result.buttons = buttons;
}
return result;
}
exports.addLicenseToDmg = addLicenseToDmg;
//# sourceMappingURL=dmgLicense.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,22 @@
import { PlatformPackager } from "app-builder-lib";
import { DmgOptions, MacPackager, PlatformPackager } from "app-builder-lib";
import { TmpDir } from "builder-util";
import type { DmgBuildLicenseConfig } from "./dmgLicense";
export { DmgTarget } from "./dmg";
export declare function getDmgTemplatePath(): string;
export declare function getDmgVendorPath(): string;
export declare function attachAndExecute(dmgPath: string, readWrite: boolean, task: () => Promise<any>): Promise<any>;
export declare function detach(name: string): Promise<void>;
export declare function attachAndExecute(dmgPath: string, readWrite: boolean, forceDetach: boolean, task: (devicePath: string) => Promise<any>): Promise<any>;
export declare function detach(name: string, alwaysForce: boolean): Promise<string | null>;
export declare function computeBackground(packager: PlatformPackager<any>): Promise<string>;
type DmgBuilderConfig = {
appPath: string;
artifactPath: string;
volumeName: string;
specification: DmgOptions;
packager: MacPackager;
licenseData?: DmgBuildLicenseConfig | null;
};
export declare function customizeDmg({ appPath, artifactPath, volumeName, specification, packager, licenseData }: DmgBuilderConfig): Promise<boolean>;
export declare function transformBackgroundFileIfNeed(file: string, tmpDir: TmpDir): Promise<string>;
export declare function getImageSizeUsingSips(background: string): Promise<{
width: number;
height: number;
}>;

View file

@ -1,49 +1,103 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeString = exports.computeBackground = exports.detach = exports.attachAndExecute = exports.getDmgVendorPath = exports.getDmgTemplatePath = exports.DmgTarget = void 0;
exports.DmgTarget = void 0;
exports.getDmgTemplatePath = getDmgTemplatePath;
exports.attachAndExecute = attachAndExecute;
exports.detach = detach;
exports.computeBackground = computeBackground;
exports.serializeString = serializeString;
exports.customizeDmg = customizeDmg;
exports.transformBackgroundFileIfNeed = transformBackgroundFileIfNeed;
exports.getImageSizeUsingSips = getImageSizeUsingSips;
const electronGet_1 = require("app-builder-lib/out/util/electronGet");
const toolsetLock_1 = require("app-builder-lib/out/util/toolsetLock");
const builder_util_1 = require("builder-util");
const promise_1 = require("builder-util/out/promise");
const promises_1 = require("fs/promises");
const fs_extra_1 = require("fs-extra");
const path = require("path");
const hdiuil_1 = require("./hdiuil");
var dmg_1 = require("./dmg");
Object.defineProperty(exports, "DmgTarget", { enumerable: true, get: function () { return dmg_1.DmgTarget; } });
const root = path.join(__dirname, "..");
function getDmgTemplatePath() {
return path.join(root, "templates");
}
exports.getDmgTemplatePath = getDmgTemplatePath;
function getDmgVendorPath() {
return path.join(root, "vendor");
async function getDmgVendorPath() {
var _a;
const customDmgbuildPath = (_a = process.env.CUSTOM_DMGBUILD_PATH) === null || _a === void 0 ? void 0 : _a.trim();
if (customDmgbuildPath) {
const resolvedPath = path.resolve(customDmgbuildPath);
let dmgbuildStat;
try {
dmgbuildStat = await (0, promises_1.stat)(resolvedPath);
}
catch (e) {
if (e.code === "ENOENT") {
throw new Error(`CUSTOM_DMGBUILD_PATH "${resolvedPath}" does not exist`);
}
throw e;
}
if (!dmgbuildStat.isFile()) {
throw new Error(`CUSTOM_DMGBUILD_PATH "${resolvedPath}" is not a regular file`);
}
builder_util_1.log.warn({ path: resolvedPath }, "using CUSTOM_DMGBUILD_PATH override for dmgbuild binary");
return resolvedPath;
}
const arch = process.arch === "arm64" ? "arm64" : "x86_64";
// https://github.com/electron-userland/electron-builder-binaries/releases?q=dmg-builder&expanded=true
const file = await (0, electronGet_1.downloadBuilderToolset)({
releaseName: "dmg-builder@1.2.5",
filenameWithExt: `dmgbuild-bundle-${arch}-75c8a6c.tar.gz`,
checksums: {
"dmgbuild-bundle-arm64-75c8a6c.tar.gz": "793404d0c96687e27d5ee40a668d498c92e36a64d6c2906df511031adb33cbeb",
"dmgbuild-bundle-x86_64-75c8a6c.tar.gz": "1664972f9cc2d6e8fce3b63e42cd30078aff602669c5856939c4519921200433",
},
});
return path.resolve(file, "dmgbuild");
}
exports.getDmgVendorPath = getDmgVendorPath;
async function attachAndExecute(dmgPath, readWrite, task) {
async function attachAndExecute(dmgPath, readWrite, forceDetach, task) {
//noinspection SpellCheckingInspection
const args = ["attach", "-noverify", "-noautoopen"];
if (readWrite) {
args.push("-readwrite");
}
args.push(dmgPath);
const attachResult = await builder_util_1.exec("hdiutil", args);
const deviceResult = attachResult == null ? null : /^(\/dev\/\w+)/.exec(attachResult);
// Pipe "y\n" to stdin so that hdiutil auto-accepts any SLA/EULA dialog
// embedded in the DMG instead of blocking on a terminal prompt.
const attachResult = await (0, hdiuil_1.hdiUtilWithStdin)(args, "y\n");
// Use multiline flag so ^ matches any line start — the EULA text (if any)
// precedes the /dev/... device lines in hdiutil's stdout output.
const deviceResult = attachResult == null ? null : /^(\/dev\/\w+)/m.exec(attachResult);
const device = deviceResult == null || deviceResult.length !== 2 ? null : deviceResult[1];
if (device == null) {
throw new Error(`Cannot mount: ${attachResult}`);
}
return await promise_1.executeFinally(task(), () => detach(device));
}
exports.attachAndExecute = attachAndExecute;
async function detach(name) {
try {
await builder_util_1.exec("hdiutil", ["detach", "-quiet", name]);
// Find the volume mount path directly from hdiutil attach output.
// APFS images synthesize a new disk device (e.g. disk9) separate from the container disk
// (e.g. disk8), so device-name matching via hdiutil info misses the APFS volume.
let volumePath = null;
for (const line of attachResult.split("\n")) {
const match = /\s+(\/Volumes\/.+?)\s*$/.exec(line);
if (match) {
volumePath = match[1].trim();
break;
}
}
catch (e) {
await new Promise((resolve, reject) => {
setTimeout(() => {
builder_util_1.exec("hdiutil", ["detach", "-force", name]).then(resolve).catch(reject);
}, 1000);
});
if (volumePath == null) {
throw new Error(`Cannot find volume mount path for device: ${device}`);
}
return await (0, builder_util_1.executeFinally)(task(volumePath), () => detach(device, forceDetach));
}
async function detach(name, alwaysForce) {
return (0, hdiuil_1.hdiUtil)(["detach", "-quiet", name]).catch(async (e) => {
if (hdiuil_1.hdiutilTransientExitCodes.has(e.code) || alwaysForce) {
// Delay then force unmount with verbose output
await new Promise(resolve => setTimeout(resolve, 3000));
return (0, hdiuil_1.hdiUtil)(["detach", "-force", name]);
}
throw e;
});
}
exports.detach = detach;
async function computeBackground(packager) {
const resourceList = await packager.resourceList;
if (resourceList.includes("background.tiff")) {
@ -56,7 +110,6 @@ async function computeBackground(packager) {
return path.join(getDmgTemplatePath(), "background.tiff");
}
}
exports.computeBackground = computeBackground;
/** @internal */
function serializeString(data) {
return (' $"' +
@ -66,5 +119,140 @@ function serializeString(data) {
.join('"\n $"') +
'"');
}
exports.serializeString = serializeString;
async function customizeDmg({ appPath, artifactPath, volumeName, specification, packager, licenseData }) {
var _a, _b, _c, _d, _e, _f;
const isValidIconTextSize = !!specification.iconTextSize && specification.iconTextSize >= 10 && specification.iconTextSize <= 16;
const iconTextSize = isValidIconTextSize ? specification.iconTextSize : 12;
const volumePath = path.join("/Volumes", volumeName);
// https://github.com/electron-userland/electron-builder/issues/2115
const settings = {
title: path.basename(volumePath),
"icon-size": specification.iconSize,
"text-size": iconTextSize,
"compression-level": Number(process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL || "9"),
filesystem: specification.filesystem || "HFS+",
format: specification.format,
size: specification.size,
shrink: specification.shrink,
contents: ((_a = specification.contents) === null || _a === void 0 ? void 0 : _a.map(c => ({
path: c.path || appPath, // path is required, when ommitted, appPath is used (backward compatibility
x: c.x,
y: c.y,
name: c.name,
type: c.type === "dir" ? "file" : c.type, // appdmg expects "file" for directories
// hide_extension: c.hideExtension,
}))) || [],
};
if (specification.badgeIcon) {
let badgeIcon = await packager.getResource(specification.badgeIcon);
if (badgeIcon && badgeIcon.toLowerCase().endsWith(".icon")) {
badgeIcon = await packager.generateIcnsFromIcon(badgeIcon);
}
settings["badge-icon"] = badgeIcon;
}
else {
settings.icon = await packager.getResource(specification.icon);
}
if (specification.backgroundColor != null || specification.background == null) {
settings["background-color"] = specification.backgroundColor || "#ffffff";
const window = specification.window;
if (window != null) {
settings.window = {
position: {
x: (_b = window.x) !== null && _b !== void 0 ? _b : 100,
y: (_c = window.y) !== null && _c !== void 0 ? _c : 400,
},
size: {
width: (_d = window.width) !== null && _d !== void 0 ? _d : 540,
height: (_e = window.height) !== null && _e !== void 0 ? _e : 300,
},
};
}
}
else {
settings.background = specification.background == null ? null : await transformBackgroundFileIfNeed(specification.background, packager.info.tempDirManager);
}
if (!(0, builder_util_1.isEmptyOrSpaces)(settings.background)) {
const size = await getImageSizeUsingSips(settings.background);
settings.window = { position: { x: 400, y: Math.round((1440 - size.height) / 2) }, size, ...settings.window };
}
const workspaceRoot = await packager.info.getWorkspaceRoot();
for (const item of (_f = settings.contents) !== null && _f !== void 0 ? _f : []) {
if (item.type === "file" && item.path && path.isAbsolute(item.path)) {
if (!item.path.startsWith(workspaceRoot + path.sep) && item.path !== appPath) {
builder_util_1.log.error({ contentPath: item.path }, "dmg.contents path is outside the workspace root — verify this is intentional");
throw new builder_util_1.InvalidConfigurationError(`dmg.contents path "${item.path}" is outside the workspace root`);
}
}
}
if (licenseData) {
settings.license = licenseData;
}
const settingsFile = await packager.getTempFile(".json");
await (0, fs_extra_1.writeFile)(settingsFile, JSON.stringify(settings, null, 2));
const dmgbuild = await getDmgVendorPath();
await (0, toolsetLock_1.withToolsetLock)(() => (0, builder_util_1.exec)(dmgbuild, ["-s", settingsFile, path.basename(volumePath), artifactPath], {
env: {
...process.env,
PYTHONIOENCODING: "utf8",
},
}));
// effectiveOptionComputed, when present, is purely for verifying result during test execution
return (packager.packagerOptions.effectiveOptionComputed == null ||
(await attachAndExecute(artifactPath, false, true, async (volumePath) => {
var _a;
return !(await packager.packagerOptions.effectiveOptionComputed({
volumePath,
specification: {
...specification,
// clean up `contents` for test snapshot verification since app path is absolute to a unique tmp dir
contents: (_a = specification.contents) === null || _a === void 0 ? void 0 : _a.map((c) => {
var _a;
return ({
...c,
path: path.extname((_a = c.path) !== null && _a !== void 0 ? _a : "") === ".app" ? path.relative(packager.projectDir, c.path) : c.path,
});
}),
},
packager,
}));
})));
}
async function transformBackgroundFileIfNeed(file, tmpDir) {
if (path.extname(file.toLowerCase()) === ".tiff") {
return file;
}
const retinaFile = file.replace(/\.([a-z]+)$/, "@2x.$1");
if (await (0, builder_util_1.exists)(retinaFile)) {
const tiffFile = await tmpDir.getTempFile({ suffix: ".tiff" });
await (0, builder_util_1.exec)("tiffutil", ["-cathidpicheck", file, retinaFile, "-out", tiffFile]);
return tiffFile;
}
return file;
}
async function getImageSizeUsingSips(background) {
const stdout = await (0, builder_util_1.exec)("sips", ["-g", "pixelHeight", "-g", "pixelWidth", background]);
let width = 0;
let height = 0;
const re = /([a-zA-Z]+):\s*(\d+)/;
const lines = stdout.split("\n");
for (const line of lines) {
const match = re.exec(line);
if (!match) {
continue;
}
const key = match[1];
const value = parseInt(match[2], 10);
if (isNaN(value)) {
throw new Error(`Failed to parse number from line: "${line}"`);
}
if (key === "pixelWidth") {
width = value;
}
else if (key === "pixelHeight") {
height = value;
}
}
return { width, height };
}
//# sourceMappingURL=dmgUtil.js.map

File diff suppressed because one or more lines are too long

19
electron/node_modules/dmg-builder/out/hdiuil.d.ts generated vendored Normal file
View file

@ -0,0 +1,19 @@
/**
* Table of hdiutil error codes that are transient and can be retried.
* These codes are typically related to resource availability or temporary issues.
*
| Code | Meaning | Why Retry? |
| ------- | -------------------------------- | ---------------------------------------------------- |
| `1` | Generic error | Can occur from brief race conditions or temp issues. |
| `16` | **Resource busy** | Volume is in use wait and retry often works. |
| `35` | **Operation timed out** | System delay or timeout retry after a short delay. |
| `256` | Volume in use or unmount failure | Same as 16 usually resolves after retry. |
| `49153` | Volume not mounted yet | Attach may be too fast retry after delay. |
| `-5341` | Disk image too small | Retry *after fixing* with a larger `-size`. |
| `-5342` | Specified size too small | Same as above retry if size is corrected. |
*
*/
export declare const hdiutilTransientExitCodes: Set<number>;
export declare function explainHdiutilError(errorCode: number): string;
export declare function hdiUtil(args: string[]): Promise<string | null>;
export declare function hdiUtilWithStdin(args: string[], stdin: string): Promise<string | null>;

73
electron/node_modules/dmg-builder/out/hdiuil.js generated vendored Normal file
View file

@ -0,0 +1,73 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hdiutilTransientExitCodes = void 0;
exports.explainHdiutilError = explainHdiutilError;
exports.hdiUtil = hdiUtil;
exports.hdiUtilWithStdin = hdiUtilWithStdin;
const builder_util_1 = require("builder-util");
/**
* Table of hdiutil error codes that are transient and can be retried.
* These codes are typically related to resource availability or temporary issues.
*
| Code | Meaning | Why Retry? |
| ------- | -------------------------------- | ---------------------------------------------------- |
| `1` | Generic error | Can occur from brief race conditions or temp issues. |
| `16` | **Resource busy** | Volume is in use wait and retry often works. |
| `35` | **Operation timed out** | System delay or timeout retry after a short delay. |
| `256` | Volume in use or unmount failure | Same as 16 usually resolves after retry. |
| `49153` | Volume not mounted yet | Attach may be too fast retry after delay. |
| `-5341` | Disk image too small | Retry *after fixing* with a larger `-size`. |
| `-5342` | Specified size too small | Same as above retry if size is corrected. |
*
*/
exports.hdiutilTransientExitCodes = new Set([1, 16, 35, 256, 49153]);
function explainHdiutilError(errorCode) {
var _a;
const code = errorCode.toString();
const messages = {
"0": "Success: The hdiutil command completed without error.",
"1": "Generic error: The operation failed, but the reason is not specific. Check command syntax or permissions.",
"2": "No such file or directory: Check if the specified path exists.",
"6": "Disk image to resize is not currently attached or not recognized as a valid block device by macOS.",
"8": "Exec format error: The file might not be a valid disk image.",
"16": "Resource busy: The volume is in use. Try closing files or processes and retry.",
"22": "Invalid argument: One or more arguments passed to hdiutil are incorrect.",
"35": "Operation timed out: The system was too slow or unresponsive. Try again.",
"36": "I/O error: There was a problem reading or writing to disk. Check disk health.",
"100": "Image-related error: The disk image may be corrupted or invalid.",
"256": "Volume is busy or could not be unmounted. Try again after closing files.",
"49153": "Volume not mounted yet: The image may not have been fully attached.",
"-5341": "Disk image too small: hdiutil could not fit the contents. Increase the image size.",
"-5342": "Specified size too small: Disk image creation failed due to insufficient size.",
};
return (_a = messages[code]) !== null && _a !== void 0 ? _a : `Unknown error (code ${code}): Refer to hdiutil documentation or run with -verbose for details by rerunning with env var DEBUG_DEMB=true.`;
}
const shouldRetry = (args) => (error) => {
var _a, _b, _c;
const code = (_a = error.code) !== null && _a !== void 0 ? _a : -1;
const stderr = ((_b = error.stderr) === null || _b === void 0 ? void 0 : _b.toString()) || "";
const stdout = ((_c = error.stdout) === null || _c === void 0 ? void 0 : _c.toString()) || "";
const output = `${stdout} ${stderr}`.trim();
const willRetry = exports.hdiutilTransientExitCodes.has(code.toString());
builder_util_1.log.warn({ willRetry, args, code, output }, `hdiutil error: ${explainHdiutilError(code)}`);
return willRetry;
};
async function hdiUtil(args) {
return (0, builder_util_1.retry)(() => (0, builder_util_1.exec)("hdiutil", args), {
retries: 5,
interval: 5000,
backoff: 2000,
shouldRetry: shouldRetry(args),
});
}
// Like hdiUtil but pipes `stdin` to the process — used for `hdiutil attach` on
// DMGs that have an embedded SLA so the prompt is auto-accepted without blocking.
async function hdiUtilWithStdin(args, stdin) {
return (0, builder_util_1.retry)(() => (0, builder_util_1.spawnAndWriteWithOutput)("hdiutil", args, stdin).then(({ stdout }) => stdout || null), {
retries: 5,
interval: 5000,
backoff: 2000,
shouldRetry: shouldRetry(args),
});
}
//# sourceMappingURL=hdiuil.js.map

1
electron/node_modules/dmg-builder/out/hdiuil.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -1,9 +1,8 @@
import { PlatformPackager } from "app-builder-lib";
export declare function getLicenseButtonsFile(packager: PlatformPackager<any>): Promise<Array<LicenseButtonsFile>>;
export interface LicenseButtonsFile {
file: string;
lang: string;
langWithRegion: string;
langName: string;
}
export declare function getLicenseButtons(licenseButtonFiles: Array<LicenseButtonsFile>, langWithRegion: string, id: number, name: string): Promise<string>;
export declare function getLicenseButtonsFile(packager: PlatformPackager<any>): Promise<Array<LicenseButtonsFile>>;

View file

@ -1,144 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLicenseButtons = exports.getLicenseButtonsFile = void 0;
const builder_util_1 = require("builder-util");
exports.getLicenseButtonsFile = getLicenseButtonsFile;
const license_1 = require("app-builder-lib/out/util/license");
const fs_extra_1 = require("fs-extra");
const iconv = require("iconv-lite");
const js_yaml_1 = require("js-yaml");
const dmgUtil_1 = require("./dmgUtil");
const licenseDefaultButtons_1 = require("./licenseDefaultButtons");
async function getLicenseButtonsFile(packager) {
return license_1.getLicenseAssets((await packager.resourceList).filter(it => {
return (0, license_1.getLicenseAssets)((await packager.resourceList).filter(it => {
const name = it.toLowerCase();
// noinspection SpellCheckingInspection
return name.startsWith("licensebuttons_") && (name.endsWith(".json") || name.endsWith(".yml"));
}), packager);
}
exports.getLicenseButtonsFile = getLicenseButtonsFile;
async function getLicenseButtons(licenseButtonFiles, langWithRegion, id, name) {
let data = licenseDefaultButtons_1.getDefaultButtons(langWithRegion, id, name);
for (const item of licenseButtonFiles) {
if (item.langWithRegion !== langWithRegion) {
continue;
}
try {
const fileData = js_yaml_1.load(await fs_extra_1.readFile(item.file, "utf-8"));
const buttonsStr = labelToHex(fileData.lang, item.lang, item.langWithRegion) +
labelToHex(fileData.agree, item.lang, item.langWithRegion) +
labelToHex(fileData.disagree, item.lang, item.langWithRegion) +
labelToHex(fileData.print, item.lang, item.langWithRegion) +
labelToHex(fileData.save, item.lang, item.langWithRegion) +
labelToHex(fileData.description, item.lang, item.langWithRegion);
data = `data 'STR#' (${id}, "${name}") {\n`;
data += dmgUtil_1.serializeString("0006" + buttonsStr);
data += `\n};`;
if (builder_util_1.log.isDebugEnabled) {
builder_util_1.log.debug({ lang: item.langName, data }, `overwriting license buttons`);
}
return data;
}
catch (e) {
builder_util_1.log.debug({ error: e }, "cannot overwrite license buttons");
return data;
}
}
return data;
}
exports.getLicenseButtons = getLicenseButtons;
function labelToHex(label, lang, langWithRegion) {
const lbl = hexEncode(label, lang, langWithRegion).toString().toUpperCase();
const len = numberToHex(lbl.length / 2);
return len + lbl;
}
function numberToHex(nb) {
return ("0" + nb.toString(16)).slice(-2);
}
function hexEncode(str, lang, langWithRegion) {
const macCodePages = getMacCodePage(lang, langWithRegion);
let result = "";
for (let i = 0; i < str.length; i++) {
try {
let hex = getMacHexCode(str, i, macCodePages);
if (hex === undefined) {
hex = "3F"; //?
}
result += hex;
}
catch (e) {
builder_util_1.log.debug({ error: e, char: str[i] }, "cannot convert");
result += "3F"; //?
}
}
return result;
}
function getMacCodePage(lang, langWithRegion) {
switch (lang) {
case "ja": //japanese
return ["euc-jp"]; //Apple Japanese
case "zh": //chinese
if (langWithRegion === "zh_CN") {
return ["gb2312"]; //Apple Simplified Chinese (GB 2312)
}
return ["big5"]; //Apple Traditional Chinese (Big5)
case "ko": //korean
return ["euc-kr"]; //Apple Korean
case "ar": //arabic
case "ur": //urdu
return ["macarabic"]; //Apple Arabic
case "he": //hebrew
return ["machebrew"]; //Apple Hebrew
case "el": //greek
case "elc": //greek
return ["macgreek"]; //Apple Greek
case "ru": //russian
case "be": //belarussian
case "sr": //serbian
case "bg": //bulgarian
case "uz": //uzbek
return ["maccyrillic"]; //Apple Macintosh Cyrillic
case "ro": //romanian
return ["macromania"]; //Apple Romanian
case "uk": //ukrainian
return ["macukraine"]; //Apple Ukrainian
case "th": //thai
return ["macthai"]; //Apple Thai
case "et": //estonian
case "lt": //lithuanian
case "lv": //latvian
case "pl": //polish
case "hu": //hungarian
case "cs": //czech
case "sk": //slovak
return ["maccenteuro"]; //Apple Macintosh Central Europe
case "is": //icelandic
case "fo": //faroese
return ["maciceland"]; //Apple Icelandic
case "tr": //turkish
return ["macturkish"]; //Apple Turkish
case "hr": //croatian
case "sl": //slovenian
return ["maccroatian"]; //Apple Croatian
default:
return ["macroman"]; //Apple Macintosh Roman
}
}
function getMacHexCode(str, i, macCodePages) {
const code = str.charCodeAt(i);
if (code < 128) {
return code.toString(16);
}
else if (code < 256) {
return iconv.encode(str[i], "macroman").toString("hex");
}
else {
for (let i = 0; i < macCodePages.length; i++) {
const result = iconv.encode(str[i], macCodePages[i]).toString("hex");
if (result !== undefined) {
return result;
}
}
}
return code;
}
//# sourceMappingURL=licenseButtons.js.map

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
export declare function getDefaultButtons(langWithRegion: string, id: number, name: string): string;

View file

@ -1,261 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDefaultButtons = void 0;
function getDefaultButtons(langWithRegion, id, name) {
switch (langWithRegion) {
case "de_DE":
return `data 'STR#' (${id}, "${name}") {
$"0006 0744 6575 7473 6368 0B41 6B7A 6570"
$"7469 6572 656E 0841 626C 6568 6E65 6E07"
$"4472 7563 6B65 6E0A 5369 6368 6572 6E2E"
$"2E2E E74B 6C69 636B 656E 2053 6965 2069"
$"6E20 D241 6B7A 6570 7469 6572 656E D32C"
$"2077 656E 6E20 5369 6520 6D69 7420 6465"
$"6E20 4265 7374 696D 6D75 6E67 656E 2064"
$"6573 2053 6F66 7477 6172 652D 4C69 7A65"
$"6E7A 7665 7274 7261 6773 2065 696E 7665"
$"7273 7461 6E64 656E 2073 696E 642E 2046"
$"616C 6C73 206E 6963 6874 2C20 6269 7474"
$"6520 D241 626C 6568 6E65 6ED3 2061 6E6B"
$"6C69 636B 656E 2E20 5369 6520 6B9A 6E6E"
$"656E 2064 6965 2053 6F66 7477 6172 6520"
$"6E75 7220 696E 7374 616C 6C69 6572 656E"
$"2C20 7765 6E6E 2053 6965 20D2 416B 7A65"
$"7074 6965 7265 6ED3 2061 6E67 656B 6C69"
$"636B 7420 6861 6265 6E2E"
};`;
case "fr_FR":
return `data 'STR#' (${id}, "${name}") {
$"0006 0846 7261 6E8D 6169 7308 4163 6365"
$"7074 6572 0752 6566 7573 6572 0849 6D70"
$"7269 6D65 720E 456E 7265 6769 7374 7265"
$"722E 2E2E BA53 6920 766F 7573 2061 6363"
$"6570 7465 7A20 6C65 7320 7465 726D 6573"
$"2064 6520 6C61 2070 728E 7365 6E74 6520"
$"6C69 6365 6E63 652C 2063 6C69 7175 657A"
$"2073 7572 2022 4163 6365 7074 6572 2220"
$"6166 696E 2064 2769 6E73 7461 6C6C 6572"
$"206C 6520 6C6F 6769 6369 656C 2E20 5369"
$"2076 6F75 7320 6E27 9074 6573 2070 6173"
$"2064 2761 6363 6F72 6420 6176 6563 206C"
$"6573 2074 6572 6D65 7320 6465 206C 6120"
$"6C69 6365 6E63 652C 2063 6C69 7175 657A"
$"2073 7572 2022 5265 6675 7365 7222 2E"
};`;
case "fr_CA":
return `data 'STR#' (${id}, "${name}") {
$"0006 1146 7261 6E8D 6169 7320 6361 6E61"
$"6469 656E 0841 6363 6570 7465 7207 5265"
$"6675 7365 7208 496D 7072 696D 6572 0E45"
$"6E72 6567 6973 7472 6572 2E2E 2EBA 5369"
$"2076 6F75 7320 6163 6365 7074 657A 206C"
$"6573 2074 6572 6D65 7320 6465 206C 6120"
$"7072 8E73 656E 7465 206C 6963 656E 6365"
$"2C20 636C 6971 7565 7A20 7375 7220 2241"
$"6363 6570 7465 7222 2061 6669 6E20 6427"
$"696E 7374 616C 6C65 7220 6C65 206C 6F67"
$"6963 6965 6C2E 2053 6920 766F 7573 206E"
$"2790 7465 7320 7061 7320 6427 6163 636F"
$"7264 2061 7665 6320 6C65 7320 7465 726D"
$"6573 2064 6520 6C61 206C 6963 656E 6365"
$"2C20 636C 6971 7565 7A20 7375 7220 2252"
$"6566 7573 6572 222E"
};`;
case "es_ES":
return `data 'STR#' (${id}, "${name}") {
$"0006 0745 7370 6196 6F6C 0741 6365 7074"
$"6172 0A4E 6F20 6163 6570 7461 7208 496D"
$"7072 696D 6972 0A47 7561 7264 6172 2E2E"
$"2EC0 5369 2065 7374 8720 6465 2061 6375"
$"6572 646F 2063 6F6E 206C 6F73 2074 8E72"
$"6D69 6E6F 7320 6465 2065 7374 6120 6C69"
$"6365 6E63 6961 2C20 7075 6C73 6520 2241"
$"6365 7074 6172 2220 7061 7261 2069 6E73"
$"7461 6C61 7220 656C 2073 6F66 7477 6172"
$"652E 2045 6E20 656C 2073 7570 7565 7374"
$"6F20 6465 2071 7565 206E 6F20 6573 748E"
$"2064 6520 6163 7565 7264 6F20 636F 6E20"
$"6C6F 7320 748E 726D 696E 6F73 2064 6520"
$"6573 7461 206C 6963 656E 6369 612C 2070"
$"756C 7365 2022 4E6F 2061 6365 7074 6172"
$"2E22"
};`;
case "it_IT":
return `data 'STR#' (${id}, "${name}") {
$"0006 0849 7461 6C69 616E 6F07 4163 6365"
$"7474 6F07 5269 6669 7574 6F06 5374 616D"
$"7061 0B52 6567 6973 7472 612E 2E2E 7F53"
$"6520 6163 6365 7474 6920 6C65 2063 6F6E"
$"6469 7A69 6F6E 6920 6469 2071 7565 7374"
$"6120 6C69 6365 6E7A 612C 2066 6169 2063"
$"6C69 6320 7375 2022 4163 6365 7474 6F22"
$"2070 6572 2069 6E73 7461 6C6C 6172 6520"
$"696C 2073 6F66 7477 6172 652E 2041 6C74"
$"7269 6D65 6E74 6920 6661 6920 636C 6963"
$"2073 7520 2252 6966 6975 746F 222E"
};`;
case "ja_JP":
return `data 'STR#' (${id}, "${name}") {
$"0006 084A 6170 616E 6573 650A 93AF 88D3"
$"82B5 82DC 82B7 0C93 AF88 D382 B582 DC82"
$"B982 F108 88F3 8DFC 82B7 82E9 0795 DB91"
$"B62E 2E2E B496 7B83 5C83 7483 6783 4583"
$"4783 418E 6797 708B 9691 F88C 5F96 F182"
$"CC8F F08C 8F82 C993 AF88 D382 B382 EA82"
$"E98F EA8D 8782 C982 CD81 4183 5C83 7483"
$"6783 4583 4783 4182 F083 4383 9383 5883"
$"6781 5B83 8B82 B782 E982 BD82 DF82 C981"
$"7593 AF88 D382 B582 DC82 B781 7682 F089"
$"9F82 B582 C482 AD82 BE82 B382 A281 4281"
$"4093 AF88 D382 B382 EA82 C882 A28F EA8D"
$"8782 C982 CD81 4181 7593 AF88 D382 B582"
$"DC82 B982 F181 7682 F089 9F82 B582 C482"
$"AD82 BE82 B382 A281 42"
};`;
case "nl_NL":
return `data 'STR#' (${id}, "${name}") {
$"0006 0A4E 6564 6572 6C61 6E64 7302 4A61"
$"034E 6565 0550 7269 6E74 0942 6577 6161"
$"722E 2E2E A449 6E64 6965 6E20 7520 616B"
$"6B6F 6F72 6420 6761 6174 206D 6574 2064"
$"6520 766F 6F72 7761 6172 6465 6E20 7661"
$"6E20 6465 7A65 206C 6963 656E 7469 652C"
$"206B 756E 7420 7520 6F70 2027 4A61 2720"
$"6B6C 696B 6B65 6E20 6F6D 2064 6520 7072"
$"6F67 7261 6D6D 6174 7575 7220 7465 2069"
$"6E73 7461 6C6C 6572 656E 2E20 496E 6469"
$"656E 2075 206E 6965 7420 616B 6B6F 6F72"
$"6420 6761 6174 2C20 6B6C 696B 7420 7520"
$"6F70 2027 4E65 6527 2E"
};`;
case "sv_SE":
return `data 'STR#' (${id}, "${name}") {
$"0006 0653 7665 6E73 6B08 476F 646B 8A6E"
$"6E73 0641 7662 9A6A 7308 536B 7269 7620"
$"7574 0853 7061 7261 2E2E 2E93 4F6D 2044"
$"7520 676F 646B 8A6E 6E65 7220 6C69 6365"
$"6E73 7669 6C6C 6B6F 7265 6E20 6B6C 6963"
$"6B61 2070 8C20 2247 6F64 6B8A 6E6E 7322"
$"2066 9A72 2061 7474 2069 6E73 7461 6C6C"
$"6572 6120 7072 6F67 7261 6D70 726F 6475"
$"6B74 656E 2E20 4F6D 2044 7520 696E 7465"
$"2067 6F64 6B8A 6E6E 6572 206C 6963 656E"
$"7376 696C 6C6B 6F72 656E 2C20 6B6C 6963"
$"6B61 2070 8C20 2241 7662 9A6A 7322 2E"
};`;
case "br_FR":
return `data 'STR#' (${id}, "${name}") {
$"0006 1150 6F72 7475 6775 9073 2C20 4272"
$"6173 696C 0943 6F6E 636F 7264 6172 0944"
$"6973 636F 7264 6172 0849 6D70 7269 6D69"
$"7209 5361 6C76 6172 2E2E 2E8C 5365 2065"
$"7374 8720 6465 2061 636F 7264 6F20 636F"
$"6D20 6F73 2074 6572 6D6F 7320 6465 7374"
$"6120 6C69 6365 6E8D 612C 2070 7265 7373"
$"696F 6E65 2022 436F 6E63 6F72 6461 7222"
$"2070 6172 6120 696E 7374 616C 6172 206F"
$"2073 6F66 7477 6172 652E 2053 6520 6E8B"
$"6F20 6573 7487 2064 6520 6163 6F72 646F"
$"2C20 7072 6573 7369 6F6E 6520 2244 6973"
$"636F 7264 6172 222E"
};`;
case "zh_TW":
return `data 'STR#' (${id}, "${name}") {
$"0006 1354 7261 6469 7469 6F6E 616C 2043"
$"6869 6E65 7365 04A6 50B7 4E06 A4A3 A650"
$"B74E 04A6 43A6 4C06 C078 A673 A14B 50A6"
$"70AA 47B1 7AA6 50B7 4EA5 BBB3 5CA5 69C3"
$"D2B8 CCAA BAB1 F8B4 DAA1 41BD D0AB F6A1"
$"A7A6 50B7 4EA1 A8A5 48A6 77B8 CBB3 6EC5"
$"E9A1 43A6 70AA 47A4 A3A6 50B7 4EA1 41BD"
$"D0AB F6A1 A7A4 A3A6 50B7 4EA1 A8A1 43"
};`;
case "zh_CN":
return `data 'STR#' (${id}, "${name}") {
$"0006 1253 696D 706C 6966 6965 6420 4368"
$"696E 6573 6504 CDAC D2E2 06B2 BBCD ACD2"
$"E204 B4F2 D3A1 06B4 E6B4 A2A1 AD54 C8E7"
$"B9FB C4FA CDAC D2E2 B1BE D0ED BFC9 D0AD"
$"D2E9 B5C4 CCF5 BFEE A3AC C7EB B0B4 A1B0"
$"CDAC D2E2 A1B1 C0B4 B0B2 D7B0 B4CB C8ED"
$"BCFE A1A3 C8E7 B9FB C4FA B2BB CDAC D2E2"
$"A3AC C7EB B0B4 A1B0 B2BB CDAC D2E2 A1B1"
$"A1A3"
};`;
case "da_DK":
return `data 'STR#' (${id}, "${name}") {
$"0006 0544 616E 736B 0445 6E69 6705 5565"
$"6E69 6707 5564 736B 7269 760A 4172 6B69"
$"7665 722E 2E2E 9848 7669 7320 6475 2061"
$"6363 6570 7465 7265 7220 6265 7469 6E67"
$"656C 7365 726E 6520 6920 6C69 6365 6E73"
$"6166 7461 6C65 6E2C 2073 6B61 6C20 6475"
$"206B 6C69 6B6B 6520 708C 20D2 456E 6967"
$"D320 666F 7220 6174 2069 6E73 7461 6C6C"
$"6572 6520 736F 6674 7761 7265 6E2E 204B"
$"6C69 6B20 708C 20D2 5565 6E69 67D3 2066"
$"6F72 2061 7420 616E 6E75 6C6C 6572 6520"
$"696E 7374 616C 6C65 7269 6E67 656E 2E"
};`;
case "fi_FI":
return `data 'STR#' (${id}, "${name}") {
$"0006 0553 756F 6D69 0848 7976 8A6B 7379"
$"6E0A 456E 2068 7976 8A6B 7379 0754 756C"
$"6F73 7461 0954 616C 6C65 6E6E 61C9 6F48"
$"7976 8A6B 7379 206C 6973 656E 7373 6973"
$"6F70 696D 756B 7365 6E20 6568 646F 7420"
$"6F73 6F69 7474 616D 616C 6C61 20D5 4879"
$"768A 6B73 79D5 2E20 4A6F 7320 6574 2068"
$"7976 8A6B 7379 2073 6F70 696D 756B 7365"
$"6E20 6568 746F 6A61 2C20 6F73 6F69 7461"
$"20D5 456E 2068 7976 8A6B 7379 D52E"
};`;
case "ko_KR":
return `data 'STR#' (${id}, "${name}") {
$"0006 064B 6F72 6561 6E04 B5BF C0C7 09B5"
$"BFC0 C720 BEC8 C7D4 06C7 C1B8 B0C6 AE07"
$"C0FA C0E5 2E2E 2E7E BBE7 BFEB 20B0 E8BE"
$"E0BC ADC0 C720 B3BB BFEB BFA1 20B5 BFC0"
$"C7C7 CFB8 E92C 2022 B5BF C0C7 2220 B4DC"
$"C3DF B8A6 20B4 ADB7 AF20 BCD2 C7C1 C6AE"
$"BFFE BEEE B8A6 20BC B3C4 A1C7 CFBD CABD"
$"C3BF C02E 20B5 BFC0 C7C7 CFC1 F620 BECA"
$"B4C2 B4D9 B8E9 2C20 22B5 BFC0 C720 BEC8"
$"C7D4 2220 B4DC C3DF B8A6 20B4 A9B8 A3BD"
$"CABD C3BF C02E"
};`;
case "nb_NO":
return `data 'STR#' (${id}, "${name}") {
$"0006 054E 6F72 736B 0445 6E69 6709 496B"
$"6B65 2065 6E69 6708 536B 7269 7620 7574"
$"0A41 726B 6976 6572 2E2E 2EA3 4876 6973"
$"2044 6520 6572 2065 6E69 6720 6920 6265"
$"7374 656D 6D65 6C73 656E 6520 6920 6465"
$"6E6E 6520 6C69 7365 6E73 6176 7461 6C65"
$"6E2C 206B 6C69 6B6B 6572 2044 6520 708C"
$"2022 456E 6967 222D 6B6E 6170 7065 6E20"
$"666F 7220 8C20 696E 7374 616C 6C65 7265"
$"2070 726F 6772 616D 7661 7265 6E2E 2048"
$"7669 7320 4465 2069 6B6B 6520 6572 2065"
$"6E69 672C 206B 6C69 6B6B 6572 2044 6520"
$"708C 2022 496B 6B65 2065 6E69 6722 2E"
};`;
default:
// en_US
return `data 'STR#' (${id}, "${name}") {
$"0006 0745 6E67 6C69 7368 0541 6772 6565"
$"0844 6973 6167 7265 6505 5072 696E 7407"
$"5361 7665 2E2E 2E7A 4966 2079 6F75 2061"
$"6772 6565 2077 6974 6820 7468 6520 7465"
$"726D 7320 6F66 2074 6869 7320 6C69 6365"
$"6E73 652C 2070 7265 7373 20D2 4167 7265"
$"65D3 2074 6F20 696E 7374 616C 6C20 7468"
$"6520 736F 6674 7761 7265 2E20 4966 2079"
$"6F75 2064 6F20 6E6F 7420 6167 7265 652C"
$"2070 7265 7373 20D2 4469 7361 6772 6565"
$"D32E"
};`;
}
}
exports.getDefaultButtons = getDefaultButtons;
//# sourceMappingURL=licenseDefaultButtons.js.map

File diff suppressed because one or more lines are too long