• Stars
    star
    298
  • Rank 139,663 (Top 3 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created over 9 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Create DMG installers for your electron apps using appdmg.

electron-installer-dmg

CI status npm Code coverage

Create DMG installers for your electron apps using appdmg.

Requirements

This module requires using macOS and Node 12 (LTS) or above.

Installation

For use in npm scripts:

npm i electron-installer-dmg --save-dev

For use from cli:

npm i electron-installer-dmg -g

Usage

Usage: electron-installer-dmg <path/to/.app> <appname>

Create DMG installers for your electron apps.

Usage:
  electron-installer-dmg ./FooBar-darwin-x64/FooBar.app FooBar

Options:
  --out=<path>         The directory to put the DMG into. [Default: `process.cwd()`].
  --icon=<path>        Path to the icon file that will be the app icon in the DMG window.
  --icon-size=<px>     How big to make the icon for the app in the DMG. [Default: `80`].
  --background=<path>  Path to a PNG image to use as the background of the DMG. [Size: 658 x 498]
  --title=<string>     The title of the produced DMG, which will be shown when mounted.
  --debug              Enable debug messages.
  --overwrite          Overwrite any existing DMG.
  -h --help            Show this screen.
  --version            Show version.

API

const createDMG = require('electron-installer-dmg');

async function buildDMG() {
  await createDMG({
    appPath: '/path/to/app.app',
    name: 'MyApp'
  });
}

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.

background - String Path to the background for the DMG window. Background image should be of size 658โ€†ร—โ€†498.

icon - String Path to the icon to use for the app in the DMG window.

overwrite - Boolean Overwrite an existing DMG file if if already exists.

debug - Boolean Enable debug message output.

out - String The directory to put the DMG into. [Default: process.cwd()].

iconSize - Number How big to make the icon for the app in the DMG. [Default: 80].

contents - Array or Function that returns an Array of objects. The content that will appear in the window when user opens the .dmg file. [Default: Array of two icons, application and application destination folder]. Array example:

[ { x: 448, y: 344, type: 'link', path: '/Applications'},
  { x: 192, y: 344, type: 'file', path: '/path/to/application.app'} ]

Function example (more flexible for getting useful options used in creating a DMG):

function (opts) {
   return [ { x: 448, y: 344, type: 'link', path: '/Applications'},
            { x: 192, y: 344, type: 'file', path: opts.appPath} ];
}

format - String Disk image format. [Default: UDZO].

Must be one of the following:

  • UDRW โžก๏ธ read/write image
  • UDRO โžก๏ธ read-only image
  • UDCO โžก๏ธ ADC-compressed image
  • UDZO โžก๏ธ zlib-compressed image
  • UDBZ โžก๏ธ bzip2-compressed image
  • ULFO โžก๏ธ lzfse-compressed image (macOS 10.11+ only)

additionalDMGOptions - Object Additional options to pass through to appdmg

You can use this to set additional features like background-color and code-sign. See the docs of the appdmg module for all possible options.

License

Apache 2.0

More Repositories

1

electron-builder

A complete solution to package and build a ready for distribution Electron app with โ€œauto updateโ€ support out of the box
TypeScript
13,564
star
2

devtron

[LOOKING FOR MAINTAINERS] An Electron DevTools Extension
JavaScript
1,728
star
3

spectron

DEPRECATED: ๐Ÿ”Ž Test Electron apps using ChromeDriver
JavaScript
1,677
star
4

electron-json-storage

๐Ÿ“ฆ Easily write and read user settings in Electron apps
JavaScript
1,433
star
5

electron-compile

DEPRECATED: Electron supporting package to compile JS and CSS in Electron applications
JavaScript
1,008
star
6

electron-webpack

Scripts and configurations to compile Electron applications using webpack
TypeScript
903
star
7

electron-prebuilt

๐ŸŽ‚ Retired project. See README
JavaScript
760
star
8

electron-webpack-quick-start

A bare minimum project structure to get started developing with electron-webpack.
JavaScript
729
star
9

electron-windows-store

๐Ÿ“ฆ Turn Electron Apps into Windows AppX Packages
JavaScript
678
star
10

electron-installer-windows

Create a Windows package for your Electron app.
JavaScript
470
star
11

electron-remote

DEPRECATED: Execute JavaScript in remote Electron processes, but more betterer
JavaScript
430
star
12

electron-installer-debian

Create a Debian package for your Electron app.
JavaScript
377
star
13

electron-wix-msi

๐Ÿ“€ Create traditional MSI installers for your Electron app
TypeScript
319
star
14

electron-spellchecker

Implement spellchecking, correctly
JavaScript
237
star
15

electron-builder-binaries

NSIS
172
star
16

electron-prebuilt-compile

electron-prebuilt with Babel and React built-in
JavaScript
169
star
17

electron-build-service

Package Electron applications in a distributable format on any platform for any platform
Go
138
star
18

electron-forge-templates

Templates bundled with Electron Forge <= 5 to create Electron apps using popular JavaScript frameworks
JavaScript
104
star
19

electron-installer-redhat

Create a Red Hat / RPM package for your Electron app.
JavaScript
81
star
20

electron-installer-snap

Build Snap packages for Electron applications
JavaScript
49
star
21

electrify

Step-by-step wizard to prepare Electron app for distribution, from packaging to auto-update.
TypeScript
48
star
22

electron-installer-zip

Create a ZIP file with support for symlinks required by Electron on macOS
JavaScript
46
star
23

welcome

Organization mission statement and contribution guidelines
45
star
24

electron-compilers

DEPRECATED: Compiler implementations for electron-compile
JavaScript
35
star
25

electron-installer-common

Common functionality for creating Node modules which create distributable Electron apps
JavaScript
9
star
26

electron-forge-container

Docker container for building Electron apps via Electron Forge
Dockerfile
7
star
27

create-electron-app

JavaScript
5
star
28

electron-forge-plugin-compile

Electron Compile plugin for Electron Forge
JavaScript
3
star
29

vue-cli-plugin-electron-forge

@vue/cli plugin to add Electron Forge
3
star