forked from electron-userland/electron-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: NSIS LZMA compression is slower and worse then external 7z compr…
…ession before: 36.3 after: 32.8 Compression speed is also reduced (25 sec vs 1+ minutes) because 7za is multi-threaded
- Loading branch information
Showing
35 changed files
with
600 additions
and
297 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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import { ElectronPackagerOptions } from "electron-packager-tf" | ||
import { DevMetadata, AppMetadata } from "./metadata" | ||
import { warn } from "./log" | ||
import { smarten } from "./platformPackager" | ||
import { isEmptyOrSpaces } from "./util" | ||
import { getRepositoryInfo } from "./repositoryInfo" | ||
|
||
//noinspection JSUnusedLocalSymbols | ||
const __awaiter = require("./awaiter") | ||
|
||
export class AppInfo { | ||
readonly description = smarten(this.metadata.description) | ||
|
||
// windows-only | ||
versionString = { | ||
CompanyName: this.companyName, | ||
FileDescription: this.description, | ||
ProductName: this.productName, | ||
InternalName: this.productName, | ||
LegalCopyright: this.copyright, | ||
} | ||
|
||
readonly version: string | ||
readonly buildVersion: string | ||
|
||
constructor(public metadata: AppMetadata, private devMetadata: DevMetadata) { | ||
let buildVersion = metadata.version | ||
this.version = buildVersion | ||
|
||
const buildNumber = this.buildNumber | ||
if (!isEmptyOrSpaces(buildNumber)) { | ||
buildVersion += `.${buildNumber}` | ||
} | ||
this.buildVersion = buildVersion | ||
} | ||
|
||
get companyName() { | ||
return this.metadata.author.name | ||
} | ||
|
||
get buildNumber(): string | null { | ||
return this.devMetadata.build["build-version"] || process.env.TRAVIS_BUILD_NUMBER || process.env.APPVEYOR_BUILD_NUMBER || process.env.CIRCLE_BUILD_NUM || process.env.BUILD_NUMBER | ||
} | ||
|
||
get id(): string { | ||
const appId = this.devMetadata.build["app-bundle-id"] | ||
if (appId != null) { | ||
warn("app-bundle-id is deprecated, please use appId") | ||
} | ||
|
||
if (this.devMetadata.build.appId != null) { | ||
return this.devMetadata.build.appId | ||
} | ||
|
||
if (appId == null) { | ||
return `com.electron.${this.metadata.name.toLowerCase()}` | ||
} | ||
return appId | ||
} | ||
|
||
get name(): string { | ||
return this.metadata.name | ||
} | ||
|
||
get productName(): string { | ||
return getProductName(this.metadata, this.devMetadata) | ||
} | ||
|
||
get copyright(): string { | ||
const copyright = (<ElectronPackagerOptions>this.devMetadata.build)["app-copyright"] | ||
if (copyright != null) { | ||
return copyright | ||
} | ||
return `Copyright © ${new Date().getFullYear()} ${this.metadata.author.name || this.productName}` | ||
} | ||
|
||
async computePackageUrl(): Promise<string | null> { | ||
const url = this.metadata.homepage || this.devMetadata.homepage | ||
if (url != null) { | ||
return url | ||
} | ||
|
||
const info = await getRepositoryInfo(this.metadata, this.devMetadata) | ||
if (info != null) { | ||
return `https://github.com/${info.user}/${info.project}` | ||
} | ||
return null | ||
} | ||
} | ||
|
||
function getProductName(metadata: AppMetadata, devMetadata: DevMetadata) { | ||
return devMetadata.build.productName || metadata.productName || metadata.name | ||
} |
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
Oops, something went wrong.