CityBEM-CityLayers-SaeedRay.../node_modules/@electron-forge/maker-squirrel/dist/MakerSquirrel.js

78 lines
8.2 KiB
JavaScript
Raw Normal View History

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
require("source-map-support/register");
var _makerBase = _interopRequireDefault(require("@electron-forge/maker-base"));
var _electronWinstaller = require("electron-winstaller");
var _fsExtra = _interopRequireDefault(require("fs-extra"));
var _path = _interopRequireDefault(require("path"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
class MakerSquirrel extends _makerBase.default {
constructor(...args) {
super(...args);
_defineProperty(this, "name", 'squirrel');
_defineProperty(this, "defaultPlatforms", ['win32']);
}
isSupportedOnCurrentPlatform() {
return this.isInstalled('electron-winstaller') && !process.env.DISABLE_SQUIRREL_TEST;
}
async make({
dir,
makeDir,
targetArch,
packageJSON,
appName,
forgeConfig
}) {
const outPath = _path.default.resolve(makeDir, `squirrel.windows/${targetArch}`);
await this.ensureDirectory(outPath);
const winstallerConfig = {
name: packageJSON.name,
title: appName,
noMsi: true,
exe: `${forgeConfig.packagerConfig.executableName || appName}.exe`,
setupExe: `${appName}-${packageJSON.version} Setup.exe`,
...this.config,
appDirectory: dir,
outputDirectory: outPath
};
await (0, _electronWinstaller.createWindowsInstaller)(winstallerConfig);
const nupkgVersion = (0, _electronWinstaller.convertVersion)(packageJSON.version);
const artifacts = [_path.default.resolve(outPath, 'RELEASES'), _path.default.resolve(outPath, winstallerConfig.setupExe || `${appName}Setup.exe`), _path.default.resolve(outPath, `${winstallerConfig.name}-${nupkgVersion}-full.nupkg`)];
const deltaPath = _path.default.resolve(outPath, `${winstallerConfig.name}-${nupkgVersion}-delta.nupkg`);
if (winstallerConfig.remoteReleases || (await _fsExtra.default.pathExists(deltaPath))) {
artifacts.push(deltaPath);
}
const msiPath = _path.default.resolve(outPath, winstallerConfig.setupMsi || `${appName}Setup.msi`);
if (!winstallerConfig.noMsi && (await _fsExtra.default.pathExists(msiPath))) {
artifacts.push(msiPath);
}
return artifacts;
}
}
exports.default = MakerSquirrel;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9NYWtlclNxdWlycmVsLnRzIl0sIm5hbWVzIjpbIk1ha2VyU3F1aXJyZWwiLCJNYWtlckJhc2UiLCJpc1N1cHBvcnRlZE9uQ3VycmVudFBsYXRmb3JtIiwiaXNJbnN0YWxsZWQiLCJwcm9jZXNzIiwiZW52IiwiRElTQUJMRV9TUVVJUlJFTF9URVNUIiwibWFrZSIsImRpciIsIm1ha2VEaXIiLCJ0YXJnZXRBcmNoIiwicGFja2FnZUpTT04iLCJhcHBOYW1lIiwiZm9yZ2VDb25maWciLCJvdXRQYXRoIiwicGF0aCIsInJlc29sdmUiLCJlbnN1cmVEaXJlY3RvcnkiLCJ3aW5zdGFsbGVyQ29uZmlnIiwibmFtZSIsInRpdGxlIiwibm9Nc2kiLCJleGUiLCJwYWNrYWdlckNvbmZpZyIsImV4ZWN1dGFibGVOYW1lIiwic2V0dXBFeGUiLCJ2ZXJzaW9uIiwiY29uZmlnIiwiYXBwRGlyZWN0b3J5Iiwib3V0cHV0RGlyZWN0b3J5IiwibnVwa2dWZXJzaW9uIiwiYXJ0aWZhY3RzIiwiZGVsdGFQYXRoIiwicmVtb3RlUmVsZWFzZXMiLCJmcyIsInBhdGhFeGlzdHMiLCJwdXNoIiwibXNpUGF0aCIsInNldHVwTXNpIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFBQTs7QUFHQTs7QUFDQTs7QUFDQTs7Ozs7O0FBSWUsTUFBTUEsYUFBTixTQUE0QkMsa0JBQTVCLENBQTJEO0FBQUE7QUFBQTs7QUFBQSxrQ0FDakUsVUFEaUU7O0FBQUEsOENBR3BDLENBQUMsT0FB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