-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close #1157
- Loading branch information
Showing
23 changed files
with
303 additions
and
197 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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,49 @@ | ||
import { Platform } from "electron-builder-core" | ||
import { NsisWebOptions } from "../options/winOptions" | ||
import { computeDownloadUrl, getPublishConfigs, getPublishConfigsForUpdateInfo } from "../publish/PublishManager" | ||
import { WinPackager } from "../winPackager" | ||
import NsisTarget from "./nsis" | ||
|
||
export default class WebInstallerTarget extends NsisTarget { | ||
constructor(packager: WinPackager, outDir: string, targetName: string) { | ||
super(packager, outDir, targetName) | ||
} | ||
|
||
protected get isWebInstaller(): boolean { | ||
return true | ||
} | ||
|
||
protected async configureDefines(oneClick: boolean, defines: any) { | ||
//noinspection ES6MissingAwait | ||
const promise = (<any>NsisTarget.prototype).configureDefines.call(this, oneClick, defines) | ||
await promise | ||
|
||
const packager = this.packager | ||
const options = this.options | ||
|
||
let appPackageUrl = (<NsisWebOptions>options).appPackageUrl | ||
if (appPackageUrl == null) { | ||
const publishConfigs = await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, this.options, false)) | ||
if (publishConfigs == null || publishConfigs.length === 0) { | ||
throw new Error("Cannot compute app package download URL") | ||
} | ||
|
||
appPackageUrl = computeDownloadUrl(publishConfigs[0], null, packager.appInfo.version, { | ||
os: Platform.WINDOWS.buildConfigurationKey, | ||
arch: "" | ||
}) | ||
|
||
defines.APP_PACKAGE_URL_IS_INCOMLETE = null | ||
} | ||
|
||
defines.APP_PACKAGE_URL = appPackageUrl | ||
} | ||
|
||
protected get installerFilenamePattern(): string { | ||
return "${productName} Web Setup ${version}.${ext}" | ||
} | ||
|
||
protected generateGitHubInstallerName(): string { | ||
return `${this.packager.appInfo.name}-WebSetup-${this.packager.appInfo.version}.exe` | ||
} | ||
} |
Oops, something went wrong.