You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -39,17 +39,17 @@ _(files named `electron-v${version}-${platform}-${arch}.zip`)_.
39
39
40
40
Electron Packager is known to run on the following **host** platforms:
41
41
42
-
* Windows (32/64 bit)
43
-
* macOS (formerly known as OS X)
44
-
* Linux (x86/x86_64)
42
+
- Windows (32/64 bit)
43
+
- macOS (formerly known as OS X)
44
+
- Linux (x86/x86_64)
45
45
46
46
It generates executables/bundles for the following **target** platforms:
47
47
48
-
* Windows (also known as `win32`, for x86, x86_64, and arm64 architectures)
49
-
* macOS (also known as `darwin`) / [Mac App Store](https://electronjs.org/docs/tutorial/mac-app-store-submission-guide/) (also known as `mas`)<sup>*</sup> (for x86_64, arm64, and universal architectures)
50
-
* Linux (for x86, x86_64, armv7l, arm64, and mips64el architectures)
48
+
- Windows (also known as `win32`, for x86, x86_64, and arm64 architectures)
49
+
- macOS (also known as `darwin`) / [Mac App Store](https://electronjs.org/docs/tutorial/mac-app-store-submission-guide/) (also known as `mas`)<sup>\*</sup> (for x86_64, arm64, and universal architectures)
50
+
- Linux (for x86, x86_64, armv7l, arm64, and mips64el architectures)
51
51
52
-
<sup>*</sup> *Note for macOS / Mac App Store target bundles: the `.app` bundle can only be signed when building on a host macOS platform.*
52
+
<sup>*</sup> *Note for macOS / Mac App Store target bundles: the `.app` bundle can only be signed when building on a host macOS platform.\*
53
53
54
54
## Installation
55
55
@@ -71,24 +71,20 @@ JavaScript API usage can be found in the [API documentation](https://electron.gi
71
71
72
72
Running Electron Packager from the command line has this basic form:
> `npx` can be substituted for `yarn` or `npm exec` depending on what package manager and
80
-
> the version you have installed.
81
-
82
78
This will:
83
79
84
-
* Find or download the correct release of Electron
85
-
* Use that version of Electron to create an app in `<out>/<appname>-<platform>-<arch>`*(this can be customized via an optional flag)*
80
+
- Find or download the correct release of Electron
81
+
- Use that version of Electron to create an app in `<out>/<appname>-<platform>-<arch>`_(this can be customized via an optional flag)_
86
82
87
83
`--platform` and `--arch` can be omitted, in two cases:
88
84
89
-
* If you specify `--all` instead, bundles for all valid combinations of target
85
+
- If you specify `--all` instead, bundles for all valid combinations of target
90
86
platforms/architectures will be created.
91
-
* Otherwise, a single bundle for the host platform/architecture will be created.
87
+
- Otherwise, a single bundle for the host platform/architecture will be created.
92
88
93
89
For an overview of the other optional flags, run `electron-packager --help` or see
94
90
[usage.txt](https://github.com/electron/packager/blob/main/usage.txt). For
@@ -113,14 +109,15 @@ the `devDependencies` section of `package.json`, by default none of the modules
113
109
dependencies will be copied in the app bundles. (This behavior can be turned off with the
114
110
`prune: false` API option or `--no-prune` CLI flag.) In addition, folders like `.git` and
115
111
`node_modules/.bin` will be ignored by default. You can use `--ignore` to ignore files and folders
116
-
via a regular expression (*not* a [glob pattern](https://en.wikipedia.org/wiki/Glob_%28programming%29)).
112
+
via a regular expression (_not_ a [glob pattern](https://en.wikipedia.org/wiki/Glob_%28programming%29)).
117
113
Examples include `--ignore=\.gitignore` or `--ignore="\.git(ignore|modules)"`.
118
114
119
115
#### Example
120
116
121
-
Let's assume that you have made an app based on the [minimal-repro](https://github.com/electron/minimal-repro) repository on a macOS host platform with the following file structure:
117
+
Let's assume that you have made an app based on the [minimal-repro](https://github.com/electron/minimal-repro)
118
+
repository on an Apple Silicon macOS device with the following file structure:
122
119
123
-
```
120
+
```plaintext
124
121
foobar
125
122
├── package.json
126
123
├── index.html
@@ -130,30 +127,30 @@ foobar
130
127
131
128
…and that the following is true:
132
129
133
-
*`@electron/packager` is installed locally
134
-
*`productName` in `package.json` has been set to `Foo Bar`
135
-
* The `electron` module is in the `devDependencies` section of `package.json`, and set to the exact version of `1.4.15`.
136
-
*`npm install` for the `Foo Bar` app has been run at least once
130
+
-`@electron/packager` is installed locally
131
+
-`productName` in `package.json` has been set to `Foo Bar`
132
+
- The `electron` module is in the `devDependencies` section of `package.json`, and set to the exact version of `38.3.0`.
133
+
-`npm install` for the `Foo Bar` app has been run at least once
137
134
138
135
When one runs the following command for the first time in the `foobar` directory:
139
136
140
-
```
137
+
```plaintext
141
138
npx @electron/packager .
142
139
```
143
140
144
141
`@electron/packager` will do the following:
145
142
146
-
* Use the current directory for the `sourcedir`
147
-
* Infer the `appname` from the `productName` in `package.json`
148
-
* Infer the `appVersion` from the `version` in `package.json`
149
-
* Infer the `platform` and `arch` from the host, in this example, `darwin` platform and `x64` arch.
150
-
* Download the darwin x64 build of Electron 1.4.15 (and cache the downloads in `~/.electron`)
151
-
* Build the macOS `Foo Bar.app`
152
-
* Place `Foo Bar.app` in `foobar/Foo Bar-darwin-x64/` (since an `out` directory was not specified, it used the current working directory)
143
+
- Use the current directory for the `sourcedir`
144
+
- Infer the `appname` from the `productName` in `package.json`
145
+
- Infer the `appVersion` from the `version` in `package.json`
146
+
- Infer the `platform` and `arch` from the host, in this example, `darwin` platform and `arm64` arch.
147
+
- Download the darwin arm64 build of Electron 38.3.0 (and cache the downloads in `~/.electron`)
148
+
- Build the macOS `Foo Bar.app`
149
+
- Place `Foo Bar.app` in `foobar/Foo Bar-darwin-arm64/` (since an `out` directory was not specified, it used the current working directory)
153
150
154
151
The file structure now looks like:
155
152
156
-
```
153
+
```plaintext
157
154
foobar
158
155
├── Foo Bar-darwin-x64
159
156
│ ├── Foo Bar.app
@@ -167,35 +164,35 @@ foobar
167
164
└── script.js
168
165
```
169
166
170
-
The `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.
167
+
The `Foo Bar.app` folder generated can be executed by a system running macOS, which will start the packaged Electron app.
168
+
This is also true of the Windows x64 build on a Windows device (via `Foo Bar-win32-x64/Foo Bar.exe`), and so on.
171
169
172
170
## Related
173
171
174
172
-[Electron Forge](https://github.com/electron/forge) - creates, builds, and distributes modern Electron applications
175
-
-[electron-packager-interactive](https://github.com/Urucas/electron-packager-interactive) - an interactive CLI for electron-packager
176
-
-[grunt-electron](https://github.com/sindresorhus/grunt-electron) - grunt plugin for electron-packager
177
173
178
174
### Distributable Creators
179
175
180
-
*[electron-installer-zip](https://github.com/electron-userland/electron-installer-zip) - creates symlink-compatible ZIP files
176
+
-[electron-installer-zip](https://github.com/electron-userland/electron-installer-zip) - creates symlink-compatible ZIP files
181
177
182
178
Windows:
183
179
184
-
*[electron-winstaller](https://github.com/electron/windows-installer) - Squirrel.Windows-based installer from the Electron maintainers group
185
-
*[electron-windows-store](https://github.com/felixrieseberg/electron-windows-store) - creates an AppX package for the Windows Store
186
-
*[electron-wix-msi](https://github.com/felixrieseberg/electron-wix-msi) - creates traditional MSI installers
187
-
*[electron-installer-windows](https://github.com/electron-userland/electron-installer-windows) - alternative Squirrel.Windows-based installer
180
+
-[electron-winstaller](https://github.com/electron/windows-installer) - Squirrel.Windows-based installer from the Electron maintainers group
181
+
-[electron-windows-msix](https://github.com/electron-userland/electron-windows-msix) - creates an MSIX package
182
+
-[electron-windows-store](https://github.com/electron-userland/electron-windows-store) - creates an AppX package for the Windows Store
183
+
-[electron-wix-msi](https://github.com/electron-userland/electron-wix-msi) - creates traditional MSI installers
184
+
-[electron-installer-windows](https://github.com/electron-userland/electron-installer-windows) - alternative Squirrel.Windows-based installer
188
185
189
186
macOS:
190
187
191
-
*[electron-installer-dmg](https://github.com/electron-userland/electron-installer-dmg) - creates a DMG
188
+
-[electron-installer-dmg](https://github.com/electron-userland/electron-installer-dmg) - creates a DMG
192
189
193
190
Linux:
194
191
195
-
*[electron-installer-debian](https://github.com/electron-userland/electron-installer-debian) - creates a DEB file
196
-
*[electron-installer-redhat](https://github.com/electron-userland/electron-installer-redhat) - creates an RPM
197
-
*[electron-installer-flatpak](https://github.com/endlessm/electron-installer-flatpak) - creates a Flatpak file
198
-
*[electron-installer-snap](https://github.com/electron-userland/electron-installer-snap) - creates a Snap file
192
+
-[electron-installer-debian](https://github.com/electron-userland/electron-installer-debian) - creates a DEB file
193
+
-[electron-installer-redhat](https://github.com/electron-userland/electron-installer-redhat) - creates an RPM
194
+
-[electron-installer-flatpak](https://github.com/endlessm/electron-installer-flatpak) - creates a Flatpak file
195
+
-[electron-installer-snap](https://github.com/electron-userland/electron-installer-snap) - creates a Snap file
0 commit comments