The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Zaher (4) [Avatar] Offline
#1
Hey,

Am not sure if this topic has been covered on the book or not yet, so please excuse me if its not yet.
when you package your app with electron, you have the option to use asar to create an archive file that concatenates the apps files into a single file.

am still lost here, why do we need to use it? at the end the user will be able to extract it plus it ads not much value for the size of the app, thats if we ignore the fact the electron itself will not be able to write on it so some of your file should be extracted elsewhere for electron to have write access to it.

this point is still fuzzy to me, so it would be nice if we can cover it here or much better in the book if its not yet .

thanks
paulbjensen (39) [Avatar] Offline
#2
Hi,

ASAR is covered in Chapter 11 of the book as an option for the you want to start preparing builds of your desktop application as standalone executables for the various Operating Systems.

ASAR is a bit like a zip file or a tarball of your application's files. It solves these issues:

- Failing to load application files due to Microsoft Windows' 256 character limit on file paths.
- When creating a build of your application, it simplifies having to copy source code in lots of files by having it all in 1 ASAR archive file.
- It's a form of protecting your application's source by obfuscation. Instead of seeing the raw source code of your application when inspecting the application's files, they will see the archive file. Please note though that this won't prevent them from being able to eventually get access to the source code, as they could simply download an ASAR parser and read the source code that way.

In summary, ASAR is a single file achieve of your application's source code that is easy to drop into Electron builds.
Zaher (4) [Avatar] Offline
#3
so its not that much of a protection, that its just to make the life easier for the developer and to make working with multi platform easier ..

thanks for the help, will do my best to finish the book asap smilie

thanks again for the nice work