app-builder-lib 23.4.0 → 23.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/appInfo.js +7 -7
- package/out/appInfo.js.map +1 -1
- package/out/configuration.d.ts +6 -1
- package/out/configuration.js.map +1 -1
- package/out/macPackager.js +1 -1
- package/out/macPackager.js.map +1 -1
- package/out/options/macOptions.d.ts +8 -3
- package/out/options/macOptions.js.map +1 -1
- package/out/targets/fpm.js +4 -1
- package/out/targets/fpm.js.map +1 -1
- package/out/version.d.ts +1 -1
- package/out/version.js +1 -1
- package/out/version.js.map +1 -1
- package/out/winPackager.js.map +1 -1
- package/package.json +6 -6
- package/scheme.json +12 -5
package/out/appInfo.js
CHANGED
|
@@ -28,13 +28,13 @@ class AppInfo {
|
|
|
28
28
|
if (buildVersion == null) {
|
|
29
29
|
buildVersion = info.config.buildVersion;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
process.env.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
const buildNumberEnvs = process.env.BUILD_NUMBER ||
|
|
32
|
+
process.env.TRAVIS_BUILD_NUMBER ||
|
|
33
|
+
process.env.APPVEYOR_BUILD_NUMBER ||
|
|
34
|
+
process.env.CIRCLE_BUILD_NUM ||
|
|
35
|
+
process.env.BUILD_BUILDNUMBER ||
|
|
36
|
+
process.env.CI_PIPELINE_IID;
|
|
37
|
+
this.buildNumber = info.config.buildNumber || buildNumberEnvs;
|
|
38
38
|
if (buildVersion == null) {
|
|
39
39
|
buildVersion = this.version;
|
|
40
40
|
if (!builder_util_1.isEmptyOrSpaces(this.buildNumber)) {
|
package/out/appInfo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appInfo.js","sourceRoot":"","sources":["../src/appInfo.ts"],"names":[],"mappings":";;;AAAA,+CAAmD;AACnD,mCAA2C;AAG3C,wDAAkD;AAClD,8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GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAA;QAC3E,IAAI,GAAG,IAAI,IAAI,EAAE;YACf,OAAO,GAAG,CAAA;SACX;QAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAA;QAC3C,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,CAAA;IAC9G,CAAC;CACF;AAvID,0BAuIC;AAED,gBAAgB;AAChB,SAAgB,wBAAwB,CAAC,UAAkB;IACzD,kGAAkG;IAClG,0LAA0L;IAC1L,OAAO,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAA;AACrE,CAAC;AAJD,4DAIC","sourcesContent":["import { isEmptyOrSpaces, log } from \"builder-util\"\nimport { prerelease, SemVer } from \"semver\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions\"\nimport { Packager } from \"./packager\"\nimport { expandMacro } from \"./util/macroExpander\"\nimport { sanitizeFileName } from \"./util/filename\"\n\n// fpm bug - rpm build --description is not escaped, well... decided to replace quite to smart quote\n// http://leancrew.com/all-this/2010/11/smart-quotes-in-javascript/\nexport function smarten(s: string): string {\n // opening singles\n s = s.replace(/(^|[-\\u2014\\s([\"])'/g, \"$1\\u2018\")\n // closing singles & apostrophes\n s = s.replace(/'/g, \"\\u2019\")\n // opening doubles\n s = s.replace(/(^|[-\\u2014/[(\\u2018\\s])\"/g, \"$1\\u201c\")\n // closing doubles\n s = s.replace(/\"/g, \"\\u201d\")\n return s\n}\n\nexport class AppInfo {\n readonly description = smarten(this.info.metadata.description || \"\")\n readonly version: string\n readonly shortVersion: string | undefined\n readonly shortVersionWindows: string | undefined\n\n readonly buildNumber: string | undefined\n readonly buildVersion: string\n\n readonly productName: string\n readonly sanitizedProductName: string\n readonly productFilename: string\n\n constructor(private readonly info: Packager, buildVersion: string | null | undefined, private readonly platformSpecificOptions: PlatformSpecificBuildOptions | null = null) {\n this.version = info.metadata.version!\n\n if (buildVersion == null) {\n buildVersion = info.config.buildVersion\n }\n\n this.buildNumber =\n process.env.BUILD_NUMBER ||\n process.env.TRAVIS_BUILD_NUMBER ||\n process.env.APPVEYOR_BUILD_NUMBER ||\n process.env.CIRCLE_BUILD_NUM ||\n process.env.BUILD_BUILDNUMBER ||\n process.env.CI_PIPELINE_IID\n if (buildVersion == null) {\n buildVersion = this.version\n if (!isEmptyOrSpaces(this.buildNumber)) {\n buildVersion += `.${this.buildNumber}`\n }\n }\n this.buildVersion = buildVersion\n\n if (info.metadata.shortVersion) {\n this.shortVersion = info.metadata.shortVersion\n }\n if (info.metadata.shortVersionWindows) {\n this.shortVersionWindows = info.metadata.shortVersionWindows\n }\n\n this.productName = info.config.productName || info.metadata.productName || info.metadata.name!\n this.sanitizedProductName = sanitizeFileName(this.productName)\n this.productFilename = platformSpecificOptions?.executableName != null ? sanitizeFileName(platformSpecificOptions.executableName) : this.sanitizedProductName\n }\n\n get channel(): string | null {\n const prereleaseInfo = prerelease(this.version)\n if (prereleaseInfo != null && prereleaseInfo.length > 0) {\n return prereleaseInfo[0] as string | null\n }\n return null\n }\n\n getVersionInWeirdWindowsForm(isSetBuildNumber = true): string {\n const parsedVersion = new SemVer(this.version)\n // https://github.com/electron-userland/electron-builder/issues/2635#issuecomment-371792272\n let buildNumber = isSetBuildNumber ? this.buildNumber : null\n if (buildNumber == null || !/^\\d+$/.test(buildNumber)) {\n buildNumber = \"0\"\n }\n return `${parsedVersion.major}.${parsedVersion.minor}.${parsedVersion.patch}.${buildNumber}`\n }\n\n private get notNullDevMetadata() {\n return this.info.devMetadata || {}\n }\n\n get companyName(): string | null {\n const author = this.info.metadata.author || this.notNullDevMetadata.author\n return author == null ? null : author.name\n }\n\n get id(): string {\n let appId: string | null | undefined = null\n for (const options of [this.platformSpecificOptions, this.info.config]) {\n if (options != null && appId == null) {\n appId = options.appId\n }\n }\n\n const generateDefaultAppId = () => {\n const info = this.info\n return `${info.framework.defaultAppIdPrefix}${info.metadata.name!.toLowerCase()}`\n }\n\n if (appId != null && (appId === \"your.id\" || isEmptyOrSpaces(appId))) {\n const incorrectAppId = appId\n appId = generateDefaultAppId()\n log.warn(`do not use \"${incorrectAppId}\" as appId, \"${appId}\" will be used instead`)\n }\n\n return appId == null ? generateDefaultAppId() : appId\n }\n\n get macBundleIdentifier(): string {\n return filterCFBundleIdentifier(this.id)\n }\n\n get name(): string {\n return this.info.metadata.name!\n }\n\n get linuxPackageName(): string {\n const name = this.name\n // https://github.com/electron-userland/electron-builder/issues/2963\n return name.startsWith(\"@\") ? this.sanitizedProductName : name\n }\n\n get sanitizedName(): string {\n return sanitizeFileName(this.name)\n }\n\n get updaterCacheDirName(): string {\n return this.sanitizedName.toLowerCase() + \"-updater\"\n }\n\n get copyright(): string {\n const copyright = this.info.config.copyright\n if (copyright != null) {\n return expandMacro(copyright, null, this)\n }\n return `Copyright © ${new Date().getFullYear()} ${this.companyName || this.productName}`\n }\n\n async computePackageUrl(): Promise<string | null> {\n const url = this.info.metadata.homepage || this.notNullDevMetadata.homepage\n if (url != null) {\n return url\n }\n\n const info = await this.info.repositoryInfo\n return info == null || info.type !== \"github\" ? null : `https://${info.domain}/${info.user}/${info.project}`\n }\n}\n\n/** @internal */\nexport function filterCFBundleIdentifier(identifier: string) {\n // Remove special characters and allow only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.)\n // Apple documentation: https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070\n return identifier.replace(/ /g, \"-\").replace(/[^a-zA-Z0-9.-]/g, \"\")\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,IAAI,EAAE,IAAI,CAAC,CAAA;SAC1C;QACD,OAAO,eAAe,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,EAAE,CAAA;IAC1F,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAA;QAC3E,IAAI,GAAG,IAAI,IAAI,EAAE;YACf,OAAO,GAAG,CAAA;SACX;QAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAA;QAC3C,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,CAAA;IAC9G,CAAC;CACF;AAxID,0BAwIC;AAED,gBAAgB;AAChB,SAAgB,wBAAwB,CAAC,UAAkB;IACzD,kGAAkG;IAClG,0LAA0L;IAC1L,OAAO,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAA;AACrE,CAAC;AAJD,4DAIC","sourcesContent":["import { isEmptyOrSpaces, log } from \"builder-util\"\nimport { prerelease, SemVer } from \"semver\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions\"\nimport { Packager } from \"./packager\"\nimport { expandMacro } from \"./util/macroExpander\"\nimport { sanitizeFileName } from \"./util/filename\"\n\n// fpm bug - rpm build --description is not escaped, well... decided to replace quite to smart quote\n// http://leancrew.com/all-this/2010/11/smart-quotes-in-javascript/\nexport function smarten(s: string): string {\n // opening singles\n s = s.replace(/(^|[-\\u2014\\s([\"])'/g, \"$1\\u2018\")\n // closing singles & apostrophes\n s = s.replace(/'/g, \"\\u2019\")\n // opening doubles\n s = s.replace(/(^|[-\\u2014/[(\\u2018\\s])\"/g, \"$1\\u201c\")\n // closing doubles\n s = s.replace(/\"/g, \"\\u201d\")\n return s\n}\n\nexport class AppInfo {\n readonly description = smarten(this.info.metadata.description || \"\")\n readonly version: string\n readonly shortVersion: string | undefined\n readonly shortVersionWindows: string | undefined\n\n readonly buildNumber: string | undefined\n readonly buildVersion: string\n\n readonly productName: string\n readonly sanitizedProductName: string\n readonly productFilename: string\n\n constructor(private readonly info: Packager, buildVersion: string | null | undefined, private readonly platformSpecificOptions: PlatformSpecificBuildOptions | null = null) {\n this.version = info.metadata.version!\n\n if (buildVersion == null) {\n buildVersion = info.config.buildVersion\n }\n\n const buildNumberEnvs =\n process.env.BUILD_NUMBER ||\n process.env.TRAVIS_BUILD_NUMBER ||\n process.env.APPVEYOR_BUILD_NUMBER ||\n process.env.CIRCLE_BUILD_NUM ||\n process.env.BUILD_BUILDNUMBER ||\n process.env.CI_PIPELINE_IID\n this.buildNumber = info.config.buildNumber || buildNumberEnvs\n if (buildVersion == null) {\n buildVersion = this.version\n if (!isEmptyOrSpaces(this.buildNumber)) {\n buildVersion += `.${this.buildNumber}`\n }\n }\n this.buildVersion = buildVersion\n\n if (info.metadata.shortVersion) {\n this.shortVersion = info.metadata.shortVersion\n }\n if (info.metadata.shortVersionWindows) {\n this.shortVersionWindows = info.metadata.shortVersionWindows\n }\n\n this.productName = info.config.productName || info.metadata.productName || info.metadata.name!\n this.sanitizedProductName = sanitizeFileName(this.productName)\n this.productFilename = platformSpecificOptions?.executableName != null ? sanitizeFileName(platformSpecificOptions.executableName) : this.sanitizedProductName\n }\n\n get channel(): string | null {\n const prereleaseInfo = prerelease(this.version)\n if (prereleaseInfo != null && prereleaseInfo.length > 0) {\n return prereleaseInfo[0] as string | null\n }\n return null\n }\n\n getVersionInWeirdWindowsForm(isSetBuildNumber = true): string {\n const parsedVersion = new SemVer(this.version)\n // https://github.com/electron-userland/electron-builder/issues/2635#issuecomment-371792272\n let buildNumber = isSetBuildNumber ? this.buildNumber : null\n if (buildNumber == null || !/^\\d+$/.test(buildNumber)) {\n buildNumber = \"0\"\n }\n return `${parsedVersion.major}.${parsedVersion.minor}.${parsedVersion.patch}.${buildNumber}`\n }\n\n private get notNullDevMetadata() {\n return this.info.devMetadata || {}\n }\n\n get companyName(): string | null {\n const author = this.info.metadata.author || this.notNullDevMetadata.author\n return author == null ? null : author.name\n }\n\n get id(): string {\n let appId: string | null | undefined = null\n for (const options of [this.platformSpecificOptions, this.info.config]) {\n if (options != null && appId == null) {\n appId = options.appId\n }\n }\n\n const generateDefaultAppId = () => {\n const info = this.info\n return `${info.framework.defaultAppIdPrefix}${info.metadata.name!.toLowerCase()}`\n }\n\n if (appId != null && (appId === \"your.id\" || isEmptyOrSpaces(appId))) {\n const incorrectAppId = appId\n appId = generateDefaultAppId()\n log.warn(`do not use \"${incorrectAppId}\" as appId, \"${appId}\" will be used instead`)\n }\n\n return appId == null ? generateDefaultAppId() : appId\n }\n\n get macBundleIdentifier(): string {\n return filterCFBundleIdentifier(this.id)\n }\n\n get name(): string {\n return this.info.metadata.name!\n }\n\n get linuxPackageName(): string {\n const name = this.name\n // https://github.com/electron-userland/electron-builder/issues/2963\n return name.startsWith(\"@\") ? this.sanitizedProductName : name\n }\n\n get sanitizedName(): string {\n return sanitizeFileName(this.name)\n }\n\n get updaterCacheDirName(): string {\n return this.sanitizedName.toLowerCase() + \"-updater\"\n }\n\n get copyright(): string {\n const copyright = this.info.config.copyright\n if (copyright != null) {\n return expandMacro(copyright, null, this)\n }\n return `Copyright © ${new Date().getFullYear()} ${this.companyName || this.productName}`\n }\n\n async computePackageUrl(): Promise<string | null> {\n const url = this.info.metadata.homepage || this.notNullDevMetadata.homepage\n if (url != null) {\n return url\n }\n\n const info = await this.info.repositoryInfo\n return info == null || info.type !== \"github\" ? null : `https://${info.domain}/${info.user}/${info.project}`\n }\n}\n\n/** @internal */\nexport function filterCFBundleIdentifier(identifier: string) {\n // Remove special characters and allow only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.)\n // Apple documentation: https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070\n return identifier.replace(/ /g, \"-\").replace(/[^a-zA-Z0-9.-]/g, \"\")\n}\n"]}
|
package/out/configuration.d.ts
CHANGED
|
@@ -118,9 +118,14 @@ export interface Configuration extends PlatformSpecificBuildOptions {
|
|
|
118
118
|
* @default true
|
|
119
119
|
*/
|
|
120
120
|
readonly npmRebuild?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* The build number. Maps to the `--iteration` flag for builds using FPM on Linux.
|
|
123
|
+
* If not defined, then it will fallback to `BUILD_NUMBER` or `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_BUILDNUMBER` or `CI_PIPELINE_IID` env.
|
|
124
|
+
*/
|
|
125
|
+
readonly buildNumber?: string | null;
|
|
121
126
|
/**
|
|
122
127
|
* The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`.
|
|
123
|
-
* If `
|
|
128
|
+
* If `buildVersion` is not defined and `buildNumber` (or one of the `buildNumber` envs) is defined, it will be used as a build version (`version.buildNumber`).
|
|
124
129
|
*/
|
|
125
130
|
readonly buildVersion?: string | null;
|
|
126
131
|
/**
|
package/out/configuration.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"","sourcesContent":["import { Arch } from \"builder-util\"\nimport { BeforeBuildContext, Target } from \"./core\"\nimport { ElectronBrandingOptions, ElectronDownloadOptions } from \"./electron/ElectronFramework\"\nimport { PrepareApplicationStageDirectoryOptions } from \"./Framework\"\nimport { AppXOptions } from \"./options/AppXOptions\"\nimport { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions } from \"./options/linuxOptions\"\nimport { DmgOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { MsiOptions } from \"./options/MsiOptions\"\nimport { PkgOptions } from \"./options/pkgOptions\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions\"\nimport { SnapOptions } from \"./options/SnapOptions\"\nimport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions\"\nimport { WindowsConfiguration } from \"./options/winOptions\"\nimport { BuildResult } from \"./packager\"\nimport { ArtifactBuildStarted, ArtifactCreated } from \"./packagerApi\"\nimport { PlatformPackager } from \"./platformPackager\"\nimport { NsisOptions, NsisWebOptions, PortableOptions } from \"./targets/nsis/nsisOptions\"\n\n// duplicate appId here because it is important\n/**\n * Configuration Options\n */\nexport interface Configuration extends PlatformSpecificBuildOptions {\n /**\n * The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n * [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.\n * @default com.electron.${name}\n */\n readonly appId?: string | null\n\n /**\n * As [name](#Metadata-name), but allows you to specify a product name for your executable which contains spaces and other special characters not allowed in the [name property](https://docs.npmjs.com/files/package.json#name).\n * If not specified inside of the `build` configuration, `productName` property defined at the top level of `package.json` is used. If not specified at the top level of `package.json`, [name property](https://docs.npmjs.com/files/package.json#name) is used.\n */\n readonly productName?: string | null\n\n /**\n * The human-readable copyright line for the app.\n * @default Copyright © year ${author}\n */\n readonly copyright?: string | null\n\n readonly directories?: MetadataDirectories | null\n\n /**\n * Options related to how build macOS targets.\n */\n readonly mac?: MacConfiguration | null\n /**\n * MAS (Mac Application Store) options.\n */\n readonly mas?: MasConfiguration | null\n /**\n * MAS (Mac Application Store) development options (`mas-dev` target).\n */\n readonly masDev?: MasConfiguration | null\n /**\n * macOS DMG options.\n */\n readonly dmg?: DmgOptions | null\n /**\n * macOS PKG options.\n */\n readonly pkg?: PkgOptions | null\n\n /**\n * Options related to how build Windows targets.\n */\n readonly win?: WindowsConfiguration | null\n readonly nsis?: NsisOptions | null\n readonly nsisWeb?: NsisWebOptions | null\n readonly portable?: PortableOptions | null\n readonly appx?: AppXOptions | null\n /** @private */\n readonly msi?: MsiOptions | null\n readonly squirrelWindows?: SquirrelWindowsOptions | null\n\n /**\n * Options related to how build Linux targets.\n */\n readonly linux?: LinuxConfiguration | null\n /**\n * Debian package options.\n */\n readonly deb?: DebOptions | null\n /**\n * Snap options.\n */\n readonly snap?: SnapOptions | null\n /**\n * AppImage options.\n */\n readonly appImage?: AppImageOptions | null\n /**\n * Flatpak options.\n */\n readonly flatpak?: FlatpakOptions | null\n readonly pacman?: LinuxTargetSpecificOptions | null\n readonly rpm?: LinuxTargetSpecificOptions | null\n readonly freebsd?: LinuxTargetSpecificOptions | null\n readonly p5p?: LinuxTargetSpecificOptions | null\n readonly apk?: LinuxTargetSpecificOptions | null\n\n /**\n * Whether to include *all* of the submodules node_modules directories\n * @default false\n */\n includeSubNodeModules?: boolean\n\n /**\n * Whether to build the application native dependencies from source.\n * @default false\n */\n buildDependenciesFromSource?: boolean\n /**\n * Whether to execute `node-gyp rebuild` before starting to package the app.\n *\n * Don't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use `electron-builder node-gyp-rebuild` instead.\n * @default false\n */\n readonly nodeGypRebuild?: boolean\n /**\n * Additional command line arguments to use when installing app native deps.\n */\n readonly npmArgs?: Array<string> | string | null\n /**\n * Whether to [rebuild](https://docs.npmjs.com/cli/rebuild) native dependencies before starting to package the app.\n * @default true\n */\n readonly npmRebuild?: boolean\n\n /**\n * The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`.\n * If `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_NUMBER` or `bamboo.buildNumber` or `CI_PIPELINE_IID` env defined, it will be used as a build version (`version.build_number`).\n */\n readonly buildVersion?: string | null\n\n /**\n * Whether to use [electron-compile](http://github.com/electron/electron-compile) to compile app. Defaults to `true` if `electron-compile` in the dependencies. And `false` if in the `devDependencies` or doesn't specified.\n */\n readonly electronCompile?: boolean\n\n /**\n * Returns the path to custom Electron build (e.g. `~/electron/out/R`). Zip files must follow the pattern `electron-v${version}-${platformName}-${arch}.zip`, otherwise it will be assumed to be an unpacked Electron app directory\n */\n readonly electronDist?: string | ((options: PrepareApplicationStageDirectoryOptions) => string)\n\n /**\n * The [electron-download](https://github.com/electron-userland/electron-download#usage) options.\n */\n readonly electronDownload?: ElectronDownloadOptions\n\n /**\n * The branding used by Electron's distributables. This is needed if a fork has modified Electron's BRANDING.json file.\n */\n readonly electronBranding?: ElectronBrandingOptions\n\n /**\n * The version of electron you are packaging for. Defaults to version of `electron`, `electron-prebuilt` or `electron-prebuilt-compile` dependency.\n */\n electronVersion?: string | null\n\n /**\n * The name of a built-in configuration preset (currently, only `react-cra` is supported) or any number of paths to config files (relative to project dir).\n *\n * The latter allows to mixin a config from multiple other configs, as if you `Object.assign` them, but properly combine `files` glob patterns.\n *\n * If `react-scripts` in the app dependencies, `react-cra` will be set automatically. Set to `null` to disable automatic detection.\n */\n extends?: Array<string> | string | null\n\n /**\n * Inject properties to `package.json`.\n */\n readonly extraMetadata?: any\n\n /**\n * Whether to fail if the application is not signed (to prevent unsigned app if code signing configuration is not correct).\n * @default false\n */\n readonly forceCodeSigning?: boolean\n\n /**\n * *libui-based frameworks only* The version of NodeJS you are packaging for.\n * You can set it to `current` to set the Node.js version that you use to run.\n */\n readonly nodeVersion?: string | null\n\n /**\n * *libui-based frameworks only* The version of LaunchUI you are packaging for. Applicable for Windows only. Defaults to version suitable for used framework version.\n */\n readonly launchUiVersion?: boolean | string | null\n\n /**\n * The framework name. One of `electron`, `proton`, `libui`. Defaults to `electron`.\n */\n readonly framework?: string | null\n\n /**\n * The function (or path to file or module id) to be [run before pack](#beforepack)\n */\n readonly beforePack?: ((context: BeforePackContext) => Promise<any> | any) | string | null\n\n /**\n * The function (or path to file or module id) to be [run after pack](#afterpack) (but before pack into distributable format and sign).\n */\n readonly afterPack?: ((context: AfterPackContext) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be [run after pack and sign](#aftersign) (but before pack into distributable format).\n */\n readonly afterSign?: ((context: AfterPackContext) => Promise<any> | any) | string | null\n\n /**\n * The function (or path to file or module id) to be run on artifact build start.\n */\n readonly artifactBuildStarted?: ((context: ArtifactBuildStarted) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be run on artifact build completed.\n */\n readonly artifactBuildCompleted?: ((context: ArtifactCreated) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be [run after all artifacts are build](#afterAllArtifactBuild).\n */\n readonly afterAllArtifactBuild?: ((context: BuildResult) => Promise<Array<string>> | Array<string>) | string | null\n /**\n * MSI project created on disk - not packed into .msi package yet.\n */\n readonly msiProjectCreated?: ((path: string) => Promise<any> | any) | string | null\n /**\n * Appx manifest created on disk - not packed into .appx package yet.\n */\n readonly appxManifestCreated?: ((path: string) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be [run on each node module](#onnodemodulefile) file.\n */\n readonly onNodeModuleFile?: ((file: string) => void) | string | null\n /**\n * The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when `npmRebuild` is set to `true`. Resolving to `false` will skip dependencies install or rebuild.\n *\n * If provided and `node_modules` are missing, it will not invoke production dependencies check.\n */\n readonly beforeBuild?: ((context: BeforeBuildContext) => Promise<any>) | string | null\n\n /**\n * Whether to build using Electron Build Service if target not supported on current OS.\n * @default true\n */\n readonly remoteBuild?: boolean\n\n /**\n * Whether to include PDB files.\n * @default false\n */\n readonly includePdb?: boolean\n\n /**\n * Whether to remove `scripts` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageScripts?: boolean\n\n /**\n * Whether to remove `keywords` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageKeywords?: boolean\n}\n\ninterface PackContext {\n readonly outDir: string\n readonly appOutDir: string\n readonly packager: PlatformPackager<any>\n readonly electronPlatformName: string\n readonly arch: Arch\n readonly targets: Array<Target>\n}\nexport type AfterPackContext = PackContext\nexport type BeforePackContext = PackContext\n\nexport interface MetadataDirectories {\n /**\n * The path to build resources.\n *\n * Please note — build resources are not packed into the app. If you need to use some files, e.g. as tray icon, please include required files explicitly: `\"files\": [\"**\\/*\", \"build/icon.*\"]`\n * @default build\n */\n readonly buildResources?: string | null\n\n /**\n * The output directory. [File macros](/file-patterns#file-macros) are supported.\n * @default dist\n */\n readonly output?: string | null\n\n /**\n * The application directory (containing the application package.json), defaults to `app`, `www` or working directory.\n */\n readonly app?: string | null\n}\n"]}
|
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"","sourcesContent":["import { Arch } from \"builder-util\"\nimport { BeforeBuildContext, Target } from \"./core\"\nimport { ElectronBrandingOptions, ElectronDownloadOptions } from \"./electron/ElectronFramework\"\nimport { PrepareApplicationStageDirectoryOptions } from \"./Framework\"\nimport { AppXOptions } from \"./options/AppXOptions\"\nimport { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions } from \"./options/linuxOptions\"\nimport { DmgOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { MsiOptions } from \"./options/MsiOptions\"\nimport { PkgOptions } from \"./options/pkgOptions\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions\"\nimport { SnapOptions } from \"./options/SnapOptions\"\nimport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions\"\nimport { WindowsConfiguration } from \"./options/winOptions\"\nimport { BuildResult } from \"./packager\"\nimport { ArtifactBuildStarted, ArtifactCreated } from \"./packagerApi\"\nimport { PlatformPackager } from \"./platformPackager\"\nimport { NsisOptions, NsisWebOptions, PortableOptions } from \"./targets/nsis/nsisOptions\"\n\n// duplicate appId here because it is important\n/**\n * Configuration Options\n */\nexport interface Configuration extends PlatformSpecificBuildOptions {\n /**\n * The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n * [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.\n * @default com.electron.${name}\n */\n readonly appId?: string | null\n\n /**\n * As [name](#Metadata-name), but allows you to specify a product name for your executable which contains spaces and other special characters not allowed in the [name property](https://docs.npmjs.com/files/package.json#name).\n * If not specified inside of the `build` configuration, `productName` property defined at the top level of `package.json` is used. If not specified at the top level of `package.json`, [name property](https://docs.npmjs.com/files/package.json#name) is used.\n */\n readonly productName?: string | null\n\n /**\n * The human-readable copyright line for the app.\n * @default Copyright © year ${author}\n */\n readonly copyright?: string | null\n\n readonly directories?: MetadataDirectories | null\n\n /**\n * Options related to how build macOS targets.\n */\n readonly mac?: MacConfiguration | null\n /**\n * MAS (Mac Application Store) options.\n */\n readonly mas?: MasConfiguration | null\n /**\n * MAS (Mac Application Store) development options (`mas-dev` target).\n */\n readonly masDev?: MasConfiguration | null\n /**\n * macOS DMG options.\n */\n readonly dmg?: DmgOptions | null\n /**\n * macOS PKG options.\n */\n readonly pkg?: PkgOptions | null\n\n /**\n * Options related to how build Windows targets.\n */\n readonly win?: WindowsConfiguration | null\n readonly nsis?: NsisOptions | null\n readonly nsisWeb?: NsisWebOptions | null\n readonly portable?: PortableOptions | null\n readonly appx?: AppXOptions | null\n /** @private */\n readonly msi?: MsiOptions | null\n readonly squirrelWindows?: SquirrelWindowsOptions | null\n\n /**\n * Options related to how build Linux targets.\n */\n readonly linux?: LinuxConfiguration | null\n /**\n * Debian package options.\n */\n readonly deb?: DebOptions | null\n /**\n * Snap options.\n */\n readonly snap?: SnapOptions | null\n /**\n * AppImage options.\n */\n readonly appImage?: AppImageOptions | null\n /**\n * Flatpak options.\n */\n readonly flatpak?: FlatpakOptions | null\n readonly pacman?: LinuxTargetSpecificOptions | null\n readonly rpm?: LinuxTargetSpecificOptions | null\n readonly freebsd?: LinuxTargetSpecificOptions | null\n readonly p5p?: LinuxTargetSpecificOptions | null\n readonly apk?: LinuxTargetSpecificOptions | null\n\n /**\n * Whether to include *all* of the submodules node_modules directories\n * @default false\n */\n includeSubNodeModules?: boolean\n\n /**\n * Whether to build the application native dependencies from source.\n * @default false\n */\n buildDependenciesFromSource?: boolean\n /**\n * Whether to execute `node-gyp rebuild` before starting to package the app.\n *\n * Don't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use `electron-builder node-gyp-rebuild` instead.\n * @default false\n */\n readonly nodeGypRebuild?: boolean\n /**\n * Additional command line arguments to use when installing app native deps.\n */\n readonly npmArgs?: Array<string> | string | null\n /**\n * Whether to [rebuild](https://docs.npmjs.com/cli/rebuild) native dependencies before starting to package the app.\n * @default true\n */\n readonly npmRebuild?: boolean\n\n /**\n * The build number. Maps to the `--iteration` flag for builds using FPM on Linux.\n * If not defined, then it will fallback to `BUILD_NUMBER` or `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_BUILDNUMBER` or `CI_PIPELINE_IID` env.\n */\n readonly buildNumber?: string | null\n\n /**\n * The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`.\n * If `buildVersion` is not defined and `buildNumber` (or one of the `buildNumber` envs) is defined, it will be used as a build version (`version.buildNumber`).\n */\n readonly buildVersion?: string | null\n\n /**\n * Whether to use [electron-compile](http://github.com/electron/electron-compile) to compile app. Defaults to `true` if `electron-compile` in the dependencies. And `false` if in the `devDependencies` or doesn't specified.\n */\n readonly electronCompile?: boolean\n\n /**\n * Returns the path to custom Electron build (e.g. `~/electron/out/R`). Zip files must follow the pattern `electron-v${version}-${platformName}-${arch}.zip`, otherwise it will be assumed to be an unpacked Electron app directory\n */\n readonly electronDist?: string | ((options: PrepareApplicationStageDirectoryOptions) => string)\n\n /**\n * The [electron-download](https://github.com/electron-userland/electron-download#usage) options.\n */\n readonly electronDownload?: ElectronDownloadOptions\n\n /**\n * The branding used by Electron's distributables. This is needed if a fork has modified Electron's BRANDING.json file.\n */\n readonly electronBranding?: ElectronBrandingOptions\n\n /**\n * The version of electron you are packaging for. Defaults to version of `electron`, `electron-prebuilt` or `electron-prebuilt-compile` dependency.\n */\n electronVersion?: string | null\n\n /**\n * The name of a built-in configuration preset (currently, only `react-cra` is supported) or any number of paths to config files (relative to project dir).\n *\n * The latter allows to mixin a config from multiple other configs, as if you `Object.assign` them, but properly combine `files` glob patterns.\n *\n * If `react-scripts` in the app dependencies, `react-cra` will be set automatically. Set to `null` to disable automatic detection.\n */\n extends?: Array<string> | string | null\n\n /**\n * Inject properties to `package.json`.\n */\n readonly extraMetadata?: any\n\n /**\n * Whether to fail if the application is not signed (to prevent unsigned app if code signing configuration is not correct).\n * @default false\n */\n readonly forceCodeSigning?: boolean\n\n /**\n * *libui-based frameworks only* The version of NodeJS you are packaging for.\n * You can set it to `current` to set the Node.js version that you use to run.\n */\n readonly nodeVersion?: string | null\n\n /**\n * *libui-based frameworks only* The version of LaunchUI you are packaging for. Applicable for Windows only. Defaults to version suitable for used framework version.\n */\n readonly launchUiVersion?: boolean | string | null\n\n /**\n * The framework name. One of `electron`, `proton`, `libui`. Defaults to `electron`.\n */\n readonly framework?: string | null\n\n /**\n * The function (or path to file or module id) to be [run before pack](#beforepack)\n */\n readonly beforePack?: ((context: BeforePackContext) => Promise<any> | any) | string | null\n\n /**\n * The function (or path to file or module id) to be [run after pack](#afterpack) (but before pack into distributable format and sign).\n */\n readonly afterPack?: ((context: AfterPackContext) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be [run after pack and sign](#aftersign) (but before pack into distributable format).\n */\n readonly afterSign?: ((context: AfterPackContext) => Promise<any> | any) | string | null\n\n /**\n * The function (or path to file or module id) to be run on artifact build start.\n */\n readonly artifactBuildStarted?: ((context: ArtifactBuildStarted) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be run on artifact build completed.\n */\n readonly artifactBuildCompleted?: ((context: ArtifactCreated) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be [run after all artifacts are build](#afterAllArtifactBuild).\n */\n readonly afterAllArtifactBuild?: ((context: BuildResult) => Promise<Array<string>> | Array<string>) | string | null\n /**\n * MSI project created on disk - not packed into .msi package yet.\n */\n readonly msiProjectCreated?: ((path: string) => Promise<any> | any) | string | null\n /**\n * Appx manifest created on disk - not packed into .appx package yet.\n */\n readonly appxManifestCreated?: ((path: string) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be [run on each node module](#onnodemodulefile) file.\n */\n readonly onNodeModuleFile?: ((file: string) => void) | string | null\n /**\n * The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when `npmRebuild` is set to `true`. Resolving to `false` will skip dependencies install or rebuild.\n *\n * If provided and `node_modules` are missing, it will not invoke production dependencies check.\n */\n readonly beforeBuild?: ((context: BeforeBuildContext) => Promise<any>) | string | null\n\n /**\n * Whether to build using Electron Build Service if target not supported on current OS.\n * @default true\n */\n readonly remoteBuild?: boolean\n\n /**\n * Whether to include PDB files.\n * @default false\n */\n readonly includePdb?: boolean\n\n /**\n * Whether to remove `scripts` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageScripts?: boolean\n\n /**\n * Whether to remove `keywords` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageKeywords?: boolean\n}\n\ninterface PackContext {\n readonly outDir: string\n readonly appOutDir: string\n readonly packager: PlatformPackager<any>\n readonly electronPlatformName: string\n readonly arch: Arch\n readonly targets: Array<Target>\n}\nexport type AfterPackContext = PackContext\nexport type BeforePackContext = PackContext\n\nexport interface MetadataDirectories {\n /**\n * The path to build resources.\n *\n * Please note — build resources are not packed into the app. If you need to use some files, e.g. as tray icon, please include required files explicitly: `\"files\": [\"**\\/*\", \"build/icon.*\"]`\n * @default build\n */\n readonly buildResources?: string | null\n\n /**\n * The output directory. [File macros](/file-patterns#file-macros) are supported.\n * @default dist\n */\n readonly output?: string | null\n\n /**\n * The application directory (containing the application package.json), defaults to `app`, `www` or working directory.\n */\n readonly app?: string | null\n}\n"]}
|
package/out/macPackager.js
CHANGED
|
@@ -394,6 +394,6 @@ function getCertificateTypes(isMas, isDevelopment) {
|
|
|
394
394
|
if (isDevelopment) {
|
|
395
395
|
return isMas ? ["Mac Developer", "Apple Development"] : ["Mac Developer", "Developer ID Application"];
|
|
396
396
|
}
|
|
397
|
-
return isMas ? ["3rd Party Mac Developer Application"
|
|
397
|
+
return isMas ? ["Apple Distribution", "3rd Party Mac Developer Application"] : ["Developer ID Application"];
|
|
398
398
|
}
|
|
399
399
|
//# sourceMappingURL=macPackager.js.map
|
package/out/macPackager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"macPackager.js","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":";;AAAA,+CAA0C;AAC1C,+CAA2H;AAC3H,yDAA0D;AAC1D,0CAA4C;AAC5C,uCAA+B;AAC/B,6BAA4B;AAC5B,4CAA0E;AAC1E,sDAA2D;AAC3D,uCAAmC;AACnC,wDAAsJ;AACtJ,iCAAqD;AAIrD,yDAAoE;AACpE,2DAAuD;AACvD,uCAAkE;AAClE,2DAAwE;AACxE,sDAAuD;AACvD,oDAAoD;AACpD,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EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAA;QAC1F,MAAM,sBAAe,CAAC,GAAG,CAAC,0BAAgB,CAAC,kBAAO,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,IAAY,EAAO,EAAE;YAC9F,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBACzB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;aACrE;iBAAM;gBACL,OAAO,IAAI,CAAA;aACZ;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AA1bD,8BA0bC;AAED,SAAS,mBAAmB,CAAC,KAAc,EAAE,aAAsB;IACjE,IAAI,aAAa,EAAE;QACjB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,0BAA0B,CAAC,CAAA;KACtG;IACD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,qCAAqC,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAA;AAC7G,CAAC","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { deepAssign, Arch, AsyncTaskManager, exec, InvalidConfigurationError, log, use, getArchSuffix } from \"builder-util\"\nimport { signAsync, SignOptions } from \"electron-osx-sign\"\nimport { mkdir, readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { copyFile, statOrNull, unlinkIfExists } from \"builder-util/out/fs\"\nimport { orIfFileNotExist } from \"builder-util/out/promise\"\nimport { AppInfo } from \"./appInfo\"\nimport { CertType, CodeSigningInfo, createKeychain, findIdentity, Identity, isSignAllowed, removeKeychain, reportError } from \"./codeSign/macCodeSign\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { AfterPackContext, ElectronPlatformName } from \"./index\"\nimport { MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { Packager } from \"./packager\"\nimport { chooseNotNull, PlatformPackager } from \"./platformPackager\"\nimport { ArchiveTarget } from \"./targets/ArchiveTarget\"\nimport { PkgTarget, prepareProductBuildArgs } from \"./targets/pkg\"\nimport { createCommonTarget, NoOpTarget } from \"./targets/targetFactory\"\nimport { isMacOsHighSierra } from \"./util/macosVersion\"\nimport { getTemplatePath } from \"./util/pathManager\"\nimport * as fs from \"fs/promises\"\n\nexport default class MacPackager extends PlatformPackager<MacConfiguration> {\n readonly codeSigningInfo = new Lazy<CodeSigningInfo>(() => {\n const cscLink = this.getCscLink()\n if (cscLink == null || process.platform !== \"darwin\") {\n return Promise.resolve({ keychainFile: process.env.CSC_KEYCHAIN || null })\n }\n\n return createKeychain({\n tmpDir: this.info.tempDirManager,\n cscLink,\n cscKeyPassword: this.getCscPassword(),\n cscILink: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerLink, process.env.CSC_INSTALLER_LINK),\n cscIKeyPassword: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerKeyPassword, process.env.CSC_INSTALLER_KEY_PASSWORD),\n currentDir: this.projectDir,\n }).then(result => {\n const keychainFile = result.keychainFile\n if (keychainFile != null) {\n this.info.disposeOnBuildFinish(() => removeKeychain(keychainFile))\n }\n return result\n })\n })\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"icns\"))\n\n constructor(info: Packager) {\n super(info, Platform.MAC)\n }\n\n get defaultTarget(): Array<string> {\n return this.info.framework.macOsDefaultTargets\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n return new AppInfo(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions)\n }\n\n async getIconPath(): Promise<string | null> {\n return this._iconPath.value\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n for (const name of targets) {\n switch (name) {\n case DIR_TARGET:\n break\n\n case \"dmg\": {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { DmgTarget } = require(\"dmg-builder\")\n mapper(name, outDir => new DmgTarget(this, outDir))\n break\n }\n\n case \"zip\":\n // https://github.com/electron-userland/electron-builder/issues/2313\n mapper(name, outDir => new ArchiveTarget(name, outDir, this, true))\n break\n\n case \"pkg\":\n mapper(name, outDir => new PkgTarget(this, outDir))\n break\n\n default:\n mapper(name, outDir => (name === \"mas\" || name === \"mas-dev\" ? new NoOpTarget(name) : createCommonTarget(name, outDir, this)))\n break\n }\n }\n }\n\n protected async doPack(\n outDir: string,\n appOutDir: string,\n platformName: ElectronPlatformName,\n arch: Arch,\n platformSpecificBuildOptions: MacConfiguration,\n targets: Array<Target>\n ): Promise<any> {\n switch (arch) {\n default: {\n return super.doPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)\n }\n case Arch.universal: {\n const x64Arch = Arch.x64\n const x64AppOutDir = appOutDir + \"--\" + Arch[x64Arch]\n await super.doPack(outDir, x64AppOutDir, platformName, x64Arch, platformSpecificBuildOptions, targets, false, true)\n const arm64Arch = Arch.arm64\n const arm64AppOutPath = appOutDir + \"--\" + Arch[arm64Arch]\n await super.doPack(outDir, arm64AppOutPath, platformName, arm64Arch, platformSpecificBuildOptions, targets, false, true)\n const framework = this.info.framework\n log.info(\n {\n platform: platformName,\n arch: Arch[arch],\n [`${framework.name}`]: framework.version,\n appOutDir: log.filePath(appOutDir),\n },\n `packaging`\n )\n const appFile = `${this.appInfo.productFilename}.app`\n const { makeUniversalApp } = require(\"@electron/universal\")\n await makeUniversalApp({\n x64AppPath: path.join(x64AppOutDir, appFile),\n arm64AppPath: path.join(arm64AppOutPath, appFile),\n outAppPath: path.join(appOutDir, appFile),\n force: true,\n mergeASARs: platformSpecificBuildOptions.mergeASARs ?? true,\n singleArchFiles: platformSpecificBuildOptions.singleArchFiles,\n x64ArchFiles: platformSpecificBuildOptions.x64ArchFiles,\n })\n await fs.rm(x64AppOutDir, { recursive: true, force: true })\n await fs.rm(arm64AppOutPath, { recursive: true, force: true })\n\n // Give users a final opportunity to perform things on the combined universal package before signing\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n await this.info.afterPack(packContext)\n\n await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)\n break\n }\n }\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<any> {\n let nonMasPromise: Promise<any> | null = null\n\n const hasMas = targets.length !== 0 && targets.some(it => it.name === \"mas\" || it.name === \"mas-dev\")\n const prepackaged = this.packagerOptions.prepackaged\n\n if (!hasMas || targets.length > 1) {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${this.appInfo.productFilename}.app`) : prepackaged\n nonMasPromise = (\n prepackaged\n ? Promise.resolve()\n : this.doPack(outDir, path.dirname(appPath), this.platform.nodeName as ElectronPlatformName, arch, this.platformSpecificBuildOptions, targets)\n ).then(() => this.packageInDistributableFormat(appPath, arch, targets, taskManager))\n }\n\n for (const target of targets) {\n const targetName = target.name\n if (!(targetName === \"mas\" || targetName === \"mas-dev\")) {\n continue\n }\n\n const masBuildOptions = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas)\n if (targetName === \"mas-dev\") {\n deepAssign(masBuildOptions, this.config.masDev, {\n type: \"development\",\n })\n }\n\n const targetOutDir = path.join(outDir, `${targetName}${getArchSuffix(arch)}`)\n if (prepackaged == null) {\n await this.doPack(outDir, targetOutDir, \"mas\", arch, masBuildOptions, [target])\n await this.sign(path.join(targetOutDir, `${this.appInfo.productFilename}.app`), targetOutDir, masBuildOptions, arch)\n } else {\n await this.sign(prepackaged, targetOutDir, masBuildOptions, arch)\n }\n }\n\n if (nonMasPromise != null) {\n await nonMasPromise\n }\n }\n\n private async sign(appPath: string, outDir: string | null, masOptions: MasConfiguration | null, arch: Arch | null): Promise<void> {\n if (!isSignAllowed()) {\n return\n }\n\n const isMas = masOptions != null\n const options = masOptions == null ? this.platformSpecificBuildOptions : masOptions\n const qualifier = options.identity\n\n if (!isMas && qualifier === null) {\n if (this.forceCodeSigning) {\n throw new InvalidConfigurationError(\"identity explicitly is set to null, but forceCodeSigning is set to true\")\n }\n log.info({ reason: \"identity explicitly is set to null\" }, \"skipped macOS code signing\")\n return\n }\n\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n const explicitType = options.type\n const type = explicitType || \"distribution\"\n const isDevelopment = type === \"development\"\n const certificateTypes = getCertificateTypes(isMas, isDevelopment)\n\n let identity = null\n for (const certificateType of certificateTypes) {\n identity = await findIdentity(certificateType, qualifier, keychainFile)\n if (identity != null) {\n break\n }\n }\n\n if (identity == null) {\n if (!isMas && !isDevelopment && explicitType !== \"distribution\") {\n identity = await findIdentity(\"Mac Developer\", qualifier, keychainFile)\n if (identity != null) {\n log.warn(\"Mac Developer is used to sign app — it is only for development and testing, not for production\")\n }\n }\n\n if (identity == null) {\n await reportError(isMas, certificateTypes, qualifier, keychainFile, this.forceCodeSigning)\n return\n }\n }\n\n if (!isMacOsHighSierra()) {\n throw new InvalidConfigurationError(\"macOS High Sierra 10.13.6 is required to sign\")\n }\n\n let filter = options.signIgnore\n if (Array.isArray(filter)) {\n if (filter.length == 0) {\n filter = null\n }\n } else if (filter != null) {\n filter = filter.length === 0 ? null : [filter]\n }\n\n const filterRe = filter == null ? null : filter.map(it => new RegExp(it))\n\n let binaries = options.binaries || undefined\n if (binaries) {\n // Accept absolute paths for external binaries, else resolve relative paths from the artifact's app Contents path.\n binaries = await Promise.all(\n binaries.map(async destination => {\n if (await statOrNull(destination)) {\n return destination\n }\n return path.resolve(appPath, destination)\n })\n )\n log.info(\"Signing addtional user-defined binaries: \" + JSON.stringify(binaries, null, 1))\n }\n\n const signOptions: any = {\n \"identity-validation\": false,\n // https://github.com/electron-userland/electron-builder/issues/1699\n // kext are signed by the chipset manufacturers. You need a special certificate (only available on request) from Apple to be able to sign kext.\n ignore: (file: string) => {\n if (filterRe != null) {\n for (const regExp of filterRe) {\n if (regExp.test(file)) {\n return true\n }\n }\n }\n return (\n file.endsWith(\".kext\") ||\n file.startsWith(\"/Contents/PlugIns\", appPath.length) ||\n file.includes(\"/node_modules/puppeteer/.local-chromium\") ||\n file.includes(\"/node_modules/playwright-firefox/.local-browsers\") ||\n file.includes(\"/node_modules/playwright/.local-browsers\")\n )\n\n /* Those are browser automating modules, browser (chromium, nightly) cannot be signed\n https://github.com/electron-userland/electron-builder/issues/2010\n https://github.com/electron-userland/electron-builder/issues/5383\n */\n },\n identity: identity,\n type,\n platform: isMas ? \"mas\" : \"darwin\",\n version: this.config.electronVersion,\n app: appPath,\n keychain: keychainFile || undefined,\n binaries,\n timestamp: isMas ? masOptions?.timestamp : options.timestamp,\n requirements: isMas || this.platformSpecificBuildOptions.requirements == null ? undefined : await this.getResource(this.platformSpecificBuildOptions.requirements),\n // https://github.com/electron-userland/electron-osx-sign/issues/196\n // will fail on 10.14.5+ because a signed but unnotarized app is also rejected.\n \"gatekeeper-assess\": options.gatekeeperAssess === true,\n // https://github.com/electron-userland/electron-builder/issues/1480\n \"strict-verify\": options.strictVerify,\n hardenedRuntime: isMas ? masOptions && masOptions.hardenedRuntime === true : options.hardenedRuntime !== false,\n }\n\n await this.adjustSignOptions(signOptions, masOptions)\n log.info(\n {\n file: log.filePath(appPath),\n identityName: identity.name,\n identityHash: identity.hash,\n provisioningProfile: signOptions[\"provisioning-profile\"] || \"none\",\n },\n \"signing\"\n )\n await this.doSign(signOptions)\n\n // https://github.com/electron-userland/electron-builder/issues/1196#issuecomment-312310209\n if (masOptions != null && !isDevelopment) {\n const certType = isDevelopment ? \"Mac Developer\" : \"3rd Party Mac Developer Installer\"\n const masInstallerIdentity = await findIdentity(certType, masOptions.identity, keychainFile)\n if (masInstallerIdentity == null) {\n throw new InvalidConfigurationError(`Cannot find valid \"${certType}\" identity to sign MAS installer, please see https://electron.build/code-signing`)\n }\n\n // mas uploaded to AppStore, so, use \"-\" instead of space for name\n const artifactName = this.expandArtifactNamePattern(masOptions, \"pkg\", arch)\n const artifactPath = path.join(outDir!, artifactName)\n await this.doFlat(appPath, artifactPath, masInstallerIdentity, keychainFile)\n await this.dispatchArtifactCreated(artifactPath, null, Arch.x64, this.computeSafeArtifactName(artifactName, \"pkg\", arch, true, this.platformSpecificBuildOptions.defaultArch))\n }\n }\n\n private async adjustSignOptions(signOptions: any, masOptions: MasConfiguration | null) {\n const resourceList = await this.resourceList\n const customSignOptions = masOptions || this.platformSpecificBuildOptions\n const entitlementsSuffix = masOptions == null ? \"mac\" : \"mas\"\n\n let entitlements = customSignOptions.entitlements\n if (entitlements == null) {\n const p = `entitlements.${entitlementsSuffix}.plist`\n if (resourceList.includes(p)) {\n entitlements = path.join(this.info.buildResourcesDir, p)\n } else {\n entitlements = getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n signOptions.entitlements = entitlements\n\n let entitlementsInherit = customSignOptions.entitlementsInherit\n if (entitlementsInherit == null) {\n const p = `entitlements.${entitlementsSuffix}.inherit.plist`\n if (resourceList.includes(p)) {\n entitlementsInherit = path.join(this.info.buildResourcesDir, p)\n } else {\n entitlementsInherit = getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n signOptions[\"entitlements-inherit\"] = entitlementsInherit\n\n if (customSignOptions.provisioningProfile != null) {\n signOptions[\"provisioning-profile\"] = customSignOptions.provisioningProfile\n }\n signOptions[\"entitlements-loginhelper\"] = customSignOptions.entitlementsLoginHelper\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doSign(opts: SignOptions): Promise<any> {\n return signAsync(opts)\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | null | undefined): Promise<any> {\n // productbuild doesn't created directory for out file\n await mkdir(path.dirname(outFile), { recursive: true })\n\n const args = prepareProductBuildArgs(identity, keychain)\n args.push(\"--component\", appPath, \"/Applications\")\n args.push(outFile)\n return await exec(\"productbuild\", args)\n }\n\n public getElectronSrcDir(dist: string) {\n return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName)\n }\n\n public getElectronDestinationDir(appOutDir: string) {\n return path.join(appOutDir, this.info.framework.distMacOsAppName)\n }\n\n // todo fileAssociations\n async applyCommonInfo(appPlist: any, contentsPath: string) {\n const appInfo = this.appInfo\n const appFilename = appInfo.productFilename\n\n // https://github.com/electron-userland/electron-builder/issues/1278\n appPlist.CFBundleExecutable = appFilename.endsWith(\" Helper\") ? appFilename.substring(0, appFilename.length - \" Helper\".length) : appFilename\n\n const icon = await this.getIconPath()\n if (icon != null) {\n const oldIcon = appPlist.CFBundleIconFile\n const resourcesPath = path.join(contentsPath, \"Resources\")\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = \"icon.icns\"\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(icon, path.join(resourcesPath, iconFileName))\n }\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n appPlist.CFBundleIdentifier = appInfo.macBundleIdentifier\n\n appPlist.CFBundleShortVersionString = this.platformSpecificBuildOptions.bundleShortVersion || appInfo.version\n appPlist.CFBundleVersion = appInfo.buildVersion\n\n use(this.platformSpecificBuildOptions.category || (this.config as any).category, it => (appPlist.LSApplicationCategoryType = it))\n appPlist.NSHumanReadableCopyright = appInfo.copyright\n\n if (this.platformSpecificBuildOptions.darkModeSupport) {\n appPlist.NSRequiresAquaSystemAppearance = false\n }\n\n const extendInfo = this.platformSpecificBuildOptions.extendInfo\n if (extendInfo != null) {\n Object.assign(appPlist, extendInfo)\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise<any> {\n const appFileName = `${this.appInfo.productFilename}.app`\n\n await BluebirdPromise.map(readdir(packContext.appOutDir), (file: string): any => {\n if (file === appFileName) {\n return this.sign(path.join(packContext.appOutDir, file), null, null, null)\n }\n return null\n })\n\n if (!isAsar) {\n return\n }\n\n const outResourcesDir = path.join(packContext.appOutDir, \"resources\", \"app.asar.unpacked\")\n await BluebirdPromise.map(orIfFileNotExist(readdir(outResourcesDir), []), (file: string): any => {\n if (file.endsWith(\".app\")) {\n return this.sign(path.join(outResourcesDir, file), null, null, null)\n } else {\n return null\n }\n })\n }\n}\n\nfunction getCertificateTypes(isMas: boolean, isDevelopment: boolean): CertType[] {\n if (isDevelopment) {\n return isMas ? [\"Mac Developer\", \"Apple Development\"] : [\"Mac Developer\", \"Developer ID Application\"]\n }\n return isMas ? [\"3rd Party Mac Developer Application\", \"Apple Distribution\"] : [\"Developer ID Application\"]\n}\n"]}
|
|
1
|
+
{"version":3,"file":"macPackager.js","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":";;AAAA,+CAA0C;AAC1C,+CAA2H;AAC3H,yDAA0D;AAC1D,0CAA4C;AAC5C,uCAA+B;AAC/B,6BAA4B;AAC5B,4CAA0E;AAC1E,sDAA2D;AAC3D,uCAAmC;AACnC,wDAAsJ;AACtJ,iCAAqD;AAIrD,yDAAoE;AACpE,2DAAuD;AACvD,uCAAkE;AAClE,2DAAwE;AACxE,sDAAuD;AACvD,oDAAoD;AACpD,kCAAiC;AAEjC,MAAqB,WAAY,SAAQ,mCAAkC;IAyBzE,YAAY,IAAc;QACxB,KAAK,CAAC,IAAI,EAAE,eAAQ,CAAC,GAAG,CAAC,CAAA;QAzBlB,oBAAe,GAAG,IAAI,eAAI,CAAkB,GAAG,EAAE;YACxD,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAA;YACjC,IAAI,OAAO,IAAI,IAAI,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE;gBACpD,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,YAA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aACrE;iBAAM;gBACL,OAAO,IAAI,CAAA;aACZ;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AA1bD,8BA0bC;AAED,SAAS,mBAAmB,CAAC,KAAc,EAAE,aAAsB;IACjE,IAAI,aAAa,EAAE;QACjB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,0BAA0B,CAAC,CAAA;KACtG;IACD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,oBAAoB,EAAE,qCAAqC,CAAC,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAA;AAC7G,CAAC","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { deepAssign, Arch, AsyncTaskManager, exec, InvalidConfigurationError, log, use, getArchSuffix } from \"builder-util\"\nimport { signAsync, SignOptions } from \"electron-osx-sign\"\nimport { mkdir, readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { copyFile, statOrNull, unlinkIfExists } from \"builder-util/out/fs\"\nimport { orIfFileNotExist } from \"builder-util/out/promise\"\nimport { AppInfo } from \"./appInfo\"\nimport { CertType, CodeSigningInfo, createKeychain, findIdentity, Identity, isSignAllowed, removeKeychain, reportError } from \"./codeSign/macCodeSign\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { AfterPackContext, ElectronPlatformName } from \"./index\"\nimport { MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { Packager } from \"./packager\"\nimport { chooseNotNull, PlatformPackager } from \"./platformPackager\"\nimport { ArchiveTarget } from \"./targets/ArchiveTarget\"\nimport { PkgTarget, prepareProductBuildArgs } from \"./targets/pkg\"\nimport { createCommonTarget, NoOpTarget } from \"./targets/targetFactory\"\nimport { isMacOsHighSierra } from \"./util/macosVersion\"\nimport { getTemplatePath } from \"./util/pathManager\"\nimport * as fs from \"fs/promises\"\n\nexport default class MacPackager extends PlatformPackager<MacConfiguration> {\n readonly codeSigningInfo = new Lazy<CodeSigningInfo>(() => {\n const cscLink = this.getCscLink()\n if (cscLink == null || process.platform !== \"darwin\") {\n return Promise.resolve({ keychainFile: process.env.CSC_KEYCHAIN || null })\n }\n\n return createKeychain({\n tmpDir: this.info.tempDirManager,\n cscLink,\n cscKeyPassword: this.getCscPassword(),\n cscILink: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerLink, process.env.CSC_INSTALLER_LINK),\n cscIKeyPassword: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerKeyPassword, process.env.CSC_INSTALLER_KEY_PASSWORD),\n currentDir: this.projectDir,\n }).then(result => {\n const keychainFile = result.keychainFile\n if (keychainFile != null) {\n this.info.disposeOnBuildFinish(() => removeKeychain(keychainFile))\n }\n return result\n })\n })\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"icns\"))\n\n constructor(info: Packager) {\n super(info, Platform.MAC)\n }\n\n get defaultTarget(): Array<string> {\n return this.info.framework.macOsDefaultTargets\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n return new AppInfo(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions)\n }\n\n async getIconPath(): Promise<string | null> {\n return this._iconPath.value\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n for (const name of targets) {\n switch (name) {\n case DIR_TARGET:\n break\n\n case \"dmg\": {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { DmgTarget } = require(\"dmg-builder\")\n mapper(name, outDir => new DmgTarget(this, outDir))\n break\n }\n\n case \"zip\":\n // https://github.com/electron-userland/electron-builder/issues/2313\n mapper(name, outDir => new ArchiveTarget(name, outDir, this, true))\n break\n\n case \"pkg\":\n mapper(name, outDir => new PkgTarget(this, outDir))\n break\n\n default:\n mapper(name, outDir => (name === \"mas\" || name === \"mas-dev\" ? new NoOpTarget(name) : createCommonTarget(name, outDir, this)))\n break\n }\n }\n }\n\n protected async doPack(\n outDir: string,\n appOutDir: string,\n platformName: ElectronPlatformName,\n arch: Arch,\n platformSpecificBuildOptions: MacConfiguration,\n targets: Array<Target>\n ): Promise<any> {\n switch (arch) {\n default: {\n return super.doPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)\n }\n case Arch.universal: {\n const x64Arch = Arch.x64\n const x64AppOutDir = appOutDir + \"--\" + Arch[x64Arch]\n await super.doPack(outDir, x64AppOutDir, platformName, x64Arch, platformSpecificBuildOptions, targets, false, true)\n const arm64Arch = Arch.arm64\n const arm64AppOutPath = appOutDir + \"--\" + Arch[arm64Arch]\n await super.doPack(outDir, arm64AppOutPath, platformName, arm64Arch, platformSpecificBuildOptions, targets, false, true)\n const framework = this.info.framework\n log.info(\n {\n platform: platformName,\n arch: Arch[arch],\n [`${framework.name}`]: framework.version,\n appOutDir: log.filePath(appOutDir),\n },\n `packaging`\n )\n const appFile = `${this.appInfo.productFilename}.app`\n const { makeUniversalApp } = require(\"@electron/universal\")\n await makeUniversalApp({\n x64AppPath: path.join(x64AppOutDir, appFile),\n arm64AppPath: path.join(arm64AppOutPath, appFile),\n outAppPath: path.join(appOutDir, appFile),\n force: true,\n mergeASARs: platformSpecificBuildOptions.mergeASARs ?? true,\n singleArchFiles: platformSpecificBuildOptions.singleArchFiles,\n x64ArchFiles: platformSpecificBuildOptions.x64ArchFiles,\n })\n await fs.rm(x64AppOutDir, { recursive: true, force: true })\n await fs.rm(arm64AppOutPath, { recursive: true, force: true })\n\n // Give users a final opportunity to perform things on the combined universal package before signing\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n await this.info.afterPack(packContext)\n\n await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)\n break\n }\n }\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<any> {\n let nonMasPromise: Promise<any> | null = null\n\n const hasMas = targets.length !== 0 && targets.some(it => it.name === \"mas\" || it.name === \"mas-dev\")\n const prepackaged = this.packagerOptions.prepackaged\n\n if (!hasMas || targets.length > 1) {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${this.appInfo.productFilename}.app`) : prepackaged\n nonMasPromise = (\n prepackaged\n ? Promise.resolve()\n : this.doPack(outDir, path.dirname(appPath), this.platform.nodeName as ElectronPlatformName, arch, this.platformSpecificBuildOptions, targets)\n ).then(() => this.packageInDistributableFormat(appPath, arch, targets, taskManager))\n }\n\n for (const target of targets) {\n const targetName = target.name\n if (!(targetName === \"mas\" || targetName === \"mas-dev\")) {\n continue\n }\n\n const masBuildOptions = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas)\n if (targetName === \"mas-dev\") {\n deepAssign(masBuildOptions, this.config.masDev, {\n type: \"development\",\n })\n }\n\n const targetOutDir = path.join(outDir, `${targetName}${getArchSuffix(arch)}`)\n if (prepackaged == null) {\n await this.doPack(outDir, targetOutDir, \"mas\", arch, masBuildOptions, [target])\n await this.sign(path.join(targetOutDir, `${this.appInfo.productFilename}.app`), targetOutDir, masBuildOptions, arch)\n } else {\n await this.sign(prepackaged, targetOutDir, masBuildOptions, arch)\n }\n }\n\n if (nonMasPromise != null) {\n await nonMasPromise\n }\n }\n\n private async sign(appPath: string, outDir: string | null, masOptions: MasConfiguration | null, arch: Arch | null): Promise<void> {\n if (!isSignAllowed()) {\n return\n }\n\n const isMas = masOptions != null\n const options = masOptions == null ? this.platformSpecificBuildOptions : masOptions\n const qualifier = options.identity\n\n if (!isMas && qualifier === null) {\n if (this.forceCodeSigning) {\n throw new InvalidConfigurationError(\"identity explicitly is set to null, but forceCodeSigning is set to true\")\n }\n log.info({ reason: \"identity explicitly is set to null\" }, \"skipped macOS code signing\")\n return\n }\n\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n const explicitType = options.type\n const type = explicitType || \"distribution\"\n const isDevelopment = type === \"development\"\n const certificateTypes = getCertificateTypes(isMas, isDevelopment)\n\n let identity = null\n for (const certificateType of certificateTypes) {\n identity = await findIdentity(certificateType, qualifier, keychainFile)\n if (identity != null) {\n break\n }\n }\n\n if (identity == null) {\n if (!isMas && !isDevelopment && explicitType !== \"distribution\") {\n identity = await findIdentity(\"Mac Developer\", qualifier, keychainFile)\n if (identity != null) {\n log.warn(\"Mac Developer is used to sign app — it is only for development and testing, not for production\")\n }\n }\n\n if (identity == null) {\n await reportError(isMas, certificateTypes, qualifier, keychainFile, this.forceCodeSigning)\n return\n }\n }\n\n if (!isMacOsHighSierra()) {\n throw new InvalidConfigurationError(\"macOS High Sierra 10.13.6 is required to sign\")\n }\n\n let filter = options.signIgnore\n if (Array.isArray(filter)) {\n if (filter.length == 0) {\n filter = null\n }\n } else if (filter != null) {\n filter = filter.length === 0 ? null : [filter]\n }\n\n const filterRe = filter == null ? null : filter.map(it => new RegExp(it))\n\n let binaries = options.binaries || undefined\n if (binaries) {\n // Accept absolute paths for external binaries, else resolve relative paths from the artifact's app Contents path.\n binaries = await Promise.all(\n binaries.map(async destination => {\n if (await statOrNull(destination)) {\n return destination\n }\n return path.resolve(appPath, destination)\n })\n )\n log.info(\"Signing addtional user-defined binaries: \" + JSON.stringify(binaries, null, 1))\n }\n\n const signOptions: any = {\n \"identity-validation\": false,\n // https://github.com/electron-userland/electron-builder/issues/1699\n // kext are signed by the chipset manufacturers. You need a special certificate (only available on request) from Apple to be able to sign kext.\n ignore: (file: string) => {\n if (filterRe != null) {\n for (const regExp of filterRe) {\n if (regExp.test(file)) {\n return true\n }\n }\n }\n return (\n file.endsWith(\".kext\") ||\n file.startsWith(\"/Contents/PlugIns\", appPath.length) ||\n file.includes(\"/node_modules/puppeteer/.local-chromium\") ||\n file.includes(\"/node_modules/playwright-firefox/.local-browsers\") ||\n file.includes(\"/node_modules/playwright/.local-browsers\")\n )\n\n /* Those are browser automating modules, browser (chromium, nightly) cannot be signed\n https://github.com/electron-userland/electron-builder/issues/2010\n https://github.com/electron-userland/electron-builder/issues/5383\n */\n },\n identity: identity,\n type,\n platform: isMas ? \"mas\" : \"darwin\",\n version: this.config.electronVersion,\n app: appPath,\n keychain: keychainFile || undefined,\n binaries,\n timestamp: isMas ? masOptions?.timestamp : options.timestamp,\n requirements: isMas || this.platformSpecificBuildOptions.requirements == null ? undefined : await this.getResource(this.platformSpecificBuildOptions.requirements),\n // https://github.com/electron-userland/electron-osx-sign/issues/196\n // will fail on 10.14.5+ because a signed but unnotarized app is also rejected.\n \"gatekeeper-assess\": options.gatekeeperAssess === true,\n // https://github.com/electron-userland/electron-builder/issues/1480\n \"strict-verify\": options.strictVerify,\n hardenedRuntime: isMas ? masOptions && masOptions.hardenedRuntime === true : options.hardenedRuntime !== false,\n }\n\n await this.adjustSignOptions(signOptions, masOptions)\n log.info(\n {\n file: log.filePath(appPath),\n identityName: identity.name,\n identityHash: identity.hash,\n provisioningProfile: signOptions[\"provisioning-profile\"] || \"none\",\n },\n \"signing\"\n )\n await this.doSign(signOptions)\n\n // https://github.com/electron-userland/electron-builder/issues/1196#issuecomment-312310209\n if (masOptions != null && !isDevelopment) {\n const certType = isDevelopment ? \"Mac Developer\" : \"3rd Party Mac Developer Installer\"\n const masInstallerIdentity = await findIdentity(certType, masOptions.identity, keychainFile)\n if (masInstallerIdentity == null) {\n throw new InvalidConfigurationError(`Cannot find valid \"${certType}\" identity to sign MAS installer, please see https://electron.build/code-signing`)\n }\n\n // mas uploaded to AppStore, so, use \"-\" instead of space for name\n const artifactName = this.expandArtifactNamePattern(masOptions, \"pkg\", arch)\n const artifactPath = path.join(outDir!, artifactName)\n await this.doFlat(appPath, artifactPath, masInstallerIdentity, keychainFile)\n await this.dispatchArtifactCreated(artifactPath, null, Arch.x64, this.computeSafeArtifactName(artifactName, \"pkg\", arch, true, this.platformSpecificBuildOptions.defaultArch))\n }\n }\n\n private async adjustSignOptions(signOptions: any, masOptions: MasConfiguration | null) {\n const resourceList = await this.resourceList\n const customSignOptions = masOptions || this.platformSpecificBuildOptions\n const entitlementsSuffix = masOptions == null ? \"mac\" : \"mas\"\n\n let entitlements = customSignOptions.entitlements\n if (entitlements == null) {\n const p = `entitlements.${entitlementsSuffix}.plist`\n if (resourceList.includes(p)) {\n entitlements = path.join(this.info.buildResourcesDir, p)\n } else {\n entitlements = getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n signOptions.entitlements = entitlements\n\n let entitlementsInherit = customSignOptions.entitlementsInherit\n if (entitlementsInherit == null) {\n const p = `entitlements.${entitlementsSuffix}.inherit.plist`\n if (resourceList.includes(p)) {\n entitlementsInherit = path.join(this.info.buildResourcesDir, p)\n } else {\n entitlementsInherit = getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n signOptions[\"entitlements-inherit\"] = entitlementsInherit\n\n if (customSignOptions.provisioningProfile != null) {\n signOptions[\"provisioning-profile\"] = customSignOptions.provisioningProfile\n }\n signOptions[\"entitlements-loginhelper\"] = customSignOptions.entitlementsLoginHelper\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doSign(opts: SignOptions): Promise<any> {\n return signAsync(opts)\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | null | undefined): Promise<any> {\n // productbuild doesn't created directory for out file\n await mkdir(path.dirname(outFile), { recursive: true })\n\n const args = prepareProductBuildArgs(identity, keychain)\n args.push(\"--component\", appPath, \"/Applications\")\n args.push(outFile)\n return await exec(\"productbuild\", args)\n }\n\n public getElectronSrcDir(dist: string) {\n return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName)\n }\n\n public getElectronDestinationDir(appOutDir: string) {\n return path.join(appOutDir, this.info.framework.distMacOsAppName)\n }\n\n // todo fileAssociations\n async applyCommonInfo(appPlist: any, contentsPath: string) {\n const appInfo = this.appInfo\n const appFilename = appInfo.productFilename\n\n // https://github.com/electron-userland/electron-builder/issues/1278\n appPlist.CFBundleExecutable = appFilename.endsWith(\" Helper\") ? appFilename.substring(0, appFilename.length - \" Helper\".length) : appFilename\n\n const icon = await this.getIconPath()\n if (icon != null) {\n const oldIcon = appPlist.CFBundleIconFile\n const resourcesPath = path.join(contentsPath, \"Resources\")\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = \"icon.icns\"\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(icon, path.join(resourcesPath, iconFileName))\n }\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n appPlist.CFBundleIdentifier = appInfo.macBundleIdentifier\n\n appPlist.CFBundleShortVersionString = this.platformSpecificBuildOptions.bundleShortVersion || appInfo.version\n appPlist.CFBundleVersion = appInfo.buildVersion\n\n use(this.platformSpecificBuildOptions.category || (this.config as any).category, it => (appPlist.LSApplicationCategoryType = it))\n appPlist.NSHumanReadableCopyright = appInfo.copyright\n\n if (this.platformSpecificBuildOptions.darkModeSupport) {\n appPlist.NSRequiresAquaSystemAppearance = false\n }\n\n const extendInfo = this.platformSpecificBuildOptions.extendInfo\n if (extendInfo != null) {\n Object.assign(appPlist, extendInfo)\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise<any> {\n const appFileName = `${this.appInfo.productFilename}.app`\n\n await BluebirdPromise.map(readdir(packContext.appOutDir), (file: string): any => {\n if (file === appFileName) {\n return this.sign(path.join(packContext.appOutDir, file), null, null, null)\n }\n return null\n })\n\n if (!isAsar) {\n return\n }\n\n const outResourcesDir = path.join(packContext.appOutDir, \"resources\", \"app.asar.unpacked\")\n await BluebirdPromise.map(orIfFileNotExist(readdir(outResourcesDir), []), (file: string): any => {\n if (file.endsWith(\".app\")) {\n return this.sign(path.join(outResourcesDir, file), null, null, null)\n } else {\n return null\n }\n })\n }\n}\n\nfunction getCertificateTypes(isMas: boolean, isDevelopment: boolean): CertType[] {\n if (isDevelopment) {\n return isMas ? [\"Mac Developer\", \"Apple Development\"] : [\"Mac Developer\", \"Developer ID Application\"]\n }\n return isMas ? [\"Apple Distribution\", \"3rd Party Mac Developer Application\"] : [\"Developer ID Application\"]\n}\n"]}
|
|
@@ -26,11 +26,14 @@ export interface MacConfiguration extends PlatformSpecificBuildOptions {
|
|
|
26
26
|
/**
|
|
27
27
|
* The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).
|
|
28
28
|
* MAS entitlements is specified in the [mas](/configuration/mas).
|
|
29
|
+
* See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.
|
|
30
|
+
* Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.
|
|
31
|
+
* See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.
|
|
29
32
|
*/
|
|
30
33
|
readonly entitlements?: string | null;
|
|
31
34
|
/**
|
|
32
35
|
* The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).
|
|
33
|
-
*
|
|
36
|
+
* See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.
|
|
34
37
|
*
|
|
35
38
|
* This option only applies when signing with `entitlements` provided.
|
|
36
39
|
*/
|
|
@@ -275,12 +278,14 @@ export interface DmgContent {
|
|
|
275
278
|
export interface MasConfiguration extends MacConfiguration {
|
|
276
279
|
/**
|
|
277
280
|
* The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).
|
|
278
|
-
*
|
|
281
|
+
* See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.
|
|
282
|
+
* Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.
|
|
283
|
+
* See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.
|
|
279
284
|
*/
|
|
280
285
|
readonly entitlements?: string | null;
|
|
281
286
|
/**
|
|
282
287
|
* The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).
|
|
283
|
-
*
|
|
288
|
+
* See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.
|
|
284
289
|
*/
|
|
285
290
|
readonly entitlementsInherit?: string | null;
|
|
286
291
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from \"../index\"\n\nexport type MacOsTargetName = \"default\" | \"dmg\" | \"mas\" | \"mas-dev\" | \"pkg\" | \"7z\" | \"zip\" | \"tar.xz\" | \"tar.lz\" | \"tar.gz\" | \"tar.bz2\" | \"dir\"\n\nexport interface MacConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n *\n * For example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n *\n * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).\n */\n readonly category?: string | null\n\n /**\n * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (dmg and zip for Squirrel.Mac).\n */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.\n * MAS installer identity is specified in the [mas](/configuration/mas).\n */\n readonly identity?: string | null\n\n /**\n * The path to application icon.\n * @default build/icon.icns\n */\n readonly icon?: string | null\n\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\n * MAS entitlements is specified in the [mas](/configuration/mas).\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\n * Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.darwin.inherit.plist).\n *\n * This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Path to login helper entitlement file.\n * When using App Sandbox, the the `com.apple.security.inherit` key that is normally in the inherited entitlements cannot be inherited since the login helper is a standalone executable.\n * Defaults to the value provided for `entitlements`. This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsLoginHelper?: string | null\n\n /**\n * The path to the provisioning profile to use when signing, absolute or relative to the app root.\n */\n readonly provisioningProfile?: string | null\n\n /**\n * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).\n */\n readonly bundleVersion?: string | null\n\n /**\n * The `CFBundleShortVersionString`. Do not use it unless you need to.\n */\n readonly bundleShortVersion?: string | null\n\n /**\n * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.\n * @default false\n */\n readonly darkModeSupport?: boolean\n\n /**\n * The bundle identifier to use in the application helper's plist.\n * @default ${appBundleIdentifier}.helper\n */\n readonly helperBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Renderer helper's plist.\n * @default ${appBundleIdentifier}.helper.Renderer\n */\n readonly helperRendererBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Plugin helper's plist.\n * @default ${appBundleIdentifier}.helper.Plugin\n */\n readonly helperPluginBundleId?: string | null\n\n /**\n * The bundle identifier to use in the GPU helper's plist.\n * @default ${appBundleIdentifier}.helper.GPU\n */\n readonly helperGPUBundleId?: string | null\n\n /**\n * The bundle identifier to use in the EH helper's plist.\n * @default ${appBundleIdentifier}.helper.EH\n */\n readonly helperEHBundleId?: string | null\n\n /**\n * The bundle identifier to use in the NP helper's plist.\n * @default ${appBundleIdentifier}.helper.NP\n */\n readonly helperNPBundleId?: string | null\n\n /**\n * Whether to sign app for development or for distribution.\n * @default distribution\n */\n readonly type?: \"distribution\" | \"development\" | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n\n /**\n * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.\n */\n readonly minimumSystemVersion?: string | null\n\n /**\n * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.\n */\n readonly requirements?: string | null\n\n /**\n * The electron locales. By default Electron locales used as is.\n */\n readonly electronLanguages?: Array<string> | string\n\n /** @private */\n readonly cscInstallerLink?: string | null\n /** @private */\n readonly cscInstallerKeyPassword?: string | null\n\n /**\n * Extra files to put in archive. Not applicable for `tar.*`.\n */\n readonly extraDistFiles?: Array<string> | string | null\n\n /**\n * Whether your app has to be signed with hardened runtime.\n * @default true\n */\n readonly hardenedRuntime?: boolean\n\n /**\n * Whether to let electron-osx-sign validate the signing or not.\n * @default false\n */\n readonly gatekeeperAssess?: boolean\n\n /**\n * Whether to let electron-osx-sign verify the contents or not.\n * @default true\n */\n readonly strictVerify?: Array<string> | string | boolean\n\n /**\n * Regex or an array of regex's that signal skipping signing a file.\n */\n readonly signIgnore?: Array<string> | string | null\n\n /**\n * Specify the URL of the timestamp authority server\n */\n readonly timestamp?: string | null\n\n /**\n * Whether to merge ASAR files for different architectures or not.\n *\n * This option has no effect unless building for \"universal\" arch.\n * @default true\n */\n readonly mergeASARs?: boolean\n\n /**\n * Minimatch pattern of paths that are allowed to be present in one of the\n * ASAR files, but not in the other.\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly singleArchFiles?: string\n\n /**\n * Minimatch pattern of paths that are allowed to be x64 binaries in both\n * ASAR files\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly x64ArchFiles?: string\n}\n\nexport interface DmgOptions extends TargetSpecificOptions {\n /**\n * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\n * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.\n * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).\n */\n background?: string | null\n\n /**\n * The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image.\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to the application icon (`build/icon.icns`).\n */\n icon?: string | null\n\n /**\n * The size of all the icons inside the DMG.\n * @default 80\n */\n readonly iconSize?: number | null\n\n /**\n * The size of all the icon texts inside the DMG.\n * @default 12\n */\n readonly iconTextSize?: number | null\n\n /**\n * The title of the produced DMG, which will be shown when mounted (volume name).\n *\n * Macro `${productName}`, `${version}` and `${name}` are supported.\n * @default ${productName} ${version}\n */\n readonly title?: string | null\n\n /**\n * The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.\n */\n contents?: Array<DmgContent>\n\n /**\n * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).\n * @default UDZO\n */\n format?: \"UDRW\" | \"UDRO\" | \"UDCO\" | \"UDZO\" | \"UDBZ\" | \"ULFO\"\n\n /**\n * The DMG window position and size. With y co-ordinates running from bottom to top.\n *\n * The Finder makes sure that the window will be on the user’s display, so if you want your window at the top left of the display you could use `\"x\": 0, \"y\": 100000` as the x, y co-ordinates.\n * It is not to be possible to position the window relative to the [top left](https://github.com/electron-userland/electron-builder/issues/3990#issuecomment-512960957) or relative to the center of the user’s screen.\n */\n window?: DmgWindow\n\n /**\n * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).\n * @default false\n */\n readonly internetEnabled?: boolean\n\n /**\n * Whether to sign the DMG or not. Signing is not required and will lead to unwanted errors in combination with notarization requirements.\n * @default false\n */\n readonly sign?: boolean\n\n /**\n * @private\n * @default true\n */\n writeUpdateInfo?: boolean\n}\n\nexport interface DmgWindow {\n /**\n * The X position relative to left of the screen.\n * @default 400\n */\n x?: number\n\n /**\n * The Y position relative to bottom of the screen.\n * @default 100\n */\n y?: number\n\n /**\n * The width. Defaults to background image width or 540.\n */\n width?: number\n\n /**\n * The height. Defaults to background image height or 380.\n */\n height?: number\n}\n\nexport interface DmgContent {\n /**\n * The device-independent pixel offset from the left of the window to the **center** of the icon.\n */\n x: number\n /**\n * The device-independent pixel offset from the top of the window to the **center** of the icon.\n */\n y: number\n type?: \"link\" | \"file\" | \"dir\"\n\n /**\n * The name of the file within the DMG. Defaults to basename of `path`.\n */\n name?: string\n\n /**\n * The path of the file within the DMG.\n */\n path?: string\n}\n\nexport interface MasConfiguration extends MacConfiguration {\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\n * Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.mas.plist).\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\n * Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.mas.inherit.plist).\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n}\n"]}
|
|
1
|
+
{"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from \"../index\"\n\nexport type MacOsTargetName = \"default\" | \"dmg\" | \"mas\" | \"mas-dev\" | \"pkg\" | \"7z\" | \"zip\" | \"tar.xz\" | \"tar.lz\" | \"tar.gz\" | \"tar.bz2\" | \"dir\"\n\nexport interface MacConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n *\n * For example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n *\n * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).\n */\n readonly category?: string | null\n\n /**\n * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (dmg and zip for Squirrel.Mac).\n */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.\n * MAS installer identity is specified in the [mas](/configuration/mas).\n */\n readonly identity?: string | null\n\n /**\n * The path to application icon.\n * @default build/icon.icns\n */\n readonly icon?: string | null\n\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\n * MAS entitlements is specified in the [mas](/configuration/mas).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n *\n * This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Path to login helper entitlement file.\n * When using App Sandbox, the the `com.apple.security.inherit` key that is normally in the inherited entitlements cannot be inherited since the login helper is a standalone executable.\n * Defaults to the value provided for `entitlements`. This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsLoginHelper?: string | null\n\n /**\n * The path to the provisioning profile to use when signing, absolute or relative to the app root.\n */\n readonly provisioningProfile?: string | null\n\n /**\n * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).\n */\n readonly bundleVersion?: string | null\n\n /**\n * The `CFBundleShortVersionString`. Do not use it unless you need to.\n */\n readonly bundleShortVersion?: string | null\n\n /**\n * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.\n * @default false\n */\n readonly darkModeSupport?: boolean\n\n /**\n * The bundle identifier to use in the application helper's plist.\n * @default ${appBundleIdentifier}.helper\n */\n readonly helperBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Renderer helper's plist.\n * @default ${appBundleIdentifier}.helper.Renderer\n */\n readonly helperRendererBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Plugin helper's plist.\n * @default ${appBundleIdentifier}.helper.Plugin\n */\n readonly helperPluginBundleId?: string | null\n\n /**\n * The bundle identifier to use in the GPU helper's plist.\n * @default ${appBundleIdentifier}.helper.GPU\n */\n readonly helperGPUBundleId?: string | null\n\n /**\n * The bundle identifier to use in the EH helper's plist.\n * @default ${appBundleIdentifier}.helper.EH\n */\n readonly helperEHBundleId?: string | null\n\n /**\n * The bundle identifier to use in the NP helper's plist.\n * @default ${appBundleIdentifier}.helper.NP\n */\n readonly helperNPBundleId?: string | null\n\n /**\n * Whether to sign app for development or for distribution.\n * @default distribution\n */\n readonly type?: \"distribution\" | \"development\" | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n\n /**\n * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.\n */\n readonly minimumSystemVersion?: string | null\n\n /**\n * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.\n */\n readonly requirements?: string | null\n\n /**\n * The electron locales. By default Electron locales used as is.\n */\n readonly electronLanguages?: Array<string> | string\n\n /** @private */\n readonly cscInstallerLink?: string | null\n /** @private */\n readonly cscInstallerKeyPassword?: string | null\n\n /**\n * Extra files to put in archive. Not applicable for `tar.*`.\n */\n readonly extraDistFiles?: Array<string> | string | null\n\n /**\n * Whether your app has to be signed with hardened runtime.\n * @default true\n */\n readonly hardenedRuntime?: boolean\n\n /**\n * Whether to let electron-osx-sign validate the signing or not.\n * @default false\n */\n readonly gatekeeperAssess?: boolean\n\n /**\n * Whether to let electron-osx-sign verify the contents or not.\n * @default true\n */\n readonly strictVerify?: Array<string> | string | boolean\n\n /**\n * Regex or an array of regex's that signal skipping signing a file.\n */\n readonly signIgnore?: Array<string> | string | null\n\n /**\n * Specify the URL of the timestamp authority server\n */\n readonly timestamp?: string | null\n\n /**\n * Whether to merge ASAR files for different architectures or not.\n *\n * This option has no effect unless building for \"universal\" arch.\n * @default true\n */\n readonly mergeASARs?: boolean\n\n /**\n * Minimatch pattern of paths that are allowed to be present in one of the\n * ASAR files, but not in the other.\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly singleArchFiles?: string\n\n /**\n * Minimatch pattern of paths that are allowed to be x64 binaries in both\n * ASAR files\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly x64ArchFiles?: string\n}\n\nexport interface DmgOptions extends TargetSpecificOptions {\n /**\n * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\n * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.\n * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).\n */\n background?: string | null\n\n /**\n * The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image.\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to the application icon (`build/icon.icns`).\n */\n icon?: string | null\n\n /**\n * The size of all the icons inside the DMG.\n * @default 80\n */\n readonly iconSize?: number | null\n\n /**\n * The size of all the icon texts inside the DMG.\n * @default 12\n */\n readonly iconTextSize?: number | null\n\n /**\n * The title of the produced DMG, which will be shown when mounted (volume name).\n *\n * Macro `${productName}`, `${version}` and `${name}` are supported.\n * @default ${productName} ${version}\n */\n readonly title?: string | null\n\n /**\n * The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.\n */\n contents?: Array<DmgContent>\n\n /**\n * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).\n * @default UDZO\n */\n format?: \"UDRW\" | \"UDRO\" | \"UDCO\" | \"UDZO\" | \"UDBZ\" | \"ULFO\"\n\n /**\n * The DMG window position and size. With y co-ordinates running from bottom to top.\n *\n * The Finder makes sure that the window will be on the user’s display, so if you want your window at the top left of the display you could use `\"x\": 0, \"y\": 100000` as the x, y co-ordinates.\n * It is not to be possible to position the window relative to the [top left](https://github.com/electron-userland/electron-builder/issues/3990#issuecomment-512960957) or relative to the center of the user’s screen.\n */\n window?: DmgWindow\n\n /**\n * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).\n * @default false\n */\n readonly internetEnabled?: boolean\n\n /**\n * Whether to sign the DMG or not. Signing is not required and will lead to unwanted errors in combination with notarization requirements.\n * @default false\n */\n readonly sign?: boolean\n\n /**\n * @private\n * @default true\n */\n writeUpdateInfo?: boolean\n}\n\nexport interface DmgWindow {\n /**\n * The X position relative to left of the screen.\n * @default 400\n */\n x?: number\n\n /**\n * The Y position relative to bottom of the screen.\n * @default 100\n */\n y?: number\n\n /**\n * The width. Defaults to background image width or 540.\n */\n width?: number\n\n /**\n * The height. Defaults to background image height or 380.\n */\n height?: number\n}\n\nexport interface DmgContent {\n /**\n * The device-independent pixel offset from the left of the window to the **center** of the icon.\n */\n x: number\n /**\n * The device-independent pixel offset from the top of the window to the **center** of the icon.\n */\n y: number\n type?: \"link\" | \"file\" | \"dir\"\n\n /**\n * The name of the file within the DMG. Defaults to basename of `path`.\n */\n name?: string\n\n /**\n * The path of the file within the DMG.\n */\n path?: string\n}\n\nexport interface MasConfiguration extends MacConfiguration {\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n}\n"]}
|
package/out/targets/fpm.js
CHANGED
|
@@ -157,7 +157,10 @@ class FpmTarget extends core_1.Target {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
builder_util_1.use(packager.info.metadata.license, it => args.push("--license", it));
|
|
160
|
-
builder_util_1.use(appInfo.buildNumber, it => args.push("--iteration",
|
|
160
|
+
builder_util_1.use(appInfo.buildNumber, it => args.push("--iteration",
|
|
161
|
+
// dashes are not supported for iteration in older versions of fpm
|
|
162
|
+
// https://github.com/jordansissel/fpm/issues/1833
|
|
163
|
+
it.split("-").join("_")));
|
|
161
164
|
builder_util_1.use(options.fpm, it => args.push(...it));
|
|
162
165
|
args.push(`${appOutDir}/=${LinuxTargetHelper_1.installPrefix}/${appInfo.sanitizedProductName}`);
|
|
163
166
|
for (const icon of await this.helper.icons) {
|
package/out/targets/fpm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fpm.js","sourceRoot":"","sources":["../../src/targets/fpm.ts"],"names":[],"mappings":";;AAAA,wCAAkC;AAClC,+CAA2F;AAC3F,4CAAoD;AACpD,uCAAqC;AACrC,0CAA6C;AAC7C,6BAA4B;AAC5B,wCAAoC;AACpC,kCAAgC;AAChC,kDAAiD;AAGjD,mDAAiD;AACjD,qDAAgD;AAChD,uDAAoD;AACpD,qDAAqD;AACrD,2DAAsE;AACtE,mCAA2C;AAS3C,MAAqB,SAAU,SAAQ,aAAM;IAK3C,YAAY,IAAY,EAAmB,QAAuB,EAAmB,MAAyB,EAAW,MAAc;QACrI,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QADuB,aAAQ,GAAR,QAAQ,CAAe;QAAmB,WAAM,GAAN,MAAM,CAAmB;QAAW,WAAM,GAAN,MAAM,CAAQ;QAJ9H,YAAO,GAA+B,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,4BAA4B,EAAE,GAAI,IAAI,CAAC,QAAQ,CAAC,MAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;QAO3I,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa,EAA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e,CAAC,MAAc,EAAE,YAAoB,EAAE,OAAY;IAC/E,mCAAmC;IACnC,SAAS,QAAQ,CAAC,KAAa,EAAE,EAAU;QACzC,IAAI,EAAE,IAAI,OAAO,EAAE;YACjB,OAAO,OAAO,CAAC,EAAE,CAAC,CAAA;SACnB;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAA;SAC9C;IACH,CAAC;IACD,MAAM,MAAM,GAAG,CAAC,MAAM,mBAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE;QACrI,kBAAG,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAA;QACvE,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;IAC5F,MAAM,qBAAU,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;IACpC,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import { path7za } from \"7zip-bin\"\nimport { Arch, executeAppBuilder, log, TmpDir, toLinuxArchString, use } from \"builder-util\"\nimport { unlinkIfExists } from \"builder-util/out/fs\"\nimport { outputFile } from \"fs-extra\"\nimport { mkdir, readFile } from \"fs/promises\"\nimport * as path from \"path\"\nimport { smarten } from \"../appInfo\"\nimport { Target } from \"../core\"\nimport * as errorMessages from \"../errorMessages\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { DebOptions, LinuxTargetSpecificOptions } from \"../options/linuxOptions\"\nimport { objectToArgs } from \"../util/appBuilder\"\nimport { computeEnv } from \"../util/bundledTool\"\nimport { isMacOsSierra } from \"../util/macosVersion\"\nimport { getTemplatePath } from \"../util/pathManager\"\nimport { installPrefix, LinuxTargetHelper } from \"./LinuxTargetHelper\"\nimport { getLinuxToolsPath } from \"./tools\"\n\ninterface FpmOptions {\n name: string\n maintainer: string | undefined\n vendor: string\n url: string\n}\n\nexport default class FpmTarget extends Target {\n readonly options: LinuxTargetSpecificOptions = { ...this.packager.platformSpecificBuildOptions, ...(this.packager.config as any)[this.name] }\n\n private readonly scriptFiles: Promise<Array<string>>\n\n constructor(name: string, private readonly packager: LinuxPackager, private readonly helper: LinuxTargetHelper, readonly outDir: string) {\n super(name, false)\n\n this.scriptFiles = this.createScripts()\n }\n\n private async createScripts(): Promise<Array<string>> {\n const defaultTemplatesDir = getTemplatePath(\"linux\")\n\n const packager = this.packager\n const templateOptions = {\n // old API compatibility\n executable: packager.executableName,\n sanitizedProductName: packager.appInfo.sanitizedProductName,\n productFilename: packager.appInfo.productFilename,\n ...packager.platformSpecificBuildOptions,\n }\n\n function getResource(value: string | null | undefined, defaultFile: string) {\n if (value == null) {\n return path.join(defaultTemplatesDir, defaultFile)\n }\n return path.resolve(packager.projectDir, value)\n }\n\n return await Promise.all<string>([\n writeConfigFile(packager.info.tempDirManager, getResource(this.options.afterInstall, \"after-install.tpl\"), templateOptions),\n writeConfigFile(packager.info.tempDirManager, getResource(this.options.afterRemove, \"after-remove.tpl\"), templateOptions),\n ])\n }\n\n checkOptions(): Promise<any> {\n return this.computeFpmMetaInfoOptions()\n }\n\n private async computeFpmMetaInfoOptions(): Promise<FpmOptions> {\n const packager = this.packager\n const projectUrl = await packager.appInfo.computePackageUrl()\n const errors: Array<string> = []\n if (projectUrl == null) {\n errors.push(\"Please specify project homepage, see https://electron.build/configuration/configuration#Metadata-homepage\")\n }\n\n const options = this.options\n let author = options.maintainer\n if (author == null) {\n const a = packager.info.metadata.author\n if (a == null || a.email == null) {\n errors.push(errorMessages.authorEmailIsMissed)\n } else {\n author = `${a.name} <${a.email}>`\n }\n }\n\n if (errors.length > 0) {\n throw new Error(errors.join(\"\\n\\n\"))\n }\n\n return {\n name: options.packageName ?? this.packager.appInfo.linuxPackageName,\n maintainer: author!,\n url: projectUrl!,\n vendor: options.vendor || author!,\n }\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const target = this.name\n\n // tslint:disable:no-invalid-template-strings\n let nameFormat = \"${name}-${version}-${arch}.${ext}\"\n let isUseArchIfX64 = false\n if (target === \"deb\") {\n nameFormat = \"${name}_${version}_${arch}.${ext}\"\n isUseArchIfX64 = true\n } else if (target === \"rpm\") {\n nameFormat = \"${name}-${version}.${arch}.${ext}\"\n isUseArchIfX64 = true\n }\n\n const packager = this.packager\n const artifactPath = path.join(this.outDir, packager.expandArtifactNamePattern(this.options, target, arch, nameFormat, !isUseArchIfX64))\n\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: target,\n file: artifactPath,\n arch,\n })\n\n await unlinkIfExists(artifactPath)\n if (packager.packagerOptions.prepackaged != null) {\n await mkdir(this.outDir, { recursive: true })\n }\n\n const scripts = await this.scriptFiles\n const appInfo = packager.appInfo\n const options = this.options\n const synopsis = options.synopsis\n const args = [\n \"--architecture\",\n toLinuxArchString(arch, target),\n \"--after-install\",\n scripts[0],\n \"--after-remove\",\n scripts[1],\n \"--description\",\n smarten(target === \"rpm\" ? this.helper.getDescription(options)! : `${synopsis || \"\"}\\n ${this.helper.getDescription(options)}`),\n \"--version\",\n appInfo.version,\n \"--package\",\n artifactPath,\n ]\n\n objectToArgs(args, (await this.computeFpmMetaInfoOptions()) as any)\n\n const packageCategory = options.packageCategory\n if (packageCategory != null) {\n args.push(\"--category\", packageCategory)\n }\n\n if (target === \"deb\") {\n args.push(\"--deb-priority\", (options as DebOptions).priority ?? \"optional\")\n } else if (target === \"rpm\") {\n if (synopsis != null) {\n args.push(\"--rpm-summary\", smarten(synopsis))\n }\n }\n\n const fpmConfiguration: FpmConfiguration = {\n args,\n target,\n }\n\n if (options.compression != null) {\n fpmConfiguration.compression = options.compression\n }\n\n // noinspection JSDeprecatedSymbols\n const depends = options.depends\n if (depends != null) {\n if (Array.isArray(depends)) {\n fpmConfiguration.customDepends = depends\n } else {\n // noinspection SuspiciousTypeOfGuard\n if (typeof depends === \"string\") {\n fpmConfiguration.customDepends = [depends as string]\n } else {\n throw new Error(`depends must be Array or String, but specified as: ${depends}`)\n }\n }\n }\n\n use(packager.info.metadata.license, it => args.push(\"--license\", it!))\n use(appInfo.buildNumber, it => args.push(\"--iteration\", it!))\n\n use(options.fpm, it => args.push(...(it as any)))\n\n args.push(`${appOutDir}/=${installPrefix}/${appInfo.sanitizedProductName}`)\n for (const icon of await this.helper.icons) {\n const extWithDot = path.extname(icon.file)\n const sizeName = extWithDot === \".svg\" ? \"scalable\" : `${icon.size}x${icon.size}`\n args.push(`${icon.file}=/usr/share/icons/hicolor/${sizeName}/apps/${packager.executableName}${extWithDot}`)\n }\n\n const mimeTypeFilePath = await this.helper.mimeTypeFiles\n if (mimeTypeFilePath != null) {\n args.push(`${mimeTypeFilePath}=/usr/share/mime/packages/${packager.executableName}.xml`)\n }\n\n const desktopFilePath = await this.helper.writeDesktopEntry(this.options)\n args.push(`${desktopFilePath}=/usr/share/applications/${packager.executableName}.desktop`)\n\n if (packager.packagerOptions.effectiveOptionComputed != null && (await packager.packagerOptions.effectiveOptionComputed([args, desktopFilePath]))) {\n return\n }\n\n const env = {\n ...process.env,\n SZA_PATH: path7za,\n SZA_COMPRESSION_LEVEL: packager.compression === \"store\" ? \"0\" : \"9\",\n }\n\n // rpmbuild wants directory rpm with some default config files. Even if we can use dylibbundler, path to such config files are not changed (we need to replace in the binary)\n // so, for now, brew install rpm is still required.\n if (target !== \"rpm\" && (await isMacOsSierra())) {\n const linuxToolsPath = await getLinuxToolsPath()\n Object.assign(env, {\n PATH: computeEnv(process.env.PATH, [path.join(linuxToolsPath, \"bin\")]),\n DYLD_LIBRARY_PATH: computeEnv(process.env.DYLD_LIBRARY_PATH, [path.join(linuxToolsPath, \"lib\")]),\n })\n }\n\n await executeAppBuilder([\"fpm\", \"--configuration\", JSON.stringify(fpmConfiguration)], undefined, { env })\n\n await packager.dispatchArtifactCreated(artifactPath, this, arch)\n }\n}\n\ninterface FpmConfiguration {\n target: string\n args: Array<string>\n customDepends?: Array<string>\n compression?: string | null\n}\n\nasync function writeConfigFile(tmpDir: TmpDir, templatePath: string, options: any): Promise<string> {\n //noinspection JSUnusedLocalSymbols\n function replacer(match: string, p1: string) {\n if (p1 in options) {\n return options[p1]\n } else {\n throw new Error(`Macro ${p1} is not defined`)\n }\n }\n const config = (await readFile(templatePath, \"utf8\")).replace(/\\${([a-zA-Z]+)}/g, replacer).replace(/<%=([a-zA-Z]+)%>/g, (match, p1) => {\n log.warn(\"<%= varName %> is deprecated, please use ${varName} instead\")\n return replacer(match, p1.trim())\n })\n\n const outputPath = await tmpDir.getTempFile({ suffix: path.basename(templatePath, \".tpl\") })\n await outputFile(outputPath, config)\n return outputPath\n}\n"]}
|
|
1
|
+
{"version":3,"file":"fpm.js","sourceRoot":"","sources":["../../src/targets/fpm.ts"],"names":[],"mappings":";;AAAA,wCAAkC;AAClC,+CAA2F;AAC3F,4CAAoD;AACpD,uCAAqC;AACrC,0CAA6C;AAC7C,6BAA4B;AAC5B,wCAAoC;AACpC,kCAAgC;AAChC,kDAAiD;AAGjD,mDAAiD;AACjD,qDAAgD;AAChD,uDAAoD;AACpD,qDAAqD;AACrD,2DAAsE;AACtE,mCAA2C;AAS3C,MAAqB,SAAU,SAAQ,aAAM;IAK3C,YAAY,IAAY,EAAmB,QAAuB,EAAmB,MAAyB,EAAW,MAAc;QACrI,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QADuB,aAAQ,GAAR,QAAQ,CAAe;QAAmB,WAAM,GAAN,MAAM,CAAmB;QAAW,WAAM,GAAN,MAAM,CAAQ;QAJ9H,YAAO,GAA+B,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,4BAA4B,EAAE,GAAI,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AAC,gBAAgB,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;QAEzG,MAAM,QAAQ,CAAC,uBAAuB,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IAClE,CAAC;CACF;AAhND,4BAgNC;AASD,KAAK,UAAU,eAAe,CAAC,MAAc,EAAE,YAAoB,EAAE,OAAY;IAC/E,mCAAmC;IACnC,SAAS,QAAQ,CAAC,KAAa,EAAE,EAAU;QACzC,IAAI,EAAE,IAAI,OAAO,EAAE;YACjB,OAAO,OAAO,CAAC,EAAE,CAAC,CAAA;SACnB;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAA;SAC9C;IACH,CAAC;IACD,MAAM,MAAM,GAAG,CAAC,MAAM,mBAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE;QACrI,kBAAG,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAA;QACvE,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;IAC5F,MAAM,qBAAU,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;IACpC,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import { path7za } from \"7zip-bin\"\nimport { Arch, executeAppBuilder, log, TmpDir, toLinuxArchString, use } from \"builder-util\"\nimport { unlinkIfExists } from \"builder-util/out/fs\"\nimport { outputFile } from \"fs-extra\"\nimport { mkdir, readFile } from \"fs/promises\"\nimport * as path from \"path\"\nimport { smarten } from \"../appInfo\"\nimport { Target } from \"../core\"\nimport * as errorMessages from \"../errorMessages\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { DebOptions, LinuxTargetSpecificOptions } from \"../options/linuxOptions\"\nimport { objectToArgs } from \"../util/appBuilder\"\nimport { computeEnv } from \"../util/bundledTool\"\nimport { isMacOsSierra } from \"../util/macosVersion\"\nimport { getTemplatePath } from \"../util/pathManager\"\nimport { installPrefix, LinuxTargetHelper } from \"./LinuxTargetHelper\"\nimport { getLinuxToolsPath } from \"./tools\"\n\ninterface FpmOptions {\n name: string\n maintainer: string | undefined\n vendor: string\n url: string\n}\n\nexport default class FpmTarget extends Target {\n readonly options: LinuxTargetSpecificOptions = { ...this.packager.platformSpecificBuildOptions, ...(this.packager.config as any)[this.name] }\n\n private readonly scriptFiles: Promise<Array<string>>\n\n constructor(name: string, private readonly packager: LinuxPackager, private readonly helper: LinuxTargetHelper, readonly outDir: string) {\n super(name, false)\n\n this.scriptFiles = this.createScripts()\n }\n\n private async createScripts(): Promise<Array<string>> {\n const defaultTemplatesDir = getTemplatePath(\"linux\")\n\n const packager = this.packager\n const templateOptions = {\n // old API compatibility\n executable: packager.executableName,\n sanitizedProductName: packager.appInfo.sanitizedProductName,\n productFilename: packager.appInfo.productFilename,\n ...packager.platformSpecificBuildOptions,\n }\n\n function getResource(value: string | null | undefined, defaultFile: string) {\n if (value == null) {\n return path.join(defaultTemplatesDir, defaultFile)\n }\n return path.resolve(packager.projectDir, value)\n }\n\n return await Promise.all<string>([\n writeConfigFile(packager.info.tempDirManager, getResource(this.options.afterInstall, \"after-install.tpl\"), templateOptions),\n writeConfigFile(packager.info.tempDirManager, getResource(this.options.afterRemove, \"after-remove.tpl\"), templateOptions),\n ])\n }\n\n checkOptions(): Promise<any> {\n return this.computeFpmMetaInfoOptions()\n }\n\n private async computeFpmMetaInfoOptions(): Promise<FpmOptions> {\n const packager = this.packager\n const projectUrl = await packager.appInfo.computePackageUrl()\n const errors: Array<string> = []\n if (projectUrl == null) {\n errors.push(\"Please specify project homepage, see https://electron.build/configuration/configuration#Metadata-homepage\")\n }\n\n const options = this.options\n let author = options.maintainer\n if (author == null) {\n const a = packager.info.metadata.author\n if (a == null || a.email == null) {\n errors.push(errorMessages.authorEmailIsMissed)\n } else {\n author = `${a.name} <${a.email}>`\n }\n }\n\n if (errors.length > 0) {\n throw new Error(errors.join(\"\\n\\n\"))\n }\n\n return {\n name: options.packageName ?? this.packager.appInfo.linuxPackageName,\n maintainer: author!,\n url: projectUrl!,\n vendor: options.vendor || author!,\n }\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const target = this.name\n\n // tslint:disable:no-invalid-template-strings\n let nameFormat = \"${name}-${version}-${arch}.${ext}\"\n let isUseArchIfX64 = false\n if (target === \"deb\") {\n nameFormat = \"${name}_${version}_${arch}.${ext}\"\n isUseArchIfX64 = true\n } else if (target === \"rpm\") {\n nameFormat = \"${name}-${version}.${arch}.${ext}\"\n isUseArchIfX64 = true\n }\n\n const packager = this.packager\n const artifactPath = path.join(this.outDir, packager.expandArtifactNamePattern(this.options, target, arch, nameFormat, !isUseArchIfX64))\n\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: target,\n file: artifactPath,\n arch,\n })\n\n await unlinkIfExists(artifactPath)\n if (packager.packagerOptions.prepackaged != null) {\n await mkdir(this.outDir, { recursive: true })\n }\n\n const scripts = await this.scriptFiles\n const appInfo = packager.appInfo\n const options = this.options\n const synopsis = options.synopsis\n const args = [\n \"--architecture\",\n toLinuxArchString(arch, target),\n \"--after-install\",\n scripts[0],\n \"--after-remove\",\n scripts[1],\n \"--description\",\n smarten(target === \"rpm\" ? this.helper.getDescription(options)! : `${synopsis || \"\"}\\n ${this.helper.getDescription(options)}`),\n \"--version\",\n appInfo.version,\n \"--package\",\n artifactPath,\n ]\n\n objectToArgs(args, (await this.computeFpmMetaInfoOptions()) as any)\n\n const packageCategory = options.packageCategory\n if (packageCategory != null) {\n args.push(\"--category\", packageCategory)\n }\n\n if (target === \"deb\") {\n args.push(\"--deb-priority\", (options as DebOptions).priority ?? \"optional\")\n } else if (target === \"rpm\") {\n if (synopsis != null) {\n args.push(\"--rpm-summary\", smarten(synopsis))\n }\n }\n\n const fpmConfiguration: FpmConfiguration = {\n args,\n target,\n }\n\n if (options.compression != null) {\n fpmConfiguration.compression = options.compression\n }\n\n // noinspection JSDeprecatedSymbols\n const depends = options.depends\n if (depends != null) {\n if (Array.isArray(depends)) {\n fpmConfiguration.customDepends = depends\n } else {\n // noinspection SuspiciousTypeOfGuard\n if (typeof depends === \"string\") {\n fpmConfiguration.customDepends = [depends as string]\n } else {\n throw new Error(`depends must be Array or String, but specified as: ${depends}`)\n }\n }\n }\n\n use(packager.info.metadata.license, it => args.push(\"--license\", it))\n use(appInfo.buildNumber, it =>\n args.push(\n \"--iteration\",\n // dashes are not supported for iteration in older versions of fpm\n // https://github.com/jordansissel/fpm/issues/1833\n it.split(\"-\").join(\"_\")\n )\n )\n\n use(options.fpm, it => args.push(...it))\n\n args.push(`${appOutDir}/=${installPrefix}/${appInfo.sanitizedProductName}`)\n for (const icon of await this.helper.icons) {\n const extWithDot = path.extname(icon.file)\n const sizeName = extWithDot === \".svg\" ? \"scalable\" : `${icon.size}x${icon.size}`\n args.push(`${icon.file}=/usr/share/icons/hicolor/${sizeName}/apps/${packager.executableName}${extWithDot}`)\n }\n\n const mimeTypeFilePath = await this.helper.mimeTypeFiles\n if (mimeTypeFilePath != null) {\n args.push(`${mimeTypeFilePath}=/usr/share/mime/packages/${packager.executableName}.xml`)\n }\n\n const desktopFilePath = await this.helper.writeDesktopEntry(this.options)\n args.push(`${desktopFilePath}=/usr/share/applications/${packager.executableName}.desktop`)\n\n if (packager.packagerOptions.effectiveOptionComputed != null && (await packager.packagerOptions.effectiveOptionComputed([args, desktopFilePath]))) {\n return\n }\n\n const env = {\n ...process.env,\n SZA_PATH: path7za,\n SZA_COMPRESSION_LEVEL: packager.compression === \"store\" ? \"0\" : \"9\",\n }\n\n // rpmbuild wants directory rpm with some default config files. Even if we can use dylibbundler, path to such config files are not changed (we need to replace in the binary)\n // so, for now, brew install rpm is still required.\n if (target !== \"rpm\" && (await isMacOsSierra())) {\n const linuxToolsPath = await getLinuxToolsPath()\n Object.assign(env, {\n PATH: computeEnv(process.env.PATH, [path.join(linuxToolsPath, \"bin\")]),\n DYLD_LIBRARY_PATH: computeEnv(process.env.DYLD_LIBRARY_PATH, [path.join(linuxToolsPath, \"lib\")]),\n })\n }\n\n await executeAppBuilder([\"fpm\", \"--configuration\", JSON.stringify(fpmConfiguration)], undefined, { env })\n\n await packager.dispatchArtifactCreated(artifactPath, this, arch)\n }\n}\n\ninterface FpmConfiguration {\n target: string\n args: Array<string>\n customDepends?: Array<string>\n compression?: string | null\n}\n\nasync function writeConfigFile(tmpDir: TmpDir, templatePath: string, options: any): Promise<string> {\n //noinspection JSUnusedLocalSymbols\n function replacer(match: string, p1: string) {\n if (p1 in options) {\n return options[p1]\n } else {\n throw new Error(`Macro ${p1} is not defined`)\n }\n }\n const config = (await readFile(templatePath, \"utf8\")).replace(/\\${([a-zA-Z]+)}/g, replacer).replace(/<%=([a-zA-Z]+)%>/g, (match, p1) => {\n log.warn(\"<%= varName %> is deprecated, please use ${varName} instead\")\n return replacer(match, p1.trim())\n })\n\n const outputPath = await tmpDir.getTempFile({ suffix: path.basename(templatePath, \".tpl\") })\n await outputFile(outputPath, config)\n return outputPath\n}\n"]}
|
package/out/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "23.
|
|
1
|
+
export declare const PACKAGE_VERSION = "23.5.0";
|
package/out/version.js
CHANGED
package/out/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"23.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"23.5.0\"\n"]}
|
package/out/winPackager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"winPackager.js","sourceRoot":"","sources":["../src/winPackager.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,+CAAoG;AACpG,+DAA8C;AAC9C,4CAAgF;AAChF,mCAAmC;AACnC,0CAAqC;AACrC,8BAA6B;AAC7B,uCAA+B;AAC/B,6BAA4B;AAC5B,kDAAyD;AACzD,gEASmC;AAEnC,iCAAqD;AAGrD,yDAAoE;AAEpE,0DAAsD;AACtD,sDAA6E;AAC7E,0EAAsE;AACtE,2DAA4D;AAC5D,sDAA+D;AAC/D,wCAAkD;AAClD,wCAAmC;AACnC,gCAAiD;AACjD,iCAAiC;AAEjC,MAAa,WAAY,SAAQ,mCAAsC;IA2FrE,YAAY,IAAc;QACxB,KAAK,CAAC,IAAI,EAAE,eAAQ,CAAC,OAAO,CAAC,CAAA;QA3FtB,YAAO,GAAG,IAAI,eAAI,CAAwD,GAAG,EAAE;YACtF,MAAM,4BAA4B,GAAG,IAAI,CAAC,4BAA4B,CAAA;YACtE,IAAI,4BAA4B,CAAC,sBAAsB,IAAI,IAAI,IAAI,4BAA4B,CAAC,eAAe,IAAI,IAAI,EAAE;gBACvH,OAAO,IAAI,CAAC,EAAE,CAAC,KAAK;qBACjB,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,6CAA2B,CAAC,4BAA4B,EAAE,EAAE,CAAC,CAAC;qBACzE,KAAK,CAAC,CAAC,CAAC,EAAE;oBACT,kEAAkE;oBAClE,IAAI,4BAA4B,CAAC,IAAI,IAAI,IAAI,EAAE;wBAC7C,MAAM,CAAC,CAAA;qBACR;yBAAM;wBACL,kBAAG,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,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AAC,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QACtH,MAAM,sBAAe,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAA;IAC7F,CAAC;CACF;AA7WD,kCA6WC","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, asArray, InvalidConfigurationError, log, use, executeAppBuilder } from \"builder-util\"\nimport { parseDn } from \"builder-util-runtime\"\nimport { CopyFileTransformer, FileTransformer, walk } from \"builder-util/out/fs\"\nimport { createHash } from \"crypto\"\nimport { readdir } from \"fs/promises\"\nimport * as isCI from \"is-ci\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { downloadCertificate } from \"./codeSign/codesign\"\nimport {\n CertificateFromStoreInfo,\n CertificateInfo,\n FileCodeSigningInfo,\n getCertificateFromStoreInfo,\n getCertInfo,\n getSignVendorPath,\n sign,\n WindowsSignOptions,\n} from \"./codeSign/windowsCodeSign\"\nimport { AfterPackContext } from \"./configuration\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { RequestedExecutionLevel, WindowsConfiguration } from \"./options/winOptions\"\nimport { Packager } from \"./packager\"\nimport { chooseNotNull, PlatformPackager } from \"./platformPackager\"\nimport AppXTarget from \"./targets/AppxTarget\"\nimport { NsisTarget } from \"./targets/nsis/NsisTarget\"\nimport { AppPackageHelper, CopyElevateHelper } from \"./targets/nsis/nsisUtil\"\nimport { WebInstallerTarget } from \"./targets/nsis/WebInstallerTarget\"\nimport { createCommonTarget } from \"./targets/targetFactory\"\nimport { BuildCacheManager, digest } from \"./util/cacheManager\"\nimport { isBuildCacheEnabled } from \"./util/flags\"\nimport { time } from \"./util/timer\"\nimport { getWindowsVm, VmManager } from \"./vm/vm\"\nimport { execWine } from \"./wine\"\n\nexport class WinPackager extends PlatformPackager<WindowsConfiguration> {\n readonly cscInfo = new Lazy<FileCodeSigningInfo | CertificateFromStoreInfo | null>(() => {\n const platformSpecificBuildOptions = this.platformSpecificBuildOptions\n if (platformSpecificBuildOptions.certificateSubjectName != null || platformSpecificBuildOptions.certificateSha1 != null) {\n return this.vm.value\n .then(vm => getCertificateFromStoreInfo(platformSpecificBuildOptions, vm))\n .catch(e => {\n // https://github.com/electron-userland/electron-builder/pull/2397\n if (platformSpecificBuildOptions.sign == null) {\n throw e\n } else {\n log.debug({ error: e }, \"getCertificateFromStoreInfo error\")\n return null\n }\n })\n }\n\n const certificateFile = platformSpecificBuildOptions.certificateFile\n if (certificateFile != null) {\n const certificatePassword = this.getCscPassword()\n return Promise.resolve({\n file: certificateFile,\n password: certificatePassword == null ? null : certificatePassword.trim(),\n })\n }\n\n const cscLink = this.getCscLink(\"WIN_CSC_LINK\")\n if (cscLink == null) {\n return Promise.resolve(null)\n }\n\n return (\n downloadCertificate(cscLink, this.info.tempDirManager, this.projectDir)\n // before then\n .catch(e => {\n if (e instanceof InvalidConfigurationError) {\n throw new InvalidConfigurationError(`Env WIN_CSC_LINK is not correct, cannot resolve: ${e.message}`)\n } else {\n throw e\n }\n })\n .then(path => {\n return {\n file: path,\n password: this.getCscPassword(),\n }\n })\n )\n })\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"ico\"))\n\n readonly vm = new Lazy<VmManager>(() => (process.platform === \"win32\" ? Promise.resolve(new VmManager()) : getWindowsVm(this.debugLogger)))\n\n readonly computedPublisherName = new Lazy<Array<string> | null>(async () => {\n const publisherName = this.platformSpecificBuildOptions.publisherName\n if (publisherName === null) {\n return null\n } else if (publisherName != null) {\n return asArray(publisherName)\n }\n\n const certInfo = await this.lazyCertInfo.value\n return certInfo == null ? null : [certInfo.commonName]\n })\n\n readonly lazyCertInfo = new Lazy<CertificateInfo | null>(async () => {\n const cscInfo = await this.cscInfo.value\n if (cscInfo == null) {\n return null\n }\n\n if (\"subject\" in cscInfo) {\n const bloodyMicrosoftSubjectDn = cscInfo.subject\n return {\n commonName: parseDn(bloodyMicrosoftSubjectDn).get(\"CN\")!,\n bloodyMicrosoftSubjectDn,\n }\n }\n\n const cscFile = cscInfo.file\n if (cscFile == null) {\n return null\n }\n return await getCertInfo(cscFile, cscInfo.password || \"\")\n })\n\n get isForceCodeSigningVerification(): boolean {\n return this.platformSpecificBuildOptions.verifyUpdateCodeSignature !== false\n }\n\n constructor(info: Packager) {\n super(info, Platform.WINDOWS)\n }\n\n get defaultTarget(): Array<string> {\n return [\"nsis\"]\n }\n\n protected doGetCscPassword(): string | undefined | null {\n return chooseNotNull(chooseNotNull(this.platformSpecificBuildOptions.certificatePassword, process.env.WIN_CSC_KEY_PASSWORD), super.doGetCscPassword())\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n let copyElevateHelper: CopyElevateHelper | null\n const getCopyElevateHelper = () => {\n if (copyElevateHelper == null) {\n copyElevateHelper = new CopyElevateHelper()\n }\n return copyElevateHelper\n }\n\n let helper: AppPackageHelper | null\n const getHelper = () => {\n if (helper == null) {\n helper = new AppPackageHelper(getCopyElevateHelper())\n }\n return helper\n }\n\n for (const name of targets) {\n if (name === DIR_TARGET) {\n continue\n }\n\n if (name === \"nsis\" || name === \"portable\") {\n mapper(name, outDir => new NsisTarget(this, outDir, name, getHelper()))\n } else if (name === \"nsis-web\") {\n // package file format differs from nsis target\n mapper(name, outDir => new WebInstallerTarget(this, path.join(outDir, name), name, new AppPackageHelper(getCopyElevateHelper())))\n } else {\n const targetClass: typeof NsisTarget | typeof AppXTarget | null = (() => {\n switch (name) {\n case \"squirrel\":\n try {\n return require(\"electron-builder-squirrel-windows\").default\n } catch (e) {\n throw new InvalidConfigurationError(`Module electron-builder-squirrel-windows must be installed in addition to build Squirrel.Windows: ${e.stack || e}`)\n }\n\n case \"appx\":\n return require(\"./targets/AppxTarget\").default\n\n case \"msi\":\n return require(\"./targets/MsiTarget\").default\n\n default:\n return null\n }\n })()\n\n mapper(name, outDir => (targetClass === null ? createCommonTarget(name, outDir, this) : new (targetClass as any)(this, outDir, name)))\n }\n }\n }\n\n getIconPath() {\n return this._iconPath.value\n }\n\n async sign(file: string, logMessagePrefix?: string): Promise<void> {\n const signOptions: WindowsSignOptions = {\n path: file,\n name: this.appInfo.productName,\n site: await this.appInfo.computePackageUrl(),\n options: this.platformSpecificBuildOptions,\n }\n\n const cscInfo = await this.cscInfo.value\n if (cscInfo == null) {\n if (this.platformSpecificBuildOptions.sign != null) {\n await sign(signOptions, this)\n } else if (this.forceCodeSigning) {\n throw new InvalidConfigurationError(\n `App is not signed and \"forceCodeSigning\" is set to true, please ensure that code signing configuration is correct, please see https://electron.build/code-signing`\n )\n }\n return\n }\n\n if (logMessagePrefix == null) {\n logMessagePrefix = \"signing\"\n }\n\n if (\"file\" in cscInfo) {\n log.info(\n {\n file: log.filePath(file),\n certificateFile: cscInfo.file,\n },\n logMessagePrefix\n )\n } else {\n const info = cscInfo\n log.info(\n {\n file: log.filePath(file),\n subject: info.subject,\n thumbprint: info.thumbprint,\n store: info.store,\n user: info.isLocalMachineStore ? \"local machine\" : \"current user\",\n },\n logMessagePrefix\n )\n }\n\n await this.doSign({\n ...signOptions,\n cscInfo,\n options: {\n ...this.platformSpecificBuildOptions,\n },\n })\n }\n\n private async doSign(options: WindowsSignOptions) {\n for (let i = 0; i < 3; i++) {\n try {\n await sign(options, this)\n break\n } catch (e) {\n // https://github.com/electron-userland/electron-builder/issues/1414\n const message = e.message\n if (message != null && message.includes(\"Couldn't resolve host name\")) {\n log.warn({ error: message, attempt: i + 1 }, `cannot sign`)\n continue\n }\n throw e\n }\n }\n }\n\n async signAndEditResources(file: string, arch: Arch, outDir: string, internalName?: string | null, requestedExecutionLevel?: RequestedExecutionLevel | null) {\n const appInfo = this.appInfo\n\n const files: Array<string> = []\n\n const args = [\n file,\n \"--set-version-string\",\n \"FileDescription\",\n appInfo.productName,\n \"--set-version-string\",\n \"ProductName\",\n appInfo.productName,\n \"--set-version-string\",\n \"LegalCopyright\",\n appInfo.copyright,\n \"--set-file-version\",\n appInfo.shortVersion || appInfo.buildVersion,\n \"--set-product-version\",\n appInfo.shortVersionWindows || appInfo.getVersionInWeirdWindowsForm(),\n ]\n\n if (internalName != null) {\n args.push(\"--set-version-string\", \"InternalName\", internalName, \"--set-version-string\", \"OriginalFilename\", \"\")\n }\n\n if (requestedExecutionLevel != null && requestedExecutionLevel !== \"asInvoker\") {\n args.push(\"--set-requested-execution-level\", requestedExecutionLevel)\n }\n\n use(appInfo.companyName, it => args.push(\"--set-version-string\", \"CompanyName\", it))\n use(this.platformSpecificBuildOptions.legalTrademarks, it => args.push(\"--set-version-string\", \"LegalTrademarks\", it!))\n const iconPath = await this.getIconPath()\n use(iconPath, it => {\n files.push(it)\n args.push(\"--set-icon\", it)\n })\n\n const config = this.config\n const cscInfoForCacheDigest = !isBuildCacheEnabled() || isCI || config.electronDist != null ? null : await this.cscInfo.value\n let buildCacheManager: BuildCacheManager | null = null\n // resources editing doesn't change executable for the same input and executed quickly - no need to complicate\n if (cscInfoForCacheDigest != null) {\n const cscFile = (cscInfoForCacheDigest as FileCodeSigningInfo).file\n if (cscFile != null) {\n files.push(cscFile)\n }\n\n const timer = time(\"executable cache\")\n const hash = createHash(\"sha512\")\n hash.update(config.electronVersion || \"no electronVersion\")\n hash.update(JSON.stringify(this.platformSpecificBuildOptions))\n hash.update(JSON.stringify(args))\n hash.update(this.platformSpecificBuildOptions.certificateSha1 || \"no certificateSha1\")\n hash.update(this.platformSpecificBuildOptions.certificateSubjectName || \"no subjectName\")\n\n buildCacheManager = new BuildCacheManager(outDir, file, arch)\n if (await buildCacheManager.copyIfValid(await digest(hash, files))) {\n timer.end()\n return\n }\n timer.end()\n }\n\n const timer = time(\"wine&sign\")\n // rcedit crashed of executed using wine, resourcehacker works\n if (process.platform === \"win32\" || process.platform === \"darwin\") {\n await executeAppBuilder([\"rcedit\", \"--args\", JSON.stringify(args)], undefined /* child-process */, {}, 3 /* retry three times */)\n } else if (this.info.framework.name === \"electron\") {\n const vendorPath = await getSignVendorPath()\n await execWine(path.join(vendorPath, \"rcedit-ia32.exe\"), path.join(vendorPath, \"rcedit-x64.exe\"), args)\n }\n\n await this.sign(file)\n timer.end()\n\n if (buildCacheManager != null) {\n await buildCacheManager.save()\n }\n }\n\n private isSignDlls(): boolean {\n return this.platformSpecificBuildOptions.signDlls === true\n }\n\n protected createTransformerForExtraFiles(packContext: AfterPackContext): FileTransformer | null {\n if (this.platformSpecificBuildOptions.signAndEditExecutable === false) {\n return null\n }\n\n return file => {\n if (file.endsWith(\".exe\") || (this.isSignDlls() && file.endsWith(\".dll\"))) {\n const parentDir = path.dirname(file)\n if (parentDir !== packContext.appOutDir) {\n return new CopyFileTransformer(file => this.sign(file))\n }\n }\n return null\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise<any> {\n const exeFileName = `${this.appInfo.productFilename}.exe`\n if (this.platformSpecificBuildOptions.signAndEditExecutable === false) {\n return\n }\n\n await BluebirdPromise.map(readdir(packContext.appOutDir), (file: string): any => {\n if (file === exeFileName) {\n return this.signAndEditResources(\n path.join(packContext.appOutDir, exeFileName),\n packContext.arch,\n packContext.outDir,\n path.basename(exeFileName, \".exe\"),\n this.platformSpecificBuildOptions.requestedExecutionLevel\n )\n } else if (file.endsWith(\".exe\") || (this.isSignDlls() && file.endsWith(\".dll\"))) {\n return this.sign(path.join(packContext.appOutDir, file))\n }\n return null\n })\n\n if (!isAsar) {\n return\n }\n\n const signPromise = (filepath: string[]) => {\n const outDir = path.join(packContext.appOutDir, ...filepath)\n return walk(outDir, (file, stat) => stat.isDirectory() || file.endsWith(\".exe\") || (this.isSignDlls() && file.endsWith(\".dll\")))\n }\n const filesToSign = await Promise.all([signPromise([\"resources\", \"app.asar.unpacked\"]), signPromise([\"swiftshader\"])])\n await BluebirdPromise.map(filesToSign.flat(1), file => this.sign(file), { concurrency: 4 })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"winPackager.js","sourceRoot":"","sources":["../src/winPackager.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,+CAAoG;AACpG,+DAA8C;AAC9C,4CAAgF;AAChF,mCAAmC;AACnC,0CAAqC;AACrC,8BAA6B;AAC7B,uCAA+B;AAC/B,6BAA4B;AAC5B,kDAAyD;AACzD,gEASmC;AAEnC,iCAAqD;AAGrD,yDAAoE;AAEpE,0DAAsD;AACtD,sDAA6E;AAC7E,0EAAsE;AACtE,2DAA4D;AAC5D,sDAA+D;AAC/D,wCAAkD;AAClD,wCAAmC;AACnC,gCAAiD;AACjD,iCAAiC;AAEjC,MAAa,WAAY,SAAQ,mCAAsC;IA2FrE,YAAY,IAAc;QACxB,KAAK,CAAC,IAAI,EAAE,eAAQ,CAAC,OAAO,CAAC,CAAA;QA3FtB,YAAO,GAAG,IAAI,eAAI,CAAwD,GAAG,EAAE;YACtF,MAAM,4BAA4B,GAAG,IAAI,CAAC,4BAA4B,CAAA;YACtE,IAAI,4BAA4B,CAAC,sBAAsB,IAAI,IAAI,IAAI,4BAA4B,CAAC,eAAe,IAAI,IAAI,EAAE;gBACvH,OAAO,IAAI,CAAC,EAAE,CAAC,KAAK;qBACjB,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,6CAA2B,CAAC,4BAA4B,EAAE,EAAE,CAAC,CAAC;qBACzE,KAAK,CAAC,CAAC,CAAC,EAAE;oBACT,kEAAkE;oBAClE,IAAI,4BAA4B,CAAC,IAAI,IAAI,IAAI,EAAE;wBAC7C,MAAM,CAAC,CAAA;qBACR;yBAAM;wBACL,kBAAG,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,mCAAmC,CAAC,CAAA;wBAC5D,OAAO,IAAI,CAAA;qBACZ;gBACH,CAAC,CAAC,CAAA;aACL;YAED,MAAM,eAAe,GAAG,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AAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAA;IAC7F,CAAC;CACF;AA7WD,kCA6WC","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, asArray, InvalidConfigurationError, log, use, executeAppBuilder } from \"builder-util\"\nimport { parseDn } from \"builder-util-runtime\"\nimport { CopyFileTransformer, FileTransformer, walk } from \"builder-util/out/fs\"\nimport { createHash } from \"crypto\"\nimport { readdir } from \"fs/promises\"\nimport * as isCI from \"is-ci\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { downloadCertificate } from \"./codeSign/codesign\"\nimport {\n CertificateFromStoreInfo,\n CertificateInfo,\n FileCodeSigningInfo,\n getCertificateFromStoreInfo,\n getCertInfo,\n getSignVendorPath,\n sign,\n WindowsSignOptions,\n} from \"./codeSign/windowsCodeSign\"\nimport { AfterPackContext } from \"./configuration\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { RequestedExecutionLevel, WindowsConfiguration } from \"./options/winOptions\"\nimport { Packager } from \"./packager\"\nimport { chooseNotNull, PlatformPackager } from \"./platformPackager\"\nimport AppXTarget from \"./targets/AppxTarget\"\nimport { NsisTarget } from \"./targets/nsis/NsisTarget\"\nimport { AppPackageHelper, CopyElevateHelper } from \"./targets/nsis/nsisUtil\"\nimport { WebInstallerTarget } from \"./targets/nsis/WebInstallerTarget\"\nimport { createCommonTarget } from \"./targets/targetFactory\"\nimport { BuildCacheManager, digest } from \"./util/cacheManager\"\nimport { isBuildCacheEnabled } from \"./util/flags\"\nimport { time } from \"./util/timer\"\nimport { getWindowsVm, VmManager } from \"./vm/vm\"\nimport { execWine } from \"./wine\"\n\nexport class WinPackager extends PlatformPackager<WindowsConfiguration> {\n readonly cscInfo = new Lazy<FileCodeSigningInfo | CertificateFromStoreInfo | null>(() => {\n const platformSpecificBuildOptions = this.platformSpecificBuildOptions\n if (platformSpecificBuildOptions.certificateSubjectName != null || platformSpecificBuildOptions.certificateSha1 != null) {\n return this.vm.value\n .then(vm => getCertificateFromStoreInfo(platformSpecificBuildOptions, vm))\n .catch(e => {\n // https://github.com/electron-userland/electron-builder/pull/2397\n if (platformSpecificBuildOptions.sign == null) {\n throw e\n } else {\n log.debug({ error: e }, \"getCertificateFromStoreInfo error\")\n return null\n }\n })\n }\n\n const certificateFile = platformSpecificBuildOptions.certificateFile\n if (certificateFile != null) {\n const certificatePassword = this.getCscPassword()\n return Promise.resolve({\n file: certificateFile,\n password: certificatePassword == null ? null : certificatePassword.trim(),\n })\n }\n\n const cscLink = this.getCscLink(\"WIN_CSC_LINK\")\n if (cscLink == null) {\n return Promise.resolve(null)\n }\n\n return (\n downloadCertificate(cscLink, this.info.tempDirManager, this.projectDir)\n // before then\n .catch(e => {\n if (e instanceof InvalidConfigurationError) {\n throw new InvalidConfigurationError(`Env WIN_CSC_LINK is not correct, cannot resolve: ${e.message}`)\n } else {\n throw e\n }\n })\n .then(path => {\n return {\n file: path,\n password: this.getCscPassword(),\n }\n })\n )\n })\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"ico\"))\n\n readonly vm = new Lazy<VmManager>(() => (process.platform === \"win32\" ? Promise.resolve(new VmManager()) : getWindowsVm(this.debugLogger)))\n\n readonly computedPublisherName = new Lazy<Array<string> | null>(async () => {\n const publisherName = this.platformSpecificBuildOptions.publisherName\n if (publisherName === null) {\n return null\n } else if (publisherName != null) {\n return asArray(publisherName)\n }\n\n const certInfo = await this.lazyCertInfo.value\n return certInfo == null ? null : [certInfo.commonName]\n })\n\n readonly lazyCertInfo = new Lazy<CertificateInfo | null>(async () => {\n const cscInfo = await this.cscInfo.value\n if (cscInfo == null) {\n return null\n }\n\n if (\"subject\" in cscInfo) {\n const bloodyMicrosoftSubjectDn = cscInfo.subject\n return {\n commonName: parseDn(bloodyMicrosoftSubjectDn).get(\"CN\")!,\n bloodyMicrosoftSubjectDn,\n }\n }\n\n const cscFile = cscInfo.file\n if (cscFile == null) {\n return null\n }\n return await getCertInfo(cscFile, cscInfo.password || \"\")\n })\n\n get isForceCodeSigningVerification(): boolean {\n return this.platformSpecificBuildOptions.verifyUpdateCodeSignature !== false\n }\n\n constructor(info: Packager) {\n super(info, Platform.WINDOWS)\n }\n\n get defaultTarget(): Array<string> {\n return [\"nsis\"]\n }\n\n protected doGetCscPassword(): string | undefined | null {\n return chooseNotNull(chooseNotNull(this.platformSpecificBuildOptions.certificatePassword, process.env.WIN_CSC_KEY_PASSWORD), super.doGetCscPassword())\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n let copyElevateHelper: CopyElevateHelper | null\n const getCopyElevateHelper = () => {\n if (copyElevateHelper == null) {\n copyElevateHelper = new CopyElevateHelper()\n }\n return copyElevateHelper\n }\n\n let helper: AppPackageHelper | null\n const getHelper = () => {\n if (helper == null) {\n helper = new AppPackageHelper(getCopyElevateHelper())\n }\n return helper\n }\n\n for (const name of targets) {\n if (name === DIR_TARGET) {\n continue\n }\n\n if (name === \"nsis\" || name === \"portable\") {\n mapper(name, outDir => new NsisTarget(this, outDir, name, getHelper()))\n } else if (name === \"nsis-web\") {\n // package file format differs from nsis target\n mapper(name, outDir => new WebInstallerTarget(this, path.join(outDir, name), name, new AppPackageHelper(getCopyElevateHelper())))\n } else {\n const targetClass: typeof NsisTarget | typeof AppXTarget | null = (() => {\n switch (name) {\n case \"squirrel\":\n try {\n return require(\"electron-builder-squirrel-windows\").default\n } catch (e) {\n throw new InvalidConfigurationError(`Module electron-builder-squirrel-windows must be installed in addition to build Squirrel.Windows: ${e.stack || e}`)\n }\n\n case \"appx\":\n return require(\"./targets/AppxTarget\").default\n\n case \"msi\":\n return require(\"./targets/MsiTarget\").default\n\n default:\n return null\n }\n })()\n\n mapper(name, outDir => (targetClass === null ? createCommonTarget(name, outDir, this) : new (targetClass as any)(this, outDir, name)))\n }\n }\n }\n\n getIconPath() {\n return this._iconPath.value\n }\n\n async sign(file: string, logMessagePrefix?: string): Promise<void> {\n const signOptions: WindowsSignOptions = {\n path: file,\n name: this.appInfo.productName,\n site: await this.appInfo.computePackageUrl(),\n options: this.platformSpecificBuildOptions,\n }\n\n const cscInfo = await this.cscInfo.value\n if (cscInfo == null) {\n if (this.platformSpecificBuildOptions.sign != null) {\n await sign(signOptions, this)\n } else if (this.forceCodeSigning) {\n throw new InvalidConfigurationError(\n `App is not signed and \"forceCodeSigning\" is set to true, please ensure that code signing configuration is correct, please see https://electron.build/code-signing`\n )\n }\n return\n }\n\n if (logMessagePrefix == null) {\n logMessagePrefix = \"signing\"\n }\n\n if (\"file\" in cscInfo) {\n log.info(\n {\n file: log.filePath(file),\n certificateFile: cscInfo.file,\n },\n logMessagePrefix\n )\n } else {\n const info = cscInfo\n log.info(\n {\n file: log.filePath(file),\n subject: info.subject,\n thumbprint: info.thumbprint,\n store: info.store,\n user: info.isLocalMachineStore ? \"local machine\" : \"current user\",\n },\n logMessagePrefix\n )\n }\n\n await this.doSign({\n ...signOptions,\n cscInfo,\n options: {\n ...this.platformSpecificBuildOptions,\n },\n })\n }\n\n private async doSign(options: WindowsSignOptions) {\n for (let i = 0; i < 3; i++) {\n try {\n await sign(options, this)\n break\n } catch (e) {\n // https://github.com/electron-userland/electron-builder/issues/1414\n const message = e.message\n if (message != null && message.includes(\"Couldn't resolve host name\")) {\n log.warn({ error: message, attempt: i + 1 }, `cannot sign`)\n continue\n }\n throw e\n }\n }\n }\n\n async signAndEditResources(file: string, arch: Arch, outDir: string, internalName?: string | null, requestedExecutionLevel?: RequestedExecutionLevel | null) {\n const appInfo = this.appInfo\n\n const files: Array<string> = []\n\n const args = [\n file,\n \"--set-version-string\",\n \"FileDescription\",\n appInfo.productName,\n \"--set-version-string\",\n \"ProductName\",\n appInfo.productName,\n \"--set-version-string\",\n \"LegalCopyright\",\n appInfo.copyright,\n \"--set-file-version\",\n appInfo.shortVersion || appInfo.buildVersion,\n \"--set-product-version\",\n appInfo.shortVersionWindows || appInfo.getVersionInWeirdWindowsForm(),\n ]\n\n if (internalName != null) {\n args.push(\"--set-version-string\", \"InternalName\", internalName, \"--set-version-string\", \"OriginalFilename\", \"\")\n }\n\n if (requestedExecutionLevel != null && requestedExecutionLevel !== \"asInvoker\") {\n args.push(\"--set-requested-execution-level\", requestedExecutionLevel)\n }\n\n use(appInfo.companyName, it => args.push(\"--set-version-string\", \"CompanyName\", it))\n use(this.platformSpecificBuildOptions.legalTrademarks, it => args.push(\"--set-version-string\", \"LegalTrademarks\", it))\n const iconPath = await this.getIconPath()\n use(iconPath, it => {\n files.push(it)\n args.push(\"--set-icon\", it)\n })\n\n const config = this.config\n const cscInfoForCacheDigest = !isBuildCacheEnabled() || isCI || config.electronDist != null ? null : await this.cscInfo.value\n let buildCacheManager: BuildCacheManager | null = null\n // resources editing doesn't change executable for the same input and executed quickly - no need to complicate\n if (cscInfoForCacheDigest != null) {\n const cscFile = (cscInfoForCacheDigest as FileCodeSigningInfo).file\n if (cscFile != null) {\n files.push(cscFile)\n }\n\n const timer = time(\"executable cache\")\n const hash = createHash(\"sha512\")\n hash.update(config.electronVersion || \"no electronVersion\")\n hash.update(JSON.stringify(this.platformSpecificBuildOptions))\n hash.update(JSON.stringify(args))\n hash.update(this.platformSpecificBuildOptions.certificateSha1 || \"no certificateSha1\")\n hash.update(this.platformSpecificBuildOptions.certificateSubjectName || \"no subjectName\")\n\n buildCacheManager = new BuildCacheManager(outDir, file, arch)\n if (await buildCacheManager.copyIfValid(await digest(hash, files))) {\n timer.end()\n return\n }\n timer.end()\n }\n\n const timer = time(\"wine&sign\")\n // rcedit crashed of executed using wine, resourcehacker works\n if (process.platform === \"win32\" || process.platform === \"darwin\") {\n await executeAppBuilder([\"rcedit\", \"--args\", JSON.stringify(args)], undefined /* child-process */, {}, 3 /* retry three times */)\n } else if (this.info.framework.name === \"electron\") {\n const vendorPath = await getSignVendorPath()\n await execWine(path.join(vendorPath, \"rcedit-ia32.exe\"), path.join(vendorPath, \"rcedit-x64.exe\"), args)\n }\n\n await this.sign(file)\n timer.end()\n\n if (buildCacheManager != null) {\n await buildCacheManager.save()\n }\n }\n\n private isSignDlls(): boolean {\n return this.platformSpecificBuildOptions.signDlls === true\n }\n\n protected createTransformerForExtraFiles(packContext: AfterPackContext): FileTransformer | null {\n if (this.platformSpecificBuildOptions.signAndEditExecutable === false) {\n return null\n }\n\n return file => {\n if (file.endsWith(\".exe\") || (this.isSignDlls() && file.endsWith(\".dll\"))) {\n const parentDir = path.dirname(file)\n if (parentDir !== packContext.appOutDir) {\n return new CopyFileTransformer(file => this.sign(file))\n }\n }\n return null\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise<any> {\n const exeFileName = `${this.appInfo.productFilename}.exe`\n if (this.platformSpecificBuildOptions.signAndEditExecutable === false) {\n return\n }\n\n await BluebirdPromise.map(readdir(packContext.appOutDir), (file: string): any => {\n if (file === exeFileName) {\n return this.signAndEditResources(\n path.join(packContext.appOutDir, exeFileName),\n packContext.arch,\n packContext.outDir,\n path.basename(exeFileName, \".exe\"),\n this.platformSpecificBuildOptions.requestedExecutionLevel\n )\n } else if (file.endsWith(\".exe\") || (this.isSignDlls() && file.endsWith(\".dll\"))) {\n return this.sign(path.join(packContext.appOutDir, file))\n }\n return null\n })\n\n if (!isAsar) {\n return\n }\n\n const signPromise = (filepath: string[]) => {\n const outDir = path.join(packContext.appOutDir, ...filepath)\n return walk(outDir, (file, stat) => stat.isDirectory() || file.endsWith(\".exe\") || (this.isSignDlls() && file.endsWith(\".dll\")))\n }\n const filesToSign = await Promise.all([signPromise([\"resources\", \"app.asar.unpacked\"]), signPromise([\"swiftshader\"])])\n await BluebirdPromise.map(filesToSign.flat(1), file => this.sign(file), { concurrency: 4 })\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "app-builder-lib",
|
|
3
3
|
"description": "electron-builder lib",
|
|
4
|
-
"version": "23.
|
|
4
|
+
"version": "23.5.0",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"out",
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"@malept/flatpak-bundler": "^0.4.0",
|
|
54
54
|
"async-exit-hook": "^2.0.1",
|
|
55
55
|
"bluebird-lst": "^1.0.9",
|
|
56
|
-
"builder-util": "23.
|
|
57
|
-
"builder-util-runtime": "9.1.
|
|
56
|
+
"builder-util": "23.5.0",
|
|
57
|
+
"builder-util-runtime": "9.1.1",
|
|
58
58
|
"chromium-pickle-js": "^0.2.0",
|
|
59
59
|
"debug": "^4.3.4",
|
|
60
60
|
"ejs": "^3.1.7",
|
|
61
61
|
"electron-osx-sign": "^0.6.0",
|
|
62
|
-
"electron-publish": "23.
|
|
62
|
+
"electron-publish": "23.5.0",
|
|
63
63
|
"form-data": "^4.0.0",
|
|
64
64
|
"fs-extra": "^10.1.0",
|
|
65
65
|
"hosted-git-info": "^4.1.0",
|
|
@@ -103,8 +103,8 @@
|
|
|
103
103
|
"@types/js-yaml": "4.0.3",
|
|
104
104
|
"@types/semver": "7.3.8",
|
|
105
105
|
"@types/tar": "^6.1.1",
|
|
106
|
-
"dmg-builder": "23.
|
|
107
|
-
"electron-builder-squirrel-windows": "23.
|
|
106
|
+
"dmg-builder": "23.5.0",
|
|
107
|
+
"electron-builder-squirrel-windows": "23.5.0"
|
|
108
108
|
},
|
|
109
109
|
"//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)",
|
|
110
110
|
"typings": "./out/index.d.ts"
|
package/scheme.json
CHANGED
|
@@ -2404,14 +2404,14 @@
|
|
|
2404
2404
|
]
|
|
2405
2405
|
},
|
|
2406
2406
|
"entitlements": {
|
|
2407
|
-
"description": "The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\nMAS entitlements is specified in the [mas](/configuration/mas).",
|
|
2407
|
+
"description": "The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\nMAS entitlements is specified in the [mas](/configuration/mas).\nSee [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\nBe aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\nSee [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.",
|
|
2408
2408
|
"type": [
|
|
2409
2409
|
"null",
|
|
2410
2410
|
"string"
|
|
2411
2411
|
]
|
|
2412
2412
|
},
|
|
2413
2413
|
"entitlementsInherit": {
|
|
2414
|
-
"description": "The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\
|
|
2414
|
+
"description": "The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\nSee [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n\nThis option only applies when signing with `entitlements` provided.",
|
|
2415
2415
|
"type": [
|
|
2416
2416
|
"null",
|
|
2417
2417
|
"string"
|
|
@@ -3022,14 +3022,14 @@
|
|
|
3022
3022
|
]
|
|
3023
3023
|
},
|
|
3024
3024
|
"entitlements": {
|
|
3025
|
-
"description": "The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\
|
|
3025
|
+
"description": "The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\nSee [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\nBe aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\nSee [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.",
|
|
3026
3026
|
"type": [
|
|
3027
3027
|
"null",
|
|
3028
3028
|
"string"
|
|
3029
3029
|
]
|
|
3030
3030
|
},
|
|
3031
3031
|
"entitlementsInherit": {
|
|
3032
|
-
"description": "The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\
|
|
3032
|
+
"description": "The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\nSee [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.",
|
|
3033
3033
|
"type": [
|
|
3034
3034
|
"null",
|
|
3035
3035
|
"string"
|
|
@@ -6315,8 +6315,15 @@
|
|
|
6315
6315
|
"description": "Whether to build the application native dependencies from source.",
|
|
6316
6316
|
"type": "boolean"
|
|
6317
6317
|
},
|
|
6318
|
+
"buildNumber": {
|
|
6319
|
+
"description": "The build number. Maps to the `--iteration` flag for builds using FPM on Linux.\nIf not defined, then it will fallback to `BUILD_NUMBER` or `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_BUILDNUMBER` or `CI_PIPELINE_IID` env.",
|
|
6320
|
+
"type": [
|
|
6321
|
+
"null",
|
|
6322
|
+
"string"
|
|
6323
|
+
]
|
|
6324
|
+
},
|
|
6318
6325
|
"buildVersion": {
|
|
6319
|
-
"description": "The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`.\nIf `
|
|
6326
|
+
"description": "The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`.\nIf `buildVersion` is not defined and `buildNumber` (or one of the `buildNumber` envs) is defined, it will be used as a build version (`version.buildNumber`).",
|
|
6320
6327
|
"type": [
|
|
6321
6328
|
"null",
|
|
6322
6329
|
"string"
|