WebInstallerTarget.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.WebInstallerTarget = void 0;
  4. const PublishManager_1 = require("../../publish/PublishManager");
  5. const NsisTarget_1 = require("./NsisTarget");
  6. /** @private */
  7. class WebInstallerTarget extends NsisTarget_1.NsisTarget {
  8. constructor(packager, outDir, targetName, packageHelper) {
  9. super(packager, outDir, targetName, packageHelper);
  10. }
  11. get isWebInstaller() {
  12. return true;
  13. }
  14. async configureDefines(oneClick, defines) {
  15. //noinspection ES6MissingAwait
  16. await NsisTarget_1.NsisTarget.prototype.configureDefines.call(this, oneClick, defines);
  17. const packager = this.packager;
  18. const options = this.options;
  19. let appPackageUrl = options.appPackageUrl;
  20. if (appPackageUrl == null) {
  21. const publishConfigs = await (0, PublishManager_1.getPublishConfigsForUpdateInfo)(packager, await (0, PublishManager_1.getPublishConfigs)(packager, packager.info.config, null, false), null);
  22. if (publishConfigs == null || publishConfigs.length === 0) {
  23. throw new Error("Cannot compute app package download URL");
  24. }
  25. appPackageUrl = (0, PublishManager_1.computeDownloadUrl)(publishConfigs[0], null, packager);
  26. }
  27. defines.APP_PACKAGE_URL_IS_INCOMPLETE = null;
  28. defines.APP_PACKAGE_URL = appPackageUrl;
  29. }
  30. get installerFilenamePattern() {
  31. // tslint:disable:no-invalid-template-strings
  32. return "${productName} Web Setup ${version}.${ext}";
  33. }
  34. generateGitHubInstallerName() {
  35. const appInfo = this.packager.appInfo;
  36. const classifier = appInfo.name.toLowerCase() === appInfo.name ? "web-setup" : "WebSetup";
  37. return `${appInfo.name}-${classifier}-${appInfo.version}.exe`;
  38. }
  39. }
  40. exports.WebInstallerTarget = WebInstallerTarget;
  41. //# sourceMappingURL=WebInstallerTarget.js.map