Cannot get `asar-unpack` to work
See original GitHub issueOur Electron app uses convert
from ImageMagick, and that needs some .xml files alongside the binary. Our electron folder ends up looking like this:
public/
βββ external/
βΒ Β βββ colors.xml
βΒ Β βββ convert
βΒ Β βββ delegates.xml
βΒ Β βββ magic.xml
βββ app.css
βββ app.js
βββ electron-main.js
βββ index.html
βββ package.json
βββ vendor.js
Iβm able to run asar pack public/ public.asar --unpack 'public/external/*'
and get both public.asar
and public.asar.unpacked
, but I cannot for the life of me figure out the path to be passed via build.asar-unpack
in the development package.json
.
Iβve tried β¦
"build": {
"asar-unpack": "public/external/*"
}
"build": {
"asar-unpack": "external/*"
}
"build": {
"asar-unpack": "app/external/*"
}
"build": {
"asar-unpack": "*/external/*"
}
"build": {
"asar-unpack": "dist/ProductName-darwin-x64/Electron.app/Contents/Resources/app/external/*"
}
β¦ But am not able to get app.asar.unpacked
. Is there anything Iβm missing?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Why does my electron app doesn't launch after packaging?
To me it looks like that your build does include native addons (*.node). In electron-packager the solution was to add the asar unpack...
Read more >PlatformSpecificBuildOptions - electron-builder
Node modules, that must be unpacked, will be detected automatically, you don't need to explicitly set asarUnpack - please file an issue if...
Read more >ASAR Archives - Electron
The archives can not be modified so all Node APIs that can modify files will not work with ASAR archives. Working Directory Can...
Read more >Application Packaging | Electron
Most users will get this feature for free, since it's supported out of the box by ... Working Directory Can Not Be Set...
Read more >Can't launch ffmpeg in sandboxed electron app
//Get the paths to the packaged versions of the binaries we want to use. var ffmpegPath = require('ffmpeg-static-electron').path;.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you @mikew for also sharing your answer. In 2018 this worked:
Successfully get this once the dmg is installed:
Now the tricky part is referring to it from within your app :trollface: This
hazardous
workaround seems to work with basically 1 line of code: https://github.com/electron/electron/issues/6262#issuecomment-273312942Ah, figured it out. Using a globstar works, and no matter your directory structure, your files will be under
app/
. The following works: