packager icon indicating copy to clipboard operation
packager copied to clipboard

`--asar` should be enabled by default

Open sindresorhus opened this issue 10 years ago • 13 comments

I don't see why you wouldn't want those and I think most do. We could instead have --no-asar and --no-prune flags. I much prefer us to have sane defaults, which means less config mess for users.

sindresorhus avatar May 18 '15 21:05 sindresorhus

I support both of these as defaults

junosuarez avatar May 18 '15 22:05 junosuarez

i had seen a lot of open issues involving asar on the electron repo since it's relatively new. but if we think its bug-free now then i'm good with it

max-mapper avatar May 18 '15 22:05 max-mapper

I don't think it's bug free, but it's pretty stable now, and Atom is using it so any issue will be fixed fast.

sindresorhus avatar May 18 '15 22:05 sindresorhus

aside: as someone who just had to leave their computer on overnight copying over a large ~/dev directory full of hundreds of thousands of files from node_modules directory trees on a faulty SSD, I kinda wish a certain software platform would move to archive-based dependencies, too :)

junosuarez avatar May 18 '15 23:05 junosuarez

Only bad part of this is you'll have to re-install when you prune. Here's what I'm doing:

# make a regex of node_modules to ignore
ignores=`npm ls --dev --parseable`
# get the package name
ignores=$(echo $ignores | sed -e 's@.*/@@')
# skip the first line
ignores=`echo $ignores | awk '{if(NR > 1) print $0}'`
# join with a pipe
ignores=${ignores//$'\n'/'|'}

# build mac distibutable app
./node_modules/.bin/electron-packager . "Dev Tool" \
  --platform=darwin --arch=x64 --version=0.35.6 \
  --ignore=\"$ignores\" \
  --app-bundle-id "com.dev-too.appl" --app-version 0.1.0 \
  --out ./built

ccorcos avatar Feb 29 '16 19:02 ccorcos

zsh: command too long :(

ccorcos avatar Feb 29 '16 19:02 ccorcos

if you pass the --prune flag to electron-packager it prunes for you in its tmpdir copy, which doesnt affect your source folder

max-mapper avatar Feb 29 '16 19:02 max-mapper

well then there we go!

ccorcos avatar Feb 29 '16 20:02 ccorcos

I have no problem with making prune default to true.

The main problem I have with making asar default to true is that as soon as that gets released, there is going to be an influx of issues filed on electron-packager with "module not found" errors when people use native extensions. Or really, any exception listed in the Electron docs.

malept avatar Jul 13 '16 14:07 malept

I mentioned this issue in Electron's Slack channel a few weeks ago. Paul Betts mentioned that the way to handle my concerns about making asar true by default is to make sure that all shared libraries (.dll, .so, .dylib, .node) are backlisted from being packed by default. If someone implements that plus writes the appropriate amount of documentation (we may have to start a docs/faq.md), then I think I will be :+1: with moving forward.

malept avatar Oct 10 '16 20:10 malept

@malept @sindresorhus @maxogden sorry to bother you all...

Was anything ever done re this one?

I have a proper ball ache of an issue where my packaged electron app fails to find react in any of my installed dependencies (react-player, react-countup, prismic-reactjs etc).

could anyone offer any advice?

Aid19801 avatar Feb 02 '20 09:02 Aid19801

Was anything ever done re this one?

This issue is flagged "help wanted" and is still open.

could anyone offer any advice?

If you need assistance, please use one of the community forums.

malept avatar Feb 06 '20 17:02 malept

asar packaging produces broken icon in about window on linux platform: https://github.com/electron/electron/issues/23850

mahnunchik avatar Jun 25 '20 13:06 mahnunchik