-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: disable universal patch added, updated builder
- Loading branch information
Showing
4 changed files
with
856 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
diff --git a/node_modules/app-builder-lib/out/codeSign/signManager.js b/node_modules/app-builder-lib/out/codeSign/signManager.js | ||
new file mode 100644 | ||
index 0000000..09883b3 | ||
--- /dev/null | ||
+++ b/node_modules/app-builder-lib/out/codeSign/signManager.js | ||
@@ -0,0 +1,10 @@ | ||
+"use strict"; | ||
+Object.defineProperty(exports, "__esModule", { value: true }); | ||
+exports.SignManager = void 0; | ||
+class SignManager { | ||
+ constructor(packager) { | ||
+ this.packager = packager; | ||
+ } | ||
+} | ||
+exports.SignManager = SignManager; | ||
+//# sourceMappingURL=signManager.js.map | ||
\ No newline at end of file | ||
diff --git a/node_modules/app-builder-lib/out/targets/nsis/NsisTarget.js b/node_modules/app-builder-lib/out/targets/nsis/NsisTarget.js | ||
index e79c555..31aee98 100644 | ||
--- a/node_modules/app-builder-lib/out/targets/nsis/NsisTarget.js | ||
+++ b/node_modules/app-builder-lib/out/targets/nsis/NsisTarget.js | ||
@@ -56,8 +56,15 @@ class NsisTarget extends core_1.Target { | ||
} | ||
nsisUtil_1.NsisTargetOptions.resolve(this.options); | ||
} | ||
+ buildUniversalInstaller() { | ||
+ const buildSeparateInstallers = this.options.buildUniversalInstaller === false; | ||
+ return !buildSeparateInstallers; | ||
+ } | ||
build(appOutDir, arch) { | ||
this.archs.set(arch, appOutDir); | ||
+ if (!this.buildUniversalInstaller()) { | ||
+ return this.buildInstaller(new Map().set(arch, appOutDir)); | ||
+ } | ||
return Promise.resolve(); | ||
} | ||
get isBuildDifferentialAware() { | ||
@@ -94,7 +101,10 @@ class NsisTarget extends core_1.Target { | ||
return await createPackageFileInfo(archiveFile); | ||
} | ||
} | ||
- get installerFilenamePattern() { | ||
+ installerFilenamePattern(primaryArch, defaultArch) { | ||
+ if (!this.buildUniversalInstaller()) { | ||
+ return "${productName} " + (this.isPortable ? "" : "Setup ") + "${version}" + (primaryArch != null ? (0, builder_util_1.getArchSuffix)(primaryArch, defaultArch) : "") + ".${ext}"; | ||
+ } | ||
// tslint:disable:no-invalid-template-strings | ||
return "${productName} " + (this.isPortable ? "" : "Setup ") + "${version}.${ext}"; | ||
} | ||
@@ -102,8 +112,11 @@ class NsisTarget extends core_1.Target { | ||
return this.name === "portable"; | ||
} | ||
async finishBuild() { | ||
+ if (!this.buildUniversalInstaller()) { | ||
+ return this.packageHelper.finishBuild(); | ||
+ } | ||
try { | ||
- const { pattern } = this.packager.artifactPatternConfig(this.options, this.installerFilenamePattern); | ||
+ const { pattern } = this.packager.artifactPatternConfig(this.options, this.installerFilenamePattern()); | ||
const builds = new Set([this.archs]); | ||
if (pattern.includes("${arch}") && this.archs.size > 1) { | ||
; | ||
@@ -119,12 +132,13 @@ class NsisTarget extends core_1.Target { | ||
} | ||
} | ||
async buildInstaller(archs) { | ||
- var _a, _b; | ||
+ var _a, _b, _c; | ||
const primaryArch = archs.size === 1 ? ((_a = archs.keys().next().value) !== null && _a !== void 0 ? _a : null) : null; | ||
const packager = this.packager; | ||
const appInfo = packager.appInfo; | ||
const options = this.options; | ||
- const installerFilename = packager.expandArtifactNamePattern(options, "exe", primaryArch, this.installerFilenamePattern, false, this.packager.platformSpecificBuildOptions.defaultArch); | ||
+ const defaultArch = (_b = (0, platformPackager_1.chooseNotNull)(this.packager.platformSpecificBuildOptions.defaultArch, this.packager.config.defaultArch)) !== null && _b !== void 0 ? _b : undefined; | ||
+ const installerFilename = packager.expandArtifactNamePattern(options, "exe", primaryArch, this.installerFilenamePattern(primaryArch, defaultArch), false, defaultArch); | ||
const oneClick = options.oneClick !== false; | ||
const installerPath = path.join(this.outDir, installerFilename); | ||
const logFields = { | ||
@@ -160,7 +174,7 @@ class NsisTarget extends core_1.Target { | ||
BUILD_RESOURCES_DIR: packager.info.buildResourcesDir, | ||
APP_PACKAGE_NAME: (0, targetUtil_1.getWindowsInstallationAppPackageName)(appInfo.name), | ||
}; | ||
- if ((_b = options.customNsisBinary) === null || _b === void 0 ? void 0 : _b.debugLogging) { | ||
+ if ((_c = options.customNsisBinary) === null || _c === void 0 ? void 0 : _c.debugLogging) { | ||
defines.ENABLE_LOGGING_ELECTRON_BUILDER = null; | ||
} | ||
if (uninstallAppKey !== guid) { | ||
@@ -279,7 +293,7 @@ class NsisTarget extends core_1.Target { | ||
defines.UNINSTALLER_OUT_FILE = definesUninstaller.UNINSTALLER_OUT_FILE; | ||
await this.executeMakensis(defines, commands, sharedHeader + (await this.computeFinalScript(script, true, archs))); | ||
await Promise.all([packager.sign(installerPath), defines.UNINSTALLER_OUT_FILE == null ? Promise.resolve() : (0, fs_extra_1.unlink)(defines.UNINSTALLER_OUT_FILE)]); | ||
- const safeArtifactName = (0, platformPackager_1.computeSafeArtifactNameIfNeeded)(installerFilename, () => this.generateGitHubInstallerName()); | ||
+ const safeArtifactName = (0, platformPackager_1.computeSafeArtifactNameIfNeeded)(installerFilename, () => this.generateGitHubInstallerName(primaryArch, defaultArch)); | ||
let updateInfo; | ||
if (this.isWebInstaller) { | ||
updateInfo = (0, differentialUpdateInfoBuilder_1.createNsisWebDifferentialUpdateInfo)(installerPath, packageFiles); | ||
@@ -300,10 +314,11 @@ class NsisTarget extends core_1.Target { | ||
isWriteUpdateInfo: !this.isPortable, | ||
}); | ||
} | ||
- generateGitHubInstallerName() { | ||
+ generateGitHubInstallerName(primaryArch, defaultArch) { | ||
const appInfo = this.packager.appInfo; | ||
const classifier = appInfo.name.toLowerCase() === appInfo.name ? "setup-" : "Setup-"; | ||
- return `${appInfo.name}-${this.isPortable ? "" : classifier}${appInfo.version}.exe`; | ||
+ const archSuffix = !this.buildUniversalInstaller() && primaryArch != null ? (0, builder_util_1.getArchSuffix)(primaryArch, defaultArch) : ""; | ||
+ return `${appInfo.name}-${this.isPortable ? "" : classifier}${appInfo.version}${archSuffix}.exe`; | ||
} | ||
get isUnicodeEnabled() { | ||
return this.options.unicode !== false; | ||
diff --git a/node_modules/app-builder-lib/out/targets/nsis/WebInstallerTarget.js b/node_modules/app-builder-lib/out/targets/nsis/WebInstallerTarget.js | ||
index 9b75baa..b7a707d 100644 | ||
--- a/node_modules/app-builder-lib/out/targets/nsis/WebInstallerTarget.js | ||
+++ b/node_modules/app-builder-lib/out/targets/nsis/WebInstallerTarget.js | ||
@@ -1,6 +1,7 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WebInstallerTarget = void 0; | ||
+const builder_util_1 = require("builder-util"); | ||
const PublishManager_1 = require("../../publish/PublishManager"); | ||
const NsisTarget_1 = require("./NsisTarget"); | ||
/** @private */ | ||
@@ -27,8 +28,13 @@ class WebInstallerTarget extends NsisTarget_1.NsisTarget { | ||
defines.APP_PACKAGE_URL_IS_INCOMPLETE = null; | ||
defines.APP_PACKAGE_URL = appPackageUrl; | ||
} | ||
- get installerFilenamePattern() { | ||
- // tslint:disable:no-invalid-template-strings | ||
+ buildUniversalInstaller() { | ||
+ if (this.options.buildUniversalInstaller === false) { | ||
+ builder_util_1.log.warn({ buildUniversalInstaller: true }, "only universal builds are supported for nsis-web installers, overriding setting"); | ||
+ } | ||
+ return true; | ||
+ } | ||
+ installerFilenamePattern(_primaryArch, _defaultArch) { | ||
return "${productName} Web Setup ${version}.${ext}"; | ||
} | ||
generateGitHubInstallerName() { |
Oops, something went wrong.