본문 바로가기
카테고리 없음

Electron Mac Menu App

by manceviorinnemea 2020. 12. 6.


Electron Mac Menu App
  1. Electron Build Mac
  2. Electron Mac Menu App Installer
  3. Electron Mac Menu App Download
  4. Electron Mac Menu Bar App
  5. Electron App Store

macOS and Windows code signing is supported. Windows is dual code-signed (SHA1 & SHA256 hashing algorithms).

On a macOS development machine, a valid and appropriate identity from your keychain will be automatically used.

This tutorial is based on our 100% free course: Creating Desktop Apps with Electron Tutorial. In the previous lesson, we installed a brand new Electron project and got it all setup. In this lesson, we're going to take a look at how to integrate a custom menu for our app. Expose document-specific preferences in the File menu, not the app menu. Only app-level preferences should be accessible in the app menu. Expose help menu items from the Help menu, not the app menu. Although help is app-specific, it has a dedicated, well-known menu of its own. Separate the Quit menu item.

Mac

Tip

See article Notarizing your Electron application.

Env NameDescription
CSC_LINKThe HTTPS link (or base64-encoded data, or file:// link, or local path) to certificate (*.p12 or *.pfx file). Shorthand ~/ is supported (home directory).
CSC_KEY_PASSWORDThe password to decrypt the certificate given in CSC_LINK.
CSC_NAMEmacOS-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_IDENTITY_AUTO_DISCOVERYtrue or false. Defaults to true — on a macOS development machine valid and appropriate identity from your keychain will be automatically used.
CSC_KEYCHAINThe keychain name. Used if CSC_LINK is not specified. Defaults to system default keychain.

Tip

If you are building Windows on macOS and need to set a different certificate and password (than the ones set in CSC_* env vars) you can use WIN_CSC_LINK and WIN_CSC_KEY_PASSWORD.

Windows¶

To sign an app on Windows, there are two types of certificates:

  • EV Code Signing Certificate
  • Code Signing Certificate

Both certificates work with auto-update. The regular (and often cheaper) Code Signing Certificate shows a warning during installation that goes away once enough users installed your application and you’ve built up trust. The EV Certificate has more trust and thus works immediately without any warnings. However, it is not possible to export the EV Certificate as it is bound to a physical USB dongle. Thus, you can’t export the certificate for signing code on a CI, such as AppVeyor.

If you are using an EV Certificate, you need to provide win.certificateSubjectName in your electron-builder configuration.

If you use Windows 7, please ensure that PowerShell is updated to version 3.0.

If you are on Linux or Mac and you want sign a Windows app using EV Code Signing Certificate, please use the guide for Unix systems.

Track the progress of Development Applications that are under assessment access records of determined applications and certificates submitted since 1980 You can search by property address or application number, or search for a list of applications lodged within a date range. Shop app tracking.

Travis, AppVeyor and other CI Servers¶

To sign app on build server you need to set CSC_LINK, CSC_KEY_PASSWORD:

  1. Export certificate. Consider to not use special characters (for bash[1]) in the password because “values are not escaped when your builds are executed”.
  2. Encode file to base64 (macOS: base64 -i yourFile.p12 -o envValue.txt, Linux: base64 yourFile.p12 > envValue.txt).

Or upload *.p12 file (e.g. on Google Drive, use direct link generator to get correct download link).

  1. Set CSC_LINK and CSC_KEY_PASSWORD environment variables. See Travis or AppVeyor documentation. Recommended to set it in the CI Project Settings, not in the .travis.yml/appveyor.yml. If you use link to file (not base64 encoded data), make sure to escape special characters (for bash[1]) accordingly.

In case of AppVeyor, don’t forget to click on lock icon to “Toggle variable encryption”.

Keep in mind that Windows is not able to handle enviroment variable values longer than 8192 characters, thus if the base64 representation of your certificate exceeds that limit, try re-exporting the certificate without including all the certificates in the certification path (they are not necessary, but the Certificate Manager export wizard ticks the option by default), otherwise the encoded value will be truncated.

[1] printf '%qn' '<url>'

Where to Buy Code Signing Certificate¶

Macos app store. See Get a code signing certificate for Windows (platform: “Microsoft Authenticode”).Please note — Gatekeeper only recognises Apple digital certificates.

Electron Build Mac

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):
  4. Developer ID Application: to sign app for macOS.
  5. 3rd Party Mac Developer Application: and 3rd Party Mac Developer Installer: to sign app for MAS (Mac App Store).
  6. Developer ID Application: and Developer ID Installer to sign app and installer for distribution outside of the Mac App Store.
  7. Mac Developer: to sign development builds for testing Mac App Store submissions (mas-dev target). You also need a provisioning profile in the working directory that matches this certificate and the device being used for testing.

Electron Mac Menu App Installer

Please note – you can select as many certificates as needed. No restrictions on electron-builder side. All selected certificates will be imported into temporary keychain on CI server.4. Open context menu and Export.

Electron Mac Menu App Download

How to Disable Code Signing During the Build Process on macOS¶

Electron Mac Menu Bar App

Add account mail app mac. To disable Code Signing when building for macOS leave all the above vars unset except for CSC_IDENTITY_AUTO_DISCOVERY which needs to be set to false. This can be done by running export CSC_IDENTITY_AUTO_DISCOVERY=false.

Electron App Store

Allow apps in privacy without admin priveleges mac. Another way — set mac.identity to null. You can pass aditional configuration using CLI as well: -c.mac.identity=null.