2016-08-21 10:30:32 +03:00
|
|
|
Usage: electron-packager <sourcedir> <appname> [options...]
|
Implement multi-target options and refactor code
This adds support for --all, --platform=all, and --arch=all.
In order to accommodate outputting multiple directories for multiple
platforms and architectures, this also implements a new directory
structure under the output folder (distinguished by both platform and
arch). This structure is applied even to OS X distributions, which
formerly were output directly to an .app folder. This could be considered
a backwards-incompatible change.
One other backwards-incompatible change is the value that the packager
function passes to the callback, which is now always an array of paths,
rather than just a single path.
The behavior of the icon option has also been modified to use its
basename and apply .ico or .icns depending on platform, to make it
usable with --all and --platform=all. This attempts to maximize
backwards compatibility, by allowing a full filename to be specified,
but replacing the filename's extension with what is appropriate for
each target platform. Alternatively, the extension can now be omitted.
In the process of implementing this, it became evident that some things
were being done in 3 different places, and weren't always being done
consistently, so I've deduplicated everything I could.
This also includes a few other changes to improve stability for
multi-target runs, and other fixes:
* Avoid targeting darwin if the environment doesn't support symlinks,
to avoid the process bailing out on Windows
* Implement --overwrite centrally in index.js such that it explicitly
skips if an output directory already exists, for consistency with
all target platforms and to avoid any possible errors that would halt
operation during one target of a multi-target run
* Use ncp instead of mv to move to finalPath, which avoids flakiness
I noticed when testing on Windows 8 especially with multi-target runs
* Simplify temp directory logic by using a nested structure, so there
is only one top-level directory to clean up
* Reinstate fix from #55 which seems to have been clobbered by a later
merge
* linux.createApp now resolves to the final output directory;
it was formerly resolving to the executable path
* mac.createApp now replaces space with underscore in bundle IDs
* Only the platform modules that are needed are loaded
* The win32 module only loads rcedit if needed
This also fixes a couple of missing updates to docs (readme/usage).
This commit addresses the following issues:
* Resolves #40
* Resolves #38
* Resolves #70
* Works around #71
* Resolves #84 by reinstating #55
2015-06-20 05:36:15 +03:00
|
|
|
|
2018-05-13 08:56:57 +03:00
|
|
|
Required parameters
|
2015-05-10 23:57:42 +03:00
|
|
|
|
2016-03-15 08:42:57 +03:00
|
|
|
sourcedir the base directory of the application source
|
2016-05-18 18:56:58 +03:00
|
|
|
|
2016-08-21 10:30:32 +03:00
|
|
|
Examples: electron-packager ./
|
2016-05-18 18:56:58 +03:00
|
|
|
electron-packager ./ --all
|
2015-05-10 23:57:42 +03:00
|
|
|
|
2018-05-13 08:56:57 +03:00
|
|
|
Optional parameters
|
2015-05-10 23:57:42 +03:00
|
|
|
|
2016-05-18 18:56:58 +03:00
|
|
|
appname the name of the app, if it needs to be different from the "productName" or "name"
|
|
|
|
in the nearest package.json
|
2016-03-15 08:42:57 +03:00
|
|
|
|
2018-05-13 08:56:57 +03:00
|
|
|
Options
|
|
|
|
|
|
|
|
version prints the version of Electron Packager and Node, plus the target platform and
|
|
|
|
arch, for bug reporting purposes, and exits immediately
|
|
|
|
|
2016-02-29 05:50:00 +03:00
|
|
|
* All platforms *
|
|
|
|
|
2016-08-21 10:30:32 +03:00
|
|
|
all equivalent to --platform=all --arch=all
|
2016-02-18 19:56:13 +03:00
|
|
|
app-copyright human-readable copyright line for the app
|
2015-10-13 18:58:55 +03:00
|
|
|
app-version release version to set for the app
|
2022-04-19 20:18:15 +03:00
|
|
|
arch all, or one or more of: ia32, x64, armv7l, arm64, mips64el, universal (comma-delimited if
|
|
|
|
multiple). Defaults to the host arch.
|
2023-11-07 22:13:28 +03:00
|
|
|
For info on arch/platform support see https://github.com/electron/packager/#supported-platforms
|
2016-07-06 09:04:29 +03:00
|
|
|
asar whether to package the source code within your app into an archive. You can either
|
2016-08-04 19:05:36 +03:00
|
|
|
pass --asar by itself to use the default configuration, OR use dot notation to
|
|
|
|
configure a list of sub-properties, e.g. --asar.unpackDir=sub_dir - do not use
|
|
|
|
--asar and its sub-properties simultaneously.
|
2016-07-06 09:04:29 +03:00
|
|
|
|
2020-03-04 00:45:09 +03:00
|
|
|
Properties supported include:
|
2016-07-06 09:04:29 +03:00
|
|
|
- ordering: path to an ordering file for file packing
|
|
|
|
- unpack: unpacks the files to the app.asar.unpacked directory whose filenames
|
|
|
|
regex .match this string
|
|
|
|
- unpackDir: unpacks the dir to the app.asar.unpacked directory whose names glob
|
2016-04-29 22:17:28 +03:00
|
|
|
pattern or exactly match this string. It's relative to the <sourcedir>.
|
2016-02-29 05:50:00 +03:00
|
|
|
build-version build version to set for the app
|
2019-06-14 01:53:19 +03:00
|
|
|
download a list of sub-options to pass to @electron/get. They are specified via dot
|
|
|
|
notation, e.g., --download.cacheRoot=/tmp/cache
|
2016-04-11 00:20:42 +03:00
|
|
|
Properties supported:
|
2019-06-14 01:53:19 +03:00
|
|
|
- cacheRoot: directory of cached Electron downloads. For default value, see
|
|
|
|
@electron/get documentation
|
|
|
|
- mirrorOptions: alternate URL options for downloading Electron zips. See
|
|
|
|
@electron/get documentation for details
|
2017-01-03 05:30:40 +03:00
|
|
|
electron-version the version of Electron that is being packaged, see
|
|
|
|
https://github.com/electron/electron/releases
|
2019-12-28 00:34:49 +03:00
|
|
|
electron-zip-dir the local path to a directory containing Electron ZIP files
|
2017-11-20 04:54:38 +03:00
|
|
|
executable-name the name of the executable file, sans file extension. Defaults to appname
|
2017-06-19 06:04:44 +03:00
|
|
|
extra-resource a file to copy into the app's resources directory
|
2016-11-15 18:42:25 +03:00
|
|
|
icon the local path to an icon file to use as the icon for the app.
|
|
|
|
Note: Format depends on platform.
|
2017-09-03 00:30:44 +03:00
|
|
|
ignore do not copy files into app whose filenames RegExp.match this string. See also:
|
2023-12-18 23:12:22 +03:00
|
|
|
https://electron.github.io/packager/main/interfaces/Options.html#ignore
|
2017-09-03 00:30:44 +03:00
|
|
|
and --no-prune. Can be specified multiple times
|
2017-09-03 00:37:46 +03:00
|
|
|
no-deref-symlinks make sure symlinks are not dereferenced within the app source
|
2019-06-01 20:03:25 +03:00
|
|
|
no-junk do not ignore system junk files from the packaged app
|
2017-04-24 01:53:22 +03:00
|
|
|
no-prune do not prune devDependencies from the packaged app
|
2017-11-20 04:54:38 +03:00
|
|
|
out the dir to put the app into at the end. Defaults to current working dir
|
2016-05-18 18:56:58 +03:00
|
|
|
overwrite if output directory for a platform already exists, replaces it rather than
|
|
|
|
skipping it
|
2016-08-21 10:30:32 +03:00
|
|
|
platform all, or one or more of: darwin, linux, mas, win32 (comma-delimited if multiple).
|
|
|
|
Defaults to the host platform
|
2018-05-26 11:06:00 +03:00
|
|
|
prebuilt-asar path to a prebuilt asar file (asar, ignore, no-prune, and no-deref-symlinks
|
|
|
|
options are incompatible with this option and will be ignored)
|
2016-12-09 07:42:12 +03:00
|
|
|
quiet Do not print informational or warning messages
|
2017-09-03 00:40:51 +03:00
|
|
|
tmpdir temp directory. Defaults to system temp directory, use --no-tmpdir to disable
|
2016-05-18 18:56:58 +03:00
|
|
|
use of a temporary directory.
|
2016-02-29 05:50:00 +03:00
|
|
|
|
|
|
|
* darwin/mas target platforms only *
|
|
|
|
|
|
|
|
app-bundle-id bundle identifier to use in the app plist
|
|
|
|
app-category-type the application category type
|
2016-05-18 18:56:58 +03:00
|
|
|
For example, `app-category-type=public.app-category.developer-tools` will set the
|
|
|
|
application category to 'Developer Tools'.
|
2018-10-02 03:27:57 +03:00
|
|
|
darwin-dark-mode-support
|
|
|
|
forces support for Mojave/10.14 dark mode in the packaged app
|
2016-10-23 23:55:04 +03:00
|
|
|
extend-info a plist file to merge into the app plist
|
2016-02-29 05:50:00 +03:00
|
|
|
helper-bundle-id bundle identifier to use in the app helper plist
|
2019-03-08 08:38:23 +03:00
|
|
|
osx-sign (macOS host platform only) Whether to sign the macOS app packages. You can either
|
2016-03-28 00:44:51 +03:00
|
|
|
pass --osx-sign by itself to use the default configuration, or use dot notation
|
2016-03-10 09:44:09 +03:00
|
|
|
to configure a list of sub-properties, e.g. --osx-sign.identity="My Name"
|
2022-10-19 01:36:04 +03:00
|
|
|
For info on supported values see https://npm.im/@electron/osx-sign#opts---options
|
2020-03-04 00:45:09 +03:00
|
|
|
Properties supported include:
|
2016-03-10 09:44:09 +03:00
|
|
|
- identity: should contain the identity to be used when running `codesign`
|
|
|
|
- entitlements: the path to entitlements used in signing
|
|
|
|
- entitlements-inherit: the path to the 'child' entitlements
|
2019-03-08 08:38:23 +03:00
|
|
|
osx-notarize (macOS host platform only, requires --osx-sign) Whether to notarize the macOS app
|
2018-11-05 09:53:37 +03:00
|
|
|
packages. You must use dot notation to configure a list of sub-properties, e.g.
|
|
|
|
--osx-notarize.appleId="foo@example.com"
|
2022-10-25 07:09:59 +03:00
|
|
|
For info on supported values see https://npm.im/@electron/notarize#method-notarizeopts-promisevoid
|
2020-03-04 00:45:09 +03:00
|
|
|
Properties supported include:
|
2018-10-24 06:01:12 +03:00
|
|
|
- appleId: should contain your apple ID username / email
|
|
|
|
- appleIdPassword: should contain the password for the provided apple ID
|
2020-03-31 03:35:36 +03:00
|
|
|
- appleApiKey: should contain an App Store Connect API key
|
|
|
|
- appleApiIssuer: should contain the API key's issuer
|
2023-07-18 01:06:15 +03:00
|
|
|
osx-universal (macOS host platform only, requires --arch=universal) Options to pass to `@electron/universal`
|
|
|
|
when packaging a Universal macOS binary. You must use dot notation to configure a list of sub-properties,
|
|
|
|
e.g. --osx-universal.mergeASARs="true"
|
|
|
|
For info on supported values see
|
2023-12-18 23:12:22 +03:00
|
|
|
https://electron.github.io/packager/main/types/OsxUniversalOptions.html
|
2023-11-30 20:33:25 +03:00
|
|
|
windows-sign Whether to sign Windows binary files with a codesigning certificate. You can either
|
|
|
|
pass --windows-sign by itself to use the default configuration or use dot notation to configure
|
|
|
|
a list of sub-properties, e.g. --windows-sign.certificateFile="C:\cert.pfx".
|
|
|
|
For info on supported values see https://npm.im/@electron/windows-sign.
|
2016-08-12 23:43:23 +03:00
|
|
|
protocol URL protocol scheme to register the app as an opener of.
|
|
|
|
For example, `--protocol=myapp` would register the app to open
|
|
|
|
URLs such as `myapp://path`. This argument requires a `--protocol-name`
|
|
|
|
argument to also be specified.
|
|
|
|
protocol-name Descriptive name of URL protocol scheme specified via `--protocol`
|
2019-09-25 17:55:57 +03:00
|
|
|
usage-description Human-readable descriptions of how the app uses certain macOS features. Displayed
|
|
|
|
in the App Store. A non-exhaustive list of properties supported:
|
|
|
|
- Camera
|
|
|
|
- Microphone
|
2016-02-29 05:50:00 +03:00
|
|
|
|
|
|
|
* win32 target platform only *
|
|
|
|
|
2016-08-21 05:22:40 +03:00
|
|
|
win32metadata a list of sub-properties used to set the application metadata embedded into
|
2016-05-18 18:56:58 +03:00
|
|
|
the executable. They are specified via dot notation,
|
2016-08-21 05:22:40 +03:00
|
|
|
e.g. --win32metadata.CompanyName="Company Inc."
|
|
|
|
or --win32metadata.ProductName="Product"
|
2016-03-10 09:44:09 +03:00
|
|
|
Properties supported:
|
2017-05-12 05:55:43 +03:00
|
|
|
- CompanyName (default: author name from nearest package.json)
|
2017-06-06 10:30:00 +03:00
|
|
|
- FileDescription (default: appname)
|
2017-05-12 05:55:43 +03:00
|
|
|
- OriginalFilename (default: renamed exe)
|
|
|
|
- ProductName (default: appname)
|
|
|
|
- InternalName (default: appname)
|
2017-06-06 08:49:37 +03:00
|
|
|
- requested-execution-level (user, asInvoker, or requireAdministrator)
|
|
|
|
- application-manifest
|