electron-packager | Electron app with OS-specific bundles ( .app , .exe , etc | Runtime Evironment library
kandi X-RAY | electron-packager Summary
kandi X-RAY | electron-packager Summary
Electron Packager is a command line tool and Node.js library that bundles Electron-based application source code with a renamed Electron executable and supporting files into folders ready for distribution. For creating distributables like installers and Linux packages, consider using either Electron Forge (which uses Electron Packager internally), or one of the related Electron tools, which utilizes Electron Packager-created folders as a basis. Note that packaged Electron applications can be relatively large. A zipped, minimal Electron application is approximately the same size as the zipped prebuilt binary for a given target platform, target arch, and Electron version (files named electron-v${version}-${platform}-${arch}.zip).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Filter a JSON bundle identifier for the given key .
electron-packager Key Features
electron-packager Examples and Code Snippets
var icebox = require('ice-box')('./ice-box')
var packager = require('electron-packager')
var src = process.argv[2]
icebox(function (dst, done) {
packager({
dir: src, // use the input dir, 'src'
arch: 'x64',
platform: 'linux',
ou
npm run production
electron-packager ./ --name=treex --version=1.1.1 --no-prune --icon=./assets/logo/treex-square.png.icns
electron-packager --platform= --arch= [optional flags...]
electron-packager . ISS-Live-Locator --platform=win32 --arch=x64 --electronVersion=10.1.1
Operating System - Linux(5.3.11-300.fc31.x86_64) - linux/x64
NodeJs - 12.13.0
Global packages
NPM - 6.12.0
yarn - 1.17.3
@quasar/cli - 1.0.0-beta.2
cordova - Not installed
Important local packages
quasar - 1.4.5 -- Build high-p
sudo chown root: root chrome-sandbox
sudo chmod 4755 chrome-sandbox
1. npm install ngx-electron electron
2. npm install electron-packager --save-dev
3. ionic build
4. npx cap add electron
5. ionic build &&
electron-packager ./ --platform=win32 --arch=x64 --electron-version=8.2.3 --out=electron_build --overwrite --ignore="^.*\.py" --ignore="\/node_modules" --ignore="\/tests"
buildPath (String): The path to the temporary folder where your app has been copied to
electronVersion (String): The version of electron you are packaging for
platform (String): The target platform you are packaging for
arch (String): The
npm install -g electron-packager
npm install -D electron-packager
npx electron-packager .
./node_modules/electron-packager/cli.js
FROM node:10
RUN dpkg --add-architecture i386 && apt-get update && apt-get install wine wine32 -y
RUN npm install electron-packager -g
VOLUME /electron
WORKDIR /electron
Community Discussions
Trending Discussions on electron-packager
QUESTION
I was trying to package an Electron applicationusing electron-packager but get this error:
...ANSWER
Answered 2022-Mar-24 at 06:09This is a duplicate of GLOBAL_AGENT.HTTP_PROXY not letting me build Electron Pacakge
All you need to do is: npm update
QUESTION
Actualy I try to intgrat but I face to this exception my node version is 16.3.2 32bit
...ANSWER
Answered 2022-Mar-17 at 08:03SOLVED BY @chilkat Software by upgrading the current version of chilkat/ck-electron16-win64 and win32
QUESTION
the problem
...ANSWER
Answered 2022-Mar-15 at 02:40Actually this is a bug, has been fixed 5 hours ago (Mar 14, 2022, 9:55 PM GMT)
GLOBAL_AGENT.HTTP_PROXY configuration value: URL protocol must be http
Just do:
QUESTION
I trying to build an electron with an exe installer on macOS with a MacBook Pro with an m1. I already tried different packages like electron-packager, electron-forge, but unfortunately, none of my tries worked. Did anyone has a solution to build an electron version with an exe on macOS. My latest approach looked like, but when I start and after more then 30 minute it still do no finish.
yarn run electron-forge make --arch=x64 --platform=win32
The current code could be found here.
...ANSWER
Answered 2022-Mar-09 at 09:15We using electron-builder for packaging electron app on Windows&MacOS(x86_x64/arm etc.), and you can try it.
add some config in package.json, like this:
QUESTION
I've been trying to "package" my Electron Application, using the below script, however when the .exe
is created and I try to run said .exe
I end up with an error listed below.
I feel very stupid asking this; but what is the issue causing this as this is the first time experiencing Electron, ive read through countless documents, stackoverflow questions in relation to my issue with no avail.
Script ...ANSWER
Answered 2022-Feb-21 at 01:38electron-packager
's prune
option removes any packages from the final bundle that are listed in the devDependencies
section.
Since axios
is listed there, it is removed from the bundle.
You should put it into the dependencies
section and rebuild the bundle.
QUESTION
When running my Electron project normally, like electron ./artist-test-kit-main.js
, everything works fine. When I build the project into an executable, attempts to load files start failing, like: Uncaught Error: ENOENT: no such file or directory, open 'asset-editor\data.json'
So I ran a test to see if there's a difference in the root directory between the normal (electron ./artist-test-kit-main.js
) execution and the .exe's.
Within index.js
(launched by index.html
, launched by artist-test-kit-main.js
which is a standard electron.js initiator file):
ANSWER
Answered 2022-Feb-13 at 05:18Use __dirname
instead of .
.
refers to the current working directory (cwd), which is the directory in which the node process was started.
For an unpackaged app, this is usually the root folder of your project, producing the expected results. For a packaged app, the cwd will likely be where the Electron executable is stored. The app's contents (what was previously the root folder) are put inside resources/app
or resources/app.asar
relative to the executable.
The way to unify the packaged and unpackaged scenarios is to use __dirname
, which contains the directory of the currently running Node script. This way, it will be the same as using .
in an unpackaged app, but will return the path with resources/app
in the packaged scenario, as that is then the location of the currently running Node script.
This is why you'll often see people using something like `file://${__dirname}/assets/index.html`
to address files in Electron.
If you use require('./file.js')
, the path is evaluated relative to the location of the calling script and will work as if you had used __dirname
.
QUESTION
I have created an electron app consisting a sound effect. I am using the package sound-play
to play the sound effect in my main.js
file (learned from here). It is working as it should when I am running it through npm start
. But after packaging my app using electron-packager
, when I am running the exe file from "release-builds" folder, only the sound effect is not playing. All other aspects of the app are working fine.
Shutter.mp3 is the sound file which is present in the project directory
Main.js:
...ANSWER
Answered 2021-Aug-31 at 06:26Edit: Similar to the electron-builder solution I listed below, I searched the electron-packager doc and found a similar option for extra files, instead of "files" you will use "extraResource", check it out in the docs.
Original answer:
If you are using webpack to bundle your app before packaging, see if you can include it in your Javascript file and have a file loader in your webpack explained here(blog site), here (Stack overflow), and of course here (webpack official) . Be sure to install File-loader!
I prefer to use Electron builder for packaging apps, if you were to switch, you could include the file into your packaged app as follows:
List the audio file in your JSON settings (package.json) to be included in your packager e.g.:
QUESTION
I have an electron app that works when running locally, but when creating an executable it cannot find a module (JSON file) and I'm not sure why.
The error I get is "Uncaught Exception" Cannot find module './data/background/background.json' Require Sack :
...ANSWER
Answered 2021-Aug-20 at 22:36I think your problem is the --asar
option.
Because you have this option turned on electron-packager
will package your source code into an app.asar
file including your data
folder.
Because your data
folder has now been compressed with all your other source code into this app.asar
file your code can no longer access it.
Solution 1:
- Take out:
--asar
Solution 2:
- Add this option:
--extra-resource=\"./data\"
- This'll tell
electron-packager
not to include./data
in theapp.asar
.
QUESTION
ANSWER
Answered 2021-Jul-31 at 02:09I had similar issue, so I put icon in root project. change build script into something like this. It solved the problem.
calculator.png is in root project.
QUESTION
I'm trying to solve a problem about the electron.
It doesn't show any image coming from a css file, on the other hand, it can show it normally in a previous version, without compiling the application.
How my project is organized.
main.js file (I hid some useless information "width, height...")
...ANSWER
Answered 2021-Jul-27 at 19:51Packaging apps always messes with the file paths.
Just use relative file paths.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install electron-packager
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page