.app
, .exe
, etc.) via JavaScript or the command line.electron-v${version}-${platform}-${arch}.zip
).win32
, for both 32/64 bit)darwin
) / Mac App Store (also known as mas
)*.app
bundle can only be signed when building on a host macOS platform.unzip
program is required. On Windows, both .NET Framework 4.5 or higher and Powershell 3 or higher are required.Electron.exe
file.Currently, Electron Packager uses node-rcedit to accomplishthis. A Windows executable is bundled in that Node package and needs to be run in order for thisfunctionality to work, so on non-Windows host platforms, Wine 1.6 orlater needs to be installed. On macOS, it is installable via Homebrew.<out>/<appname>-<platform>-<arch>
(this can be customized via an optional flag)--platform
and --arch
can be omitted, in two cases:--all
instead, bundles for all valid combinations of targetplatforms/architectures will be created.electron-packager --help
or seeusage.txt. Fordetailed descriptions, see the API documentation.appname
is omitted, this will use the name specified by 'productName' or 'name' in the nearest package.json./
), will be replaced by hyphens (-
).node_modules
you don't want into your final app. If you put them inthe devDependencies
section of package.json
, by default none of the modules related to thosedependencies will be copied in the app bundles. (This behavior can be turned off with the--no-prune
flag.) In addition, folders like .git
and node_modules/.bin
will be ignored bydefault. You can use --ignore
to ignore files and folders via a regular expression (not aglob pattern). Examples include--ignore=.gitignore
or --ignore='.git(ignore|modules)'
.electron-packager
is installed globallyproductName
in package.json
has been set to Foo Bar
electron
module is in the devDependencies
section of package.json
, and set to the exact version of 1.4.15
.npm install
for the Foo Bar
app has been run at least oncefoobar
directory:electron-packager
will do the following:sourcedir
appname
from the productName
in package.json
appVersion
from the version
in package.json
platform
and arch
from the host, in this example, darwin
platform and x64
arch.~/.electron
)Foo Bar.app
Foo Bar.app
in foobar/Foo Bar-darwin-x64/
(since an out
directory was not specified, it used the current working directory)Foo Bar.app
folder generated can be executed by a system running macOS, which will start the packaged Electron app. This is also true of the Windows x64 build on a system running a new enough version of Windows for a 64-bit system (via Foo Bar-win32-x64/Foo Bar.exe
), and so on.chmod +x SomeApp.app/Contents/MacOS/*
+x
flags a file as executable, and the only file in the /Contents/MacOS/
directory is a binary representing the actual file that should be executed when you double-click the application (a .app
file is really just a folder).SomeApp.app
can’t be opened, I /Applications/Utilities/Terminal.app
), sudo killall launchservicesd
killall Dock
.SomeApp
(or any app).