update electron to v43
This commit is contained in:
parent
68ac0beedf
commit
fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions
69
electron/node_modules/app-builder-lib/out/targets/nsis/nsisUtil.js
generated
vendored
69
electron/node_modules/app-builder-lib/out/targets/nsis/nsisUtil.js
generated
vendored
|
|
@ -1,64 +1,43 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.UninstallerReader = exports.CopyElevateHelper = exports.AppPackageHelper = exports.NSIS_PATH = exports.NsisTargetOptions = exports.nsisTemplatesDir = void 0;
|
||||
exports.UninstallerReader = exports.CopyElevateHelper = exports.AppPackageHelper = exports.nsisTemplatesDir = void 0;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const binDownload_1 = require("../../binDownload");
|
||||
const fs_1 = require("builder-util/out/fs");
|
||||
const path = require("path");
|
||||
const pathManager_1 = require("../../util/pathManager");
|
||||
const fs = require("fs/promises");
|
||||
const path = require("path");
|
||||
const zlib = require("zlib");
|
||||
exports.nsisTemplatesDir = pathManager_1.getTemplatePath("nsis");
|
||||
exports.NsisTargetOptions = (() => {
|
||||
let _resolve;
|
||||
const promise = new Promise(resolve => (_resolve = resolve));
|
||||
return {
|
||||
then: (callback) => promise.then(callback),
|
||||
resolve: (options) => _resolve(options),
|
||||
};
|
||||
})();
|
||||
const NSIS_PATH = () => {
|
||||
const custom = process.env.ELECTRON_BUILDER_NSIS_DIR;
|
||||
if (custom != null && custom.length > 0) {
|
||||
return Promise.resolve(custom.trim());
|
||||
}
|
||||
return exports.NsisTargetOptions.then((options) => {
|
||||
if (options.customNsisBinary) {
|
||||
const { checksum, url, version } = options.customNsisBinary;
|
||||
if (checksum && url) {
|
||||
const binaryVersion = version || checksum.substr(0, 8);
|
||||
return binDownload_1.getBinFromCustomLoc("nsis", binaryVersion, url, checksum);
|
||||
}
|
||||
}
|
||||
// Warning: Don't use v3.0.4.2 - https://github.com/electron-userland/electron-builder/issues/6334
|
||||
// noinspection SpellCheckingInspection
|
||||
return binDownload_1.getBinFromUrl("nsis", "3.0.4.1", "VKMiizYdmNdJOWpRGz4trl4lD++BvYP2irAXpMilheUP0pc93iKlWAoP843Vlraj8YG19CVn0j+dCo/hURz9+Q==");
|
||||
});
|
||||
};
|
||||
exports.NSIS_PATH = NSIS_PATH;
|
||||
const windows_1 = require("../../toolsets/windows");
|
||||
const pathManager_1 = require("../../util/pathManager");
|
||||
exports.nsisTemplatesDir = (0, pathManager_1.getTemplatePath)("nsis");
|
||||
class AppPackageHelper {
|
||||
constructor(elevateHelper) {
|
||||
this.elevateHelper = elevateHelper;
|
||||
this.archToFileInfo = new Map();
|
||||
this.archToResult = new Map();
|
||||
this.infoToIsDelete = new Map();
|
||||
/** @private */
|
||||
this.refCount = 0;
|
||||
}
|
||||
async packArch(arch, target) {
|
||||
let infoPromise = this.archToFileInfo.get(arch);
|
||||
if (infoPromise == null) {
|
||||
let resultPromise = this.archToResult.get(arch);
|
||||
if (resultPromise == null) {
|
||||
const appOutDir = target.archs.get(arch);
|
||||
infoPromise = this.elevateHelper.copy(appOutDir, target).then(() => target.buildAppPackage(appOutDir, arch));
|
||||
this.archToFileInfo.set(arch, infoPromise);
|
||||
resultPromise = this.elevateHelper
|
||||
.copy(appOutDir, target)
|
||||
.then(() => target.buildAppPackage(appOutDir, arch))
|
||||
.then(async (fileInfo) => ({
|
||||
fileInfo,
|
||||
unpackedSize: await (0, builder_util_1.dirSize)(appOutDir),
|
||||
}));
|
||||
this.archToResult.set(arch, resultPromise);
|
||||
}
|
||||
const info = await infoPromise;
|
||||
const result = await resultPromise;
|
||||
const { fileInfo: info } = result;
|
||||
if (target.isWebInstaller) {
|
||||
this.infoToIsDelete.set(info, false);
|
||||
}
|
||||
else if (!this.infoToIsDelete.has(info)) {
|
||||
this.infoToIsDelete.set(info, true);
|
||||
}
|
||||
return info;
|
||||
return result;
|
||||
}
|
||||
async finishBuild() {
|
||||
if (--this.refCount > 0) {
|
||||
|
|
@ -79,6 +58,7 @@ class CopyElevateHelper {
|
|||
this.copied = new Map();
|
||||
}
|
||||
copy(appOutDir, target) {
|
||||
var _a;
|
||||
if (!target.packager.info.framework.isCopyElevateHelper) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
|
@ -94,11 +74,12 @@ class CopyElevateHelper {
|
|||
if (promise != null) {
|
||||
return promise;
|
||||
}
|
||||
promise = exports.NSIS_PATH().then(it => {
|
||||
promise = (0, windows_1.getNsisElevatePath)((_a = target.packager.config.toolsets) === null || _a === void 0 ? void 0 : _a.nsis, target.options.customNsisBinary).then(elevatePath => {
|
||||
const outFile = path.join(appOutDir, "resources", "elevate.exe");
|
||||
const promise = fs_1.copyFile(path.join(it, "elevate.exe"), outFile, false);
|
||||
if (target.packager.platformSpecificBuildOptions.signAndEditExecutable !== false) {
|
||||
return promise.then(() => target.packager.sign(outFile));
|
||||
const promise = (0, builder_util_1.copyFile)(elevatePath, outFile, false);
|
||||
const { signAndEditExecutable, signExecutable } = target.packager.platformSpecificBuildOptions;
|
||||
if (signAndEditExecutable !== false && signExecutable !== false) {
|
||||
return promise.then(() => target.packager.signIf(outFile));
|
||||
}
|
||||
return promise;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue