Electron Build Dmg



Electron-builder ¶ A complete solution to package and build a ready for distribution Electron app for macOS, Windows and Linux with “auto update” support out of the box. CreateDMG(opts, callback) opts. AppPath - String - Required The.app directory generated by electron-packager. Name - String - Required The application name. Title - String The title of the produced DMG, which will be shown when mounted.

All builds produced by electron-builder can be found within the build directory.

Building

Building unpacked directory

Dmg

Processes-1.0.0.dmg (OSX) Note that the Windows executable is a setup program, not the application itself. Also, OSX targets can only be built on a Mac, but Windows/Linux targets can be built on any platform. To change the version number, copyright notice, and other attributes, edit electron.manifest.json before creating the installation media. DMG files are commonly used for distributing application 'installers'. Electron-builder supports dmg as a build target. Learn More About Electron, AppAuth, and OIDC. There you have it! Go forth and use your web skills to create amazing desktop applications! To learn more about Electron, AppAuth, React, and OIDC, check out the following resources: Writing Your First Electron App; Build a Basic CRUD App in Android with Kotlin.

Produce simple executable without full installer. Useful for quick testing.

Default building configuration

Electron Build Dmg Mod

Further customization can be made at package.json in accordance to electron-builders's options found here.

Electron

Automated Deployments using CI

Electron Build DmgDmg

When using electron-vue's electron-builder configuration, you are also provided a appveyor.yml and .travis.yml for automated deployments. Both config files are setup for building your electron application and pushing artifacts to a GitHub release, Bintray, etc. Travis CI is used to build both linux and darwin (macOS) while AppVeyor is used to build win32. Both services are free for OSS projects.

Setting up Travis CI/AppVeyor

  1. Create an account over at Travis CI / AppVeyor
  2. Link your GitHub repository that has your electron-vue project
  3. Visit https://github.com/settings/tokens and hit Generate new token (the same token can be used for both Travis CI & AppVeyor)
    1. Set a Token description
    2. Check the public_repo scope
    3. Hit Generate token
  4. Copy your new token and save for later
  5. Open your repository settings on Travis CI / AppVeyor to add a new Environment Variable
    1. Set the name of the variable to GH_TOKEN
    2. Set the value of the variable to the GitHub access token you just created
    3. Save the new variable and ensure encryption is enabled

At this point, everything should be setup. Travis CI/AppVeyor by default will watch for any pushes to your master branch. When a push is made, Travis CI/AppVeyor will then clone down your repository to its server and begin the build process. During the final stages, electron-builder with see the GH_TOKEN environment variable and create a draft release and upload the artifacts to your public GitHub repository. From this point, you can edit the draft release and then publish it to the world. After publishing your release, make sure future releases are marked with a new version number by updating your package.json.

Auto Updating

Enabling your application to receive automatic updates is a super nice feature to have, but know that Code Signing is required. You can setup code signing by adding a few more environment variables based on what electron-builder needs described here. Once you have your certificates setup, you can then install electron-updater and comment out the chunk of code at the bottom of src/main/index.js to enable auto updating.

Electron Builder Dmg

If you are like most people and do not have a fancy code signing certificate, then you can always use the GitHub API to check for new releases. When a new release is detected, provide a notification within your application to point users to a download page where they can download and install the new build. Thanks to the amazing installer that electron-builder provides, user's do not have to uninstall the current version and the new installation will replace the old while still persisting any web storage or userData files.