diff --git a/.idea/dictionaries/develar.xml b/.idea/dictionaries/develar.xml index 63aed6f8c70..fe554bc3971 100644 --- a/.idea/dictionaries/develar.xml +++ b/.idea/dictionaries/develar.xml @@ -3,6 +3,7 @@ actperepo appimage + appleid appveyor archs aspx @@ -38,6 +39,7 @@ hicolor hrtime icnsutils + idms inno installmode instdir diff --git a/.idea/runConfigurations/CodeSignTest.xml b/.idea/runConfigurations/CodeSignTest.xml index e1dd0167fee..f0946aeda3c 100644 --- a/.idea/runConfigurations/CodeSignTest.xml +++ b/.idea/runConfigurations/CodeSignTest.xml @@ -1,5 +1,5 @@ - + diff --git a/docs/Code Signing.md b/docs/Code Signing.md index 738fe37549b..2d07c4b21b6 100644 --- a/docs/Code Signing.md +++ b/docs/Code Signing.md @@ -1,14 +1,12 @@ -MacOS and Windows code signing is supported. Windows is dual code-signed (SHA1 & SHA256 hashing algorithms). +macOS and Windows code signing is supported. Windows is dual code-signed (SHA1 & SHA256 hashing algorithms). -On a MacOS development machine valid and appropriate identity from your keychain will be automatically used. +On a macOS development machine valid and appropriate identity from your keychain will be automatically used. | Env name | Description | -------------- | ----------- -| `CSC_LINK` | The HTTPS link (or base64-encoded data) to certificate (`*.p12` file). +| `CSC_LINK` | The HTTPS link (or base64-encoded data, or `file://` link) to certificate (`*.p12` file). | `CSC_KEY_PASSWORD` | The password to decrypt the certificate given in `CSC_LINK`. -| `CSC_INSTALLER_LINK` | *osx-only* The HTTPS link (or base64-encoded data) to certificate to sign Mac App Store build (`*.p12` file). -| `CSC_INSTALLER_KEY_PASSWORD` | *osx-only* The password to decrypt the certificate given in `CSC_INSTALLER_LINK`. -| `CSC_NAME` | *osx-only* Name of certificate (to retrieve from login.keychain). Useful on a development machine (not on CI) if you have several identities (otherwise don't specify it). +| `CSC_NAME` | *macOS-only* Name of certificate (to retrieve from login.keychain). Useful on a development machine (not on CI) if you have several identities (otherwise don't specify it). ## Travis, AppVeyor and other CI Servers To sign app on build server you need to set `CSC_LINK`, `CSC_KEY_PASSWORD` (and `CSC_INSTALLER_LINK`, `CSC_INSTALLER_KEY_PASSWORD` if you build for Mac App Store): @@ -26,4 +24,16 @@ To sign app on build server you need to set `CSC_LINK`, `CSC_KEY_PASSWORD` (and # Where to Buy Code Signing Certificate [StartSSL](https://startssl.com/Support?v=34) is recommended. -Please note — Gatekeeper only recognises [Apple digital certificates](http://stackoverflow.com/questions/11833481/non-apple-issued-code-signing-certificate-can-it-work-with-mac-os-10-8-gatekeep). \ No newline at end of file +Please note — Gatekeeper only recognises [Apple digital certificates](http://stackoverflow.com/questions/11833481/non-apple-issued-code-signing-certificate-can-it-work-with-mac-os-10-8-gatekeep). + +# How to Export Certificate on macOS + +1. Open Keychain. +2. Select `login` keychain, and `My Certificates` category. +3. Select all required certificates (hint: use cmd-click to select several): + * `Developer ID Application:` to sign app for macOS. + * `3rd Party Mac Developer Application:` and `3rd Party Mac Developer Installer:` to sign app for MAS (Mac App Store). + + Please note – you can select as many certificates, as need. No restrictions on electron-builder side. + All selected certificates will be imported into temporary keychain on CI server. +4. Open context menu and `Export`. \ No newline at end of file diff --git a/docs/Options.md b/docs/Options.md index 1660b6c1427..52beb1322a8 100644 --- a/docs/Options.md +++ b/docs/Options.md @@ -51,7 +51,7 @@ Here documented only `electron-builder` specific options: | Name | Description | --- | --- | appId |

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 [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows.

For windows only NSIS target supports it. Squirrel.Windows is not fixed yet.

Defaults to com.electron.${name}. It is strongly recommended that an explicit ID be set.

-| app-category-type |

*MacOS-only.* The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.

For example, app-category-type=public.app-category.developer-tools will set the application category to *Developer Tools*.

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).

+| app-category-type |

*macOS-only.* The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.

For example, app-category-type=public.app-category.developer-tools will set the application category to *Developer Tools*.

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).

| asar |

Whether to package the application’s source code into an archive, using [Electron’s archive format](https://github.com/electron/asar). Defaults to true. Reasons why you may want to disable this feature are described in [an application packaging tutorial in Electron’s documentation](http://electron.atom.io/docs/latest/tutorial/application-packaging/#limitations-on-node-api/).

Or you can pass object of any asar options.

| productName | See [AppMetadata.productName](#AppMetadata-productName). | files |

A [glob patterns](https://www.npmjs.com/package/glob#glob-primer) relative to the [app directory](#MetadataDirectories-app), which specifies which files to include when copying files to create the package. Defaults to \*\*\/\* (i.e. [hidden files are ignored by default](https://www.npmjs.com/package/glob#dots)).

Development dependencies are never copied in any case. You don’t need to ignore it explicitly.

[Multiple patterns](#multiple-glob-patterns) are supported. You can use ${os} (expanded to mac, linux or win according to current platform) and ${arch} in the pattern. If directory matched, all contents are copied. So, you can just specify foo to copy foo directory.

Remember that default pattern \*\*\/\* is not added to your custom, so, you have to add it explicitly — e.g. ["\*\*\/\*", "!ignoreMe${/\*}"].

May be specified in the platform options (e.g. in the build.mac).

@@ -76,8 +76,8 @@ MacOS specific build options. | target | Target package type: list of `default`, `dmg`, `mas`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`. Defaults to `default` (dmg and zip for Squirrel.Mac). | identity |

The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](https://github.com/electron-userland/electron-builder/wiki/Code-Signing). MAS installer identity is specified in the [.build.mas](#MasBuildOptions-identity).

| icon | The path to application icon. Defaults to `build/icon.icns` (consider using this convention instead of complicating your configuration). -| entitlements |

The path to entitlements file for signing the app. build/entitlements.osx.plist will be used if exists (it is a recommended way to set). MAS entitlements is specified in the [.build.mas](#MasBuildOptions-entitlements).

-| entitlementsInherit |

The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. build/entitlements.osx.inherit.plist will be used if exists (it is a recommended way to set). Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.darwin.inherit.plist).

This option only applies when signing with entitlements provided.

+| entitlements |

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). MAS entitlements is specified in the [.build.mas](#MasBuildOptions-entitlements).

+| entitlementsInherit |

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). Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.darwin.inherit.plist).

This option only applies when signing with entitlements provided.

### `.build.dmg` diff --git a/package.json b/package.json index 86ae0b00821..126c147404b 100644 --- a/package.json +++ b/package.json @@ -65,8 +65,7 @@ "chalk": "^1.1.3", "cli-cursor": "^1.0.2", "debug": "^2.2.0", - "deep-assign": "^2.0.0", - "electron-osx-sign-tf": "0.6.0", + "electron-osx-sign": "^0.4.0-beta4", "electron-packager-tf": "~7.5.2", "electron-winstaller-fixed": "~2.11.6", "fs-extra-p": "^1.0.5", diff --git a/src/codeSign.ts b/src/codeSign.ts index 76147a46f02..dd8a5f0ede5 100644 --- a/src/codeSign.ts +++ b/src/codeSign.ts @@ -1,4 +1,4 @@ -import { exec, getTempName } from "./util/util" +import { exec, getTempName, isEmptyOrSpaces } from "./util/util" import { deleteFile, outputFile, copy, rename } from "fs-extra-p" import { download } from "./util/httpRequest" import { tmpdir } from "os" @@ -11,27 +11,30 @@ import { homedir } from "os" //noinspection JSUnusedLocalSymbols const __awaiter = require("./util/awaiter") -export const appleCertificatePrefixes = ["Developer ID Application:", "3rd Party Mac Developer Application:", "Developer ID Installer:", "3rd Party Mac Developer Installer:"] +const appleCertificatePrefixes = ["Developer ID Application:", "3rd Party Mac Developer Application:", "Developer ID Installer:", "3rd Party Mac Developer Installer:"] export type CertType = "Developer ID Application" | "3rd Party Mac Developer Application" | "Developer ID Installer" | "3rd Party Mac Developer Installer" export interface CodeSigningInfo { - name: string keychainName?: string | null - - installerName?: string | null } export function generateKeychainName(): string { return path.join(tmpdir(), getTempName("csc") + ".keychain") } -function downloadUrlOrBase64(urlOrBase64: string, destination: string): BluebirdPromise { +export function downloadCertificate(urlOrBase64: string): BluebirdPromise { + const tempFile = path.join(tmpdir(), `${getTempName()}.p12`) if (urlOrBase64.startsWith("https://")) { - return download(urlOrBase64, destination) + return download(urlOrBase64, tempFile) + .thenReturn(tempFile) + } + else if (urlOrBase64.startsWith("file://")) { + return BluebirdPromise.resolve(urlOrBase64.substring("file://".length)) } else { - return outputFile(destination, new Buffer(urlOrBase64, "base64")) + return outputFile(tempFile, new Buffer(urlOrBase64, "base64")) + .thenReturn(tempFile) } } @@ -77,11 +80,7 @@ export async function createKeychain(keychainName: string, cscLink: string, cscK const certPaths = new Array(certLinks.length) const keychainPassword = randomBytes(8).toString("hex") return await executeFinally(BluebirdPromise.all([ - BluebirdPromise.map(certLinks, (link, i) => { - const tempFile = path.join(tmpdir(), `${getTempName()}.p12`) - certPaths[i] = tempFile - return downloadUrlOrBase64(link, tempFile) - }), + BluebirdPromise.map(certLinks, (link, i) => downloadCertificate(link).then(it => certPaths[i] = it)), BluebirdPromise.mapSeries([ ["create-keychain", "-p", keychainPassword, keychainName], ["unlock-keychain", "-p", keychainPassword, keychainName], @@ -90,7 +89,7 @@ export async function createKeychain(keychainName: string, cscLink: string, cscK ]) .then(() => importCerts(keychainName, certPaths, >[cscKeyPassword, cscIKeyPassword].filter(it => it != null))), errorOccurred => { - const tasks = certPaths.map(it => deleteFile(it, true)) + const tasks = certPaths.map((it, index) => certLinks[index].startsWith("file://") ? BluebirdPromise.resolve() : deleteFile(it, true)) if (errorOccurred) { tasks.push(deleteKeychain(keychainName)) } @@ -99,40 +98,19 @@ export async function createKeychain(keychainName: string, cscLink: string, cscK } async function importCerts(keychainName: string, paths: Array, keyPasswords: Array): Promise { - const namePromises: Array> = [] for (let i = 0; i < paths.length; i++) { - const password = keyPasswords[i] - const certPath = paths[i] - await exec("security", ["import", certPath, "-k", keychainName, "-T", "/usr/bin/codesign", "-T", "/usr/bin/productbuild", "-P", password]) - - namePromises.push(extractCommonName(password, certPath)) + await exec("security", ["import", paths[i], "-k", keychainName, "-T", "/usr/bin/codesign", "-T", "/usr/bin/productbuild", "-P", keyPasswords[i]]) } - const names = await BluebirdPromise.all(namePromises) return { - name: names[0], - installerName: names.length > 1 ? names[1] : null, keychainName: keychainName, } } -function extractCommonName(password: string, certPath: string): BluebirdPromise { - return exec("openssl", ["pkcs12", "-nokeys", "-nodes", "-passin", "pass:" + password, "-nomacver", "-clcerts", "-in", certPath]) - .then(result => { - const match = | null>(result.match(/^subject.*\/CN=([^\/\n]+)/m)) - if (match == null || match[1] == null) { - throw new Error("Cannot extract common name from p12") - } - else { - return match[1]! - } - }) -} - -export function sign(path: string, options: CodeSigningInfo): BluebirdPromise { - const args = ["--deep", "--force", "--sign", options.name, path] - if (options.keychainName != null) { - args.push("--keychain", options.keychainName) +export function sign(path: string, name: string, keychain: string): BluebirdPromise { + const args = ["--deep", "--force", "--sign", name, path] + if (keychain != null) { + args.push("--keychain", keychain) } return exec("codesign", args) } @@ -151,20 +129,22 @@ export function deleteKeychain(keychainName: string, ignoreNotFound: boolean = t } } -export function downloadCertificate(cscLink: string): Promise { - const certPath = path.join(tmpdir(), `${getTempName()}.p12`) - return downloadUrlOrBase64(cscLink, certPath) - .thenReturn(certPath) -} - export let findIdentityRawResult: Promise> | null = null -export async function findIdentity(namePrefix: CertType, qualifier?: string): Promise { - if (findIdentityRawResult == null) { +async function getValidIdentities(keychain?: string | null): Promise> { + function addKeychain(args: Array) { + if (keychain != null) { + args.push(keychain) + } + return args + } + + let result = findIdentityRawResult + if (result == null || keychain != null) { // https://github.com/electron-userland/electron-builder/issues/481 // https://github.com/electron-userland/electron-builder/issues/535 - findIdentityRawResult = BluebirdPromise.all>([ - exec("security", ["find-identity", "-v"]) + result = BluebirdPromise.all>([ + exec("security", addKeychain(["find-identity", "-v"])) .then(it => it.trim().split("\n").filter(it => { for (let prefix of appleCertificatePrefixes) { if (it.includes(prefix)) { @@ -173,7 +153,7 @@ export async function findIdentity(namePrefix: CertType, qualifier?: string): Pr } return false })), - exec("security", ["find-identity", "-v", "-p", "codesigning"]) + exec("security", addKeychain(["find-identity", "-v", "-p", "codesigning"])) .then(it => it.trim().split(("\n"))), ]) .then(it => { @@ -183,11 +163,18 @@ export async function findIdentity(namePrefix: CertType, qualifier?: string): Pr .map(it => it.substring(it.indexOf(")") + 1).trim()) return Array.from(new Set(array)) }) + + if (keychain == null) { + findIdentityRawResult = result + } } + return result +} +async function _findIdentity(namePrefix: CertType, qualifier?: string | null, keychain?: string | null): Promise { // https://github.com/electron-userland/electron-builder/issues/484 //noinspection SpellCheckingInspection - const lines = await findIdentityRawResult + const lines = await getValidIdentities(keychain) for (let line of lines) { if (qualifier != null && !line.includes(qualifier)) { continue @@ -216,4 +203,31 @@ export async function findIdentity(namePrefix: CertType, qualifier?: string): Pr } } return null +} + +export async function findIdentity(certType: CertType, qualifier?: string | null, keychain?: string | null): Promise { + let identity = process.env.CSC_NAME || qualifier + if (isEmptyOrSpaces(identity)) { + if (keychain == null && process.env.CI == null && process.env.CSC_IDENTITY_AUTO_DISCOVERY === "false") { + return null + } + return await _findIdentity(certType, null, keychain) + } + else { + identity = identity.trim() + for (let prefix of appleCertificatePrefixes) { + checkPrefix(identity, prefix) + } + const result = await _findIdentity(certType, identity, keychain) + if (result == null) { + throw new Error(`Identity name "${identity}" is specified, but no valid identity with this name in the keychain`) + } + return result + } +} + +function checkPrefix(name: string, prefix: string) { + if (name.startsWith(prefix)) { + throw new Error(`Please remove prefix "${prefix}" from the specified name — appropriate certificate will be chosen automatically`) + } } \ No newline at end of file diff --git a/src/macPackager.ts b/src/macPackager.ts index 817775f4ff5..6f1a3fe9767 100644 --- a/src/macPackager.ts +++ b/src/macPackager.ts @@ -2,11 +2,10 @@ import { PlatformPackager, BuildInfo, Target } from "./platformPackager" import { Platform, MasBuildOptions, Arch, MacOptions } from "./metadata" import * as path from "path" import { Promise as BluebirdPromise } from "bluebird" -import { isEmptyOrSpaces } from "./util/util" import { log, warn, task } from "./util/log" -import { createKeychain, deleteKeychain, CodeSigningInfo, generateKeychainName, findIdentity, appleCertificatePrefixes, CertType } from "./codeSign" -import deepAssign = require("deep-assign") -import { signAsync, flatAsync, BaseSignOptions, SignOptions, FlatOptions } from "electron-osx-sign-tf" +import { createKeychain, deleteKeychain, CodeSigningInfo, generateKeychainName, findIdentity } from "./codeSign" +import { deepAssign } from "./util/deepAssign" +import { signAsync, flatAsync, BaseSignOptions, SignOptions, FlatOptions } from "electron-osx-sign" import { DmgTarget } from "./targets/dmg" import { createCommonTarget, DEFAULT_TARGET } from "./targets/targetFactory" @@ -14,13 +13,13 @@ import { createCommonTarget, DEFAULT_TARGET } from "./targets/targetFactory" const __awaiter = require("./util/awaiter") export default class MacPackager extends PlatformPackager { - codeSigningInfo: Promise + codeSigningInfo: Promise constructor(info: BuildInfo, cleanupTasks: Array<() => Promise>) { super(info) if (this.options.cscLink == null) { - this.codeSigningInfo = BluebirdPromise.resolve(null) + this.codeSigningInfo = BluebirdPromise.resolve({}) } else { const keychainName = generateKeychainName() @@ -97,83 +96,43 @@ export default class MacPackager extends PlatformPackager { } } - private static async findIdentity(certType: CertType, name?: string | null): Promise { - let identity = process.env.CSC_NAME || name - if (isEmptyOrSpaces(identity)) { - if (process.env.CSC_IDENTITY_AUTO_DISCOVERY === "false") { - return null - } - return await findIdentity(certType) - } - else { - identity = identity.trim() - for (let prefix of appleCertificatePrefixes) { - checkPrefix(identity, prefix) - } - const result = await findIdentity(certType, identity) - if (result == null) { - throw new Error(`Identity name "${identity}" is specified, but no valid identity with this name in the keychain`) - } - return result + private async sign(appOutDir: string, masOptions: MasBuildOptions | null): Promise { + let keychainName = (await this.codeSigningInfo).keychainName + if (process.env.CSC_LINK != null) { + throw new Error("keychainName is null, but CSC_LINK defined") } - } - private async sign(appOutDir: string, masOptions: MasBuildOptions | null): Promise { - let codeSigningInfo = await this.codeSigningInfo - if (codeSigningInfo == null) { - if (process.env.CSC_LINK != null) { - throw new Error("codeSigningInfo is null, but CSC_LINK defined") - } + const masQualifier = masOptions == null ? null : (masOptions.identity || this.platformSpecificBuildOptions.identity) - const identity = await MacPackager.findIdentity(masOptions == null ? "Developer ID Application" : "3rd Party Mac Developer Application", this.platformSpecificBuildOptions.identity) - if (identity == null) { - const message = "App is not signed: CSC_LINK or CSC_NAME are not specified, and no valid identity in the keychain, see https://github.com/electron-userland/electron-builder/wiki/Code-Signing" - if (masOptions == null) { - warn(message) - return - } - else { - throw new Error(message) - } - } - - if (masOptions != null) { - const installerName = masOptions == null ? null : (await MacPackager.findIdentity("3rd Party Mac Developer Installer", this.platformSpecificBuildOptions.identity)) - if (installerName == null) { - throw new Error("Cannot find valid installer certificate: CSC_LINK or CSC_NAME are not specified, and no valid identity in the keychain, see https://github.com/electron-userland/electron-builder/wiki/Code-Signing") - } - - codeSigningInfo = { - name: identity, - installerName: installerName, - } + let name = await findIdentity(masOptions == null ? "Developer ID Application" : "3rd Party Mac Developer Application", masOptions == null ? this.platformSpecificBuildOptions.identity : masQualifier, keychainName) + if (name == null) { + const message = "App is not signed: CSC_LINK is not specified, and no valid identity in the keychain, see https://github.com/electron-userland/electron-builder/wiki/Code-Signing" + if (masOptions == null) { + warn(message) + return } else { - codeSigningInfo = { - name: identity, - } + throw new Error(message) } } - else { - if (codeSigningInfo.name == null && masOptions == null) { - throw new Error("codeSigningInfo.name is null, but CSC_LINK defined") - } - if (masOptions != null && codeSigningInfo.installerName == null) { - throw new Error("Signing is required for mas builds but CSC_INSTALLER_LINK is not specified") + + let installerName: string | null = null + if (masOptions != null) { + installerName = await findIdentity("3rd Party Mac Developer Installer", masQualifier, keychainName) + if (installerName == null) { + throw new Error("Cannot find valid installer certificate: CSC_LINK is not specified, and no valid identity in the keychain, see https://github.com/electron-userland/electron-builder/wiki/Code-Signing") } } - const identity = codeSigningInfo.name - const baseSignOptions: BaseSignOptions = { app: path.join(appOutDir, `${this.appInfo.productFilename}.app`), platform: masOptions == null ? "darwin" : "mas", - keychain: codeSigningInfo.keychainName, + keychain: keychainName || undefined, version: this.info.electronVersion } const signOptions = Object.assign({ - identity: identity, + identity: name, }, (this.devMetadata.build)["osx-sign"], baseSignOptions) const resourceList = await this.resourceList @@ -183,29 +142,45 @@ export default class MacPackager extends PlatformPackager { signOptions.entitlements = customSignOptions.entitlements } else { - const p = `entitlements.${masOptions == null ? "osx" : "mas"}.plist` + let p = `entitlements.${masOptions == null ? "osx" : "mas"}.plist` if (resourceList.includes(p)) { + warn("entitlements.osx.plist is deprecated name, please use entitlements.mac.plist") signOptions.entitlements = path.join(this.buildResourcesDir, p) } + + if (masOptions == null) { + p = `entitlements.mac.plist` + if (resourceList.includes(p)) { + signOptions.entitlements = path.join(this.buildResourcesDir, p) + } + } } if (customSignOptions.entitlementsInherit != null) { signOptions["entitlements-inherit"] = customSignOptions.entitlementsInherit } else { - const p = `entitlements.${masOptions == null ? "osx" : "mas"}.inherit.plist` + let p = `entitlements.${masOptions == null ? "osx" : "mas"}.inherit.plist` if (resourceList.includes(p)) { + warn("entitlements.osx.inherit.plist is deprecated name, please use entitlements.mac.inherit.plist") signOptions["entitlements-inherit"] = path.join(this.buildResourcesDir, p) } + if (masOptions == null) { + p = `entitlements.mac.inherit.plist` + if (resourceList.includes(p)) { + signOptions["entitlements-inherit"] = path.join(this.buildResourcesDir, p) + } + } } - await task(`Signing app (identity: ${identity})`, this.doSign(signOptions)) + await task(`Signing app (identity: ${name})`, this.doSign(signOptions)) if (masOptions != null) { + await task(`Signing app (identity: ${name})`, this.doSign(signOptions)) const pkg = path.join(appOutDir, `${this.appInfo.productFilename}-${this.appInfo.version}.pkg`) await this.doFlat(Object.assign({ pkg: pkg, - identity: codeSigningInfo.installerName, + identity: installerName, }, baseSignOptions)) this.dispatchArtifactCreated(pkg, `${this.appInfo.name}-${this.appInfo.version}.pkg`) } @@ -236,10 +211,4 @@ export default class MacPackager extends PlatformPackager { } } } -} - -function checkPrefix(name: string, prefix: string) { - if (name.startsWith(prefix)) { - throw new Error(`Please remove prefix "${prefix}" from the specified name — appropriate certificate will be chosen automatically`) - } } \ No newline at end of file diff --git a/src/metadata.ts b/src/metadata.ts index 3bf3bd89250..cc903ebdb65 100755 --- a/src/metadata.ts +++ b/src/metadata.ts @@ -95,7 +95,7 @@ export interface BuildMetadata { readonly "app-bundle-id"?: string | null /* - *MacOS-only.* The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory. + *macOS-only.* The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory. For example, `app-category-type=public.app-category.developer-tools` will set the application category to *Developer Tools*. @@ -234,13 +234,13 @@ export interface MacOptions extends PlatformSpecificBuildOptions { readonly icon?: string | null /* - The path to entitlements file for signing the app. `build/entitlements.osx.plist` will be used if exists (it is a recommended way to set). + 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). MAS entitlements is specified in the [.build.mas](#MasBuildOptions-entitlements). */ readonly entitlements?: string | null /* - The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.osx.inherit.plist` will be used if exists (it is a recommended way to set). + 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). Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.darwin.inherit.plist). This option only applies when signing with `entitlements` provided. diff --git a/src/packager.ts b/src/packager.ts index 9dffc249d21..5440bb24d73 100644 --- a/src/packager.ts +++ b/src/packager.ts @@ -11,7 +11,7 @@ import { PackagerOptions, PlatformPackager, BuildInfo, ArtifactCreated, Target } import { WinPackager } from "./winPackager" import * as errorMessages from "./errorMessages" import * as util from "util" -import deepAssign = require("deep-assign") +import { deepAssign } from "./util/deepAssign" import semver = require("semver") import { warn, log } from "./util/log" import { AppInfo } from "./appInfo" diff --git a/src/platformPackager.ts b/src/platformPackager.ts index 090d83f70f8..4276cd85bac 100644 --- a/src/platformPackager.ts +++ b/src/platformPackager.ts @@ -4,13 +4,13 @@ import { Promise as BluebirdPromise } from "bluebird" import * as path from "path" import { pack, ElectronPackagerOptions, userIgnoreFilter } from "electron-packager-tf" import { readdir, remove, realpath } from "fs-extra-p" -import { statOrNull, use, unlinkIfExists } from "./util/util" +import { statOrNull, use, unlinkIfExists, isEmptyOrSpaces } from "./util/util" import { Packager } from "./packager" import { AsarOptions } from "asar" import { archiveApp } from "./targets/archive" import { Minimatch } from "minimatch" import { checkFileInPackage, createAsarArchive } from "./asarUtil" -import deepAssign = require("deep-assign") +import { deepAssign } from "./util/deepAssign" import { warn, log, task } from "./util/log" import { AppInfo } from "./appInfo" import { listDependencies, createFilter, copyFiltered, hasMagic } from "./util/filter" @@ -123,8 +123,8 @@ export abstract class PlatformPackager } protected getCscPassword(): string { - const password = this.options.cscKeyPassword - if (password == null) { + const password = this.options.cscKeyPassword || process.env.CSC_KEY_PASSWORD + if (isEmptyOrSpaces(password)) { log("CSC_KEY_PASSWORD is not defined, empty password will be used") return "" } diff --git a/src/targets/dmg.ts b/src/targets/dmg.ts index 2b48deb21a2..fbfae33b613 100644 --- a/src/targets/dmg.ts +++ b/src/targets/dmg.ts @@ -1,4 +1,4 @@ -import deepAssign = require("deep-assign") +import { deepAssign } from "../util/deepAssign" import * as path from "path" import { log } from "../util/log" import { Target, PlatformPackager } from "../platformPackager" diff --git a/src/util/deepAssign.ts b/src/util/deepAssign.ts new file mode 100644 index 00000000000..56c50a4aef4 --- /dev/null +++ b/src/util/deepAssign.ts @@ -0,0 +1,38 @@ +function isObject(x: any) { + const type = typeof x + return type === 'object' || type === 'function' +} + +function assignKey(to: any, from: any, key: string) { + const value = from[key] + // https://github.com/electron-userland/electron-builder/pull/562 + if (value === undefined) { + return + } + + const prevValue = to[key] + if (prevValue == null || value === null || typeof prevValue !== 'object' || !isObject(value)) { + to[key] = value + } + else { + to[key] = assign(prevValue, value) + } +} + +function assign(to: any, from: any) { + if (to !== from) { + for (let key of Object.getOwnPropertyNames(from)) { + assignKey(to, from, key) + } + } + return to +} + +export function deepAssign(target: any, ...objects: Array) { + for (let o of objects) { + if (o != null) { + assign(target, o) + } + } + return target +} \ No newline at end of file diff --git a/test/src/CodeSignTest.ts b/test/src/CodeSignTest.ts index b0b6f742461..8acf113f58f 100644 --- a/test/src/CodeSignTest.ts +++ b/test/src/CodeSignTest.ts @@ -1,12 +1,7 @@ import { createKeychain, deleteKeychain, generateKeychainName } from "out/codeSign" import * as assertThat from "should/as-function" import test from "./helpers/avaEx" -import { - CSC_NAME, CSC_LINK, - CSC_KEY_PASSWORD, - CSC_INSTALLER_KEY_PASSWORD, - CSC_INSTALLER_LINK -} from "./helpers/codeSignData" +import { CSC_LINK } from "./helpers/codeSignData" import { executeFinally, all } from "out/util/promise" import { removePassword } from "out/util/util" @@ -15,19 +10,17 @@ const __awaiter = require("out/util/awaiter") test.ifOsx("create keychain", async () => { const keychainName = generateKeychainName() - await executeFinally(createKeychain(keychainName, CSC_LINK, CSC_KEY_PASSWORD) + await executeFinally(createKeychain(keychainName, CSC_LINK, process.env.CSC_KEY_PASSWORD) .then(result => { assertThat(result.keychainName).not.empty() - assertThat(result.name).equal(CSC_NAME) }), () => all([deleteKeychain(keychainName)])) }) test.ifOsx("create keychain with installers", async () => { const keychainName = generateKeychainName() - await executeFinally(createKeychain(keychainName, CSC_LINK, CSC_KEY_PASSWORD, CSC_INSTALLER_LINK, CSC_INSTALLER_KEY_PASSWORD) + await executeFinally(createKeychain(keychainName, CSC_LINK, process.env.CSC_KEY_PASSWORD) .then(result => { assertThat(result.keychainName).not.empty() - assertThat(result.name).equal(CSC_NAME) }), () => all([deleteKeychain(keychainName)])) }) diff --git a/test/src/helpers/codeSignData.ts b/test/src/helpers/codeSignData.ts index e7473f7b1e5..72f4b3c6d51 100644 --- a/test/src/helpers/codeSignData.ts +++ b/test/src/helpers/codeSignData.ts @@ -1,7 +1 @@ -export const CSC_LINK = "MIIJswIBAzCCCXoGCSqGSIb3DQEHAaCCCWsEgglnMIIJYzCCA/cGCSqGSIb3DQEHBqCCA+gwggPkAgEAMIID3QYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQI2SKzGO/uwG8CAggAgIIDsMYNqJuz2AeP3e0bKRMs8ZXLGEUlp32kxtt+qf7w1TyKjDq4DZ8YfycDhwPZ2+i75gB8htkyU7cKF1B4Je8x7vTHkJSAooPJyNqzpJCPEsGSN6XvO4Uq9JLPEG41PabOJQpb6FEEF6azReuEx9gf/SG39UsGb+mDYHOWJtCnR1Rlq0ZHTwEL+37NXjkzUz9C2jxccC+Dd0SEiwX9WBeulsJoWSWCpvmN3Ssp3r4E+ka8KCQHyg0YeYe6Z8QRtnv59RyPXsP9UAnqMTufc8xlZBQCFE+0Vvxatzvi3OI5yeVmne3OtzqJd3dWnPp6hi5+nJeQXbFfIOJdPahEV5XMxCRW0+8LTjOM8E7sIVUnlHhVHhZxN1QOZF4nvoEBOvf2C/SMLqVGT5RwBzdg7rc4BIXmwkqiORQj9dvM8CU9oOcwsfS98qW/9NVmNjy25wWyBwVI52eg0EO6yVsaXKtSQIqKstv2o2EGfyY+bGxpMSGXufrER/0M5Lq+63m+yJ454mjvAku1CFQ6vtriNvHSu6GkugZmLEw9Jpo5nucKAG7EPe1QwdNhKyWjXRA2IwEchXoWcXML8sBQ4z6ENtefVAmaL6VBiYLn89bmKb+iS58vIz+G9rGw5MchzjrA9FcSzUMnZ85yo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LIvg0h5CSjD4XuNdaK/aG5tv9uhN4DzVJx8LaEGGGEAQ/j5Re+MPgzkuGlmw6//ev9h0tUQqwLvn7Sfl/GqU2Rc9PaFcIjmdBWpA4DTJFBI75AOSDuB6gntw0hp+OKipI84Csv5Te8TrzmgakA/s5WVxemMm/YwxJkrYUiiFgIMdrOsMys1o/9gS5h0WipksxSDAhBgkqhkiG9w0BCRQxFB4SAFQAZQBzAHQAIABUAGUAcwB0MCMGCSqGSIb3DQEJFTEWBBSvQomPBYWDJ+g/PeAuSnApMDa0RjAwMCEwCQYFKw4DAhoFAAQU9YxuiT/5yg/tVaYH8kwDgw3HvFAECE50WYPZs6V2AgEB" -export const CSC_KEY_PASSWORD = "password" - -export const CSC_INSTALLER_LINK = "https://drive.google.com/uc?export=download&id=0Bz3JwZ-jqfROYkRYblpfOXA4QVU" -export const CSC_INSTALLER_KEY_PASSWORD = "password" - -export const CSC_NAME = "Test Test" \ No newline at end of file +export const CSC_LINK = "MIIxJgIBAzCCMO0GCSqGSIb3DQEHAaCCMN4EgjDaMIIw1jCCGl8GCSqGSIb3DQEHBqCCGlAwghpMAgEAMIIaRQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQI6iZn8KR4PigCAggAgIIaGISvI+l+jTDd3jqClmFoO4pmi/iNYgIQighuDHpmTNuf8ToY4rfPksb6q4MlZn0ckK9mfFNaekH3LKnxvAuZ4B6/QbQeUAoDBrN17O05iwMIg8bZIxOwkHiGt3IbpqfYKJ00ctjb9T78G278/sGcAAMpYet6p06BBLwLvQkHoy/k0c4XD6EMTBWidy7WOzNCx7XB+7psahrEN4ftyUQ1hubhg8wtwgeu6AAPR41M1OnJ58FuZOaI76MfhjBv44EXNIZh2q7qW+0mRlwnzUzw7AhdCKM9+22PNi99MkVpqJtDe5t2h04JgnLCTpW77bTZvvu18g7JAB23SNvmWKVwm94/GFRbYdCO0l90UJ2tFVIrEXhCYhPaB+z0z6+uajj23vgfJJZqmUs+49QNLCfsNzTU7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811owMDAhMAkGBSsOAwIaBQAEFAb6AvWzkGqRoNvzJ3kIj1PkeYTSBAgRA6Okmf15CAIBAQ==" \ No newline at end of file diff --git a/test/src/helpers/packTester.ts b/test/src/helpers/packTester.ts index 39e83fa6be1..1aa913f3ca0 100755 --- a/test/src/helpers/packTester.ts +++ b/test/src/helpers/packTester.ts @@ -3,11 +3,11 @@ import * as assertThat2 from "should/as-function" import { assertThat } from "./fileAssert" import * as path from "path" import { parse as parsePlist } from "plist" -import { CSC_LINK, CSC_KEY_PASSWORD, CSC_INSTALLER_LINK, CSC_INSTALLER_KEY_PASSWORD } from "./codeSignData" +import { CSC_LINK } from "./codeSignData" import { expectedLinuxContents, expectedWinContents } from "./expectedContents" import { Packager, PackagerOptions, Platform, ArtifactCreated, Arch, DIR_TARGET } from "out" import { exec, getTempName } from "out/util/util" -import { log } from "out/util/log" +import { log, warn } from "out/util/log" import { createTargets } from "out" import { tmpdir } from "os" import { getArchSuffix, Target } from "out/platformPackager" @@ -336,10 +336,12 @@ export function platform(platform: Platform): PackagerOptions { } export function signed(packagerOptions: PackagerOptions): PackagerOptions { - packagerOptions.cscLink = CSC_LINK - packagerOptions.cscKeyPassword = CSC_KEY_PASSWORD - packagerOptions.cscInstallerLink = CSC_INSTALLER_LINK - packagerOptions.cscInstallerKeyPassword = CSC_INSTALLER_KEY_PASSWORD + if (process.env.CSC_KEY_PASSWORD == null) { + warn("macOS code sign is not tested — CSC_KEY_PASSWORD is not defined") + } + else { + packagerOptions.cscLink = CSC_LINK + } return packagerOptions } diff --git a/test/src/macPackagerTest.ts b/test/src/macPackagerTest.ts index fe292b3d510..23a64a7d794 100644 --- a/test/src/macPackagerTest.ts +++ b/test/src/macPackagerTest.ts @@ -8,7 +8,7 @@ import { Promise as BluebirdPromise } from "bluebird" import * as assertThat from "should/as-function" import { ElectronPackagerOptions } from "electron-packager-tf" import { Platform, MacOptions, createTargets } from "out" -import { SignOptions, FlatOptions } from "electron-osx-sign-tf" +import { SignOptions, FlatOptions } from "electron-osx-sign" import { Arch } from "out" import { Target } from "out/platformPackager" import { DmgTarget } from "out/targets/dmg" @@ -27,7 +27,7 @@ function createTargetTest(target: Array, expectedContents: Array targets: Platform.MAC.createTarget(), devMetadata: { build: { - osx: { + mac: { target: target } } @@ -50,15 +50,14 @@ test.ifOsx("mas", createTargetTest(["mas"], ["Test App ßW-1.1.0.pkg"])) test.ifOsx("mas and 7z", createTargetTest(["mas", "7z"], ["Test App ßW-1.1.0-mac.7z", "Test App ßW-1.1.0.pkg"])) test.ifOsx("custom mas", () => { - let platformPackager: CheckingOsXPackager = null + let platformPackager: CheckingMacPackager = null return assertPack("test-app-one", signed({ targets: Platform.MAC.createTarget(), - platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingOsXPackager(packager, cleanupTasks), + platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingMacPackager(packager, cleanupTasks), devMetadata: { build: { mac: { target: ["mas"], - identity: "Test Test", }, mas: { entitlements: "mas-entitlements file path", @@ -69,7 +68,6 @@ test.ifOsx("custom mas", () => { }), { packed: () => { assertThat(platformPackager.effectiveSignOptions).has.properties({ - identity: "Test Test", entitlements: "mas-entitlements file path", "entitlements-inherit": "mas-entitlementsInherit file path", }) @@ -79,10 +77,10 @@ test.ifOsx("custom mas", () => { }) test.ifOsx("entitlements in the package.json", () => { - let platformPackager: CheckingOsXPackager = null + let platformPackager: CheckingMacPackager = null return assertPack("test-app-one", signed({ targets: Platform.MAC.createTarget(), - platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingOsXPackager(packager, cleanupTasks), + platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingMacPackager(packager, cleanupTasks), devMetadata: { build: { mac: { @@ -103,19 +101,19 @@ test.ifOsx("entitlements in the package.json", () => { }) test.ifOsx("entitlements in build dir", () => { - let platformPackager: CheckingOsXPackager = null + let platformPackager: CheckingMacPackager = null return assertPack("test-app-one", signed({ targets: Platform.MAC.createTarget(), - platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingOsXPackager(packager, cleanupTasks), + platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingMacPackager(packager, cleanupTasks), }), { tempDirCreated: projectDir => BluebirdPromise.all([ - writeFile(path.join(projectDir, "build", "entitlements.osx.plist"), ""), - writeFile(path.join(projectDir, "build", "entitlements.osx.inherit.plist"), ""), + writeFile(path.join(projectDir, "build", "entitlements.mac.plist"), ""), + writeFile(path.join(projectDir, "build", "entitlements.mac.inherit.plist"), ""), ]), packed: projectDir => { assertThat(platformPackager.effectiveSignOptions).has.properties({ - entitlements: path.join(projectDir, "build", "entitlements.osx.plist"), - "entitlements-inherit": path.join(projectDir, "build", "entitlements.osx.inherit.plist"), + entitlements: path.join(projectDir, "build", "entitlements.mac.plist"), + "entitlements-inherit": path.join(projectDir, "build", "entitlements.mac.inherit.plist"), }) return BluebirdPromise.resolve(null) } @@ -131,11 +129,11 @@ test.ifOsx("no build directory", (t: any) => assertPack("test-app-one", platform })) test.ifOsx("custom background - old way", () => { - let platformPackager: CheckingOsXPackager = null + let platformPackager: CheckingMacPackager = null const customBackground = "customBackground.png" return assertPack("test-app-one", { targets: Platform.MAC.createTarget(), - platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingOsXPackager(packager, cleanupTasks) + platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingMacPackager(packager, cleanupTasks) }, { tempDirCreated: projectDir => BluebirdPromise.all([ move(path.join(projectDir, "build", "background.png"), path.join(projectDir, customBackground)), @@ -155,11 +153,11 @@ test.ifOsx("custom background - old way", () => { }) test.ifOsx("custom background - new way", () => { - let platformPackager: CheckingOsXPackager = null + let platformPackager: CheckingMacPackager = null const customBackground = "customBackground.png" return assertPack("test-app-one", { targets: Platform.MAC.createTarget(), - platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingOsXPackager(packager, cleanupTasks) + platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingMacPackager(packager, cleanupTasks) }, { tempDirCreated: projectDir => BluebirdPromise.all([ move(path.join(projectDir, "build", "background.png"), path.join(projectDir, customBackground)), @@ -188,7 +186,28 @@ test.ifOsx("custom background - new way", () => { }) }) -class CheckingOsXPackager extends OsXPackager { +test.ifOsx("disable dmg icon", () => { + let platformPackager: CheckingMacPackager = null + return assertPack("test-app-one", { + targets: Platform.MAC.createTarget(), + platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingMacPackager(packager, cleanupTasks), + devMetadata: { + build: { + dmg: { + icon: null, + } + }, + } + }, { + packed: () => { + assertThat(platformPackager.effectiveDistOptions.icon).equal(null) + assertThat(platformPackager.effectivePackOptions.icon).not.equal(null) + return BluebirdPromise.resolve(null) + }, + }) +}) + +class CheckingMacPackager extends OsXPackager { effectiveDistOptions: any effectivePackOptions: ElectronPackagerOptions effectiveSignOptions: SignOptions diff --git a/test/tsconfig.json b/test/tsconfig.json index 3611bd28fe4..0a4bee2bcc2 100755 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -22,7 +22,7 @@ "../node_modules/fs-extra-p/index.d.ts", "../node_modules/fs-extra-p/bluebird.d.ts", "out/electron-builder.d.ts", - "../node_modules/electron-osx-sign-tf/index.d.ts", + "../node_modules/electron-osx-sign/index.d.ts", "../node_modules/@types/**/*.d.ts", "!../node_modules/@types/node/node-*.d.ts" ], @@ -31,7 +31,6 @@ "../typings/appdmg.d.ts", "../typings/asar.d.ts", "../typings/chalk.d.ts", - "../typings/deep-assign.d.ts", "../typings/electron-packager.d.ts", "../typings/electron-winstaller-fixed.d.ts", "../typings/gh-api.d.ts", @@ -56,7 +55,7 @@ "../node_modules/fs-extra-p/index.d.ts", "../node_modules/fs-extra-p/bluebird.d.ts", "out/electron-builder.d.ts", - "../node_modules/electron-osx-sign-tf/index.d.ts", + "../node_modules/electron-osx-sign/index.d.ts", "../node_modules/@types/debug/index.d.ts", "../node_modules/@types/mime/index.d.ts", "../node_modules/@types/node/index.d.ts", diff --git a/tsconfig.json b/tsconfig.json index 0865b5c0b8e..85b6b45441d 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -29,7 +29,7 @@ "node_modules/fs-extra-p/index.d.ts", "node_modules/7zip-bin/index.d.ts", "node_modules/fs-extra-p/bluebird.d.ts", - "node_modules/electron-osx-sign-tf/index.d.ts", + "node_modules/electron-osx-sign/index.d.ts", "node_modules/@types/**/*.d.ts", "!node_modules/@types/node/node-*.d.ts" ], @@ -38,7 +38,6 @@ "typings/appdmg.d.ts", "typings/asar.d.ts", "typings/chalk.d.ts", - "typings/deep-assign.d.ts", "typings/electron-packager.d.ts", "typings/electron-winstaller-fixed.d.ts", "typings/gh-api.d.ts", @@ -57,7 +56,7 @@ "node_modules/fs-extra-p/index.d.ts", "node_modules/7zip-bin/index.d.ts", "node_modules/fs-extra-p/bluebird.d.ts", - "node_modules/electron-osx-sign-tf/index.d.ts", + "node_modules/electron-osx-sign/index.d.ts", "node_modules/@types/debug/index.d.ts", "node_modules/@types/mime/index.d.ts", "node_modules/@types/node/index.d.ts", @@ -92,6 +91,7 @@ "src/targets/targetFactory.ts", "src/util/awaiter.ts", "src/util/binDownload.ts", + "src/util/deepAssign.ts", "src/util/filter.ts", "src/util/httpRequest.ts", "src/util/log.ts", diff --git a/typings/deep-assign.d.ts b/typings/deep-assign.d.ts deleted file mode 100644 index 2dcd705c21e..00000000000 --- a/typings/deep-assign.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -declare module "deep-assign" { - function deepAssign(target: T, source: U): T & U - - function deepAssign(target: T, source: U, source2: U): T & U - - export = deepAssign -} \ No newline at end of file