0

I've been searching around but have not been able to find an answer.

How do I package my electron app with the --asar option but allow certain sub-directories to be seen ? For example my app will use a sub-directory called data so users can copy textfiles to it for processing. I did see something call unpack but it wasn't very clear how to use it.

thanks in advance,

Don

Don
  • 11
  • 1
  • 4
  • The asar file is read-only. Example of reading from it. $.get('file:///path/to/example.asar/file.txt', (data) => { console.log(data) }) – Hassan Voyeau Oct 05 '18 at 14:49
  • Possible duplicate of [ASAR: how to unpack a .asar file?](https://stackoverflow.com/questions/38523617/asar-how-to-unpack-a-asar-file) – Hassan Voyeau Oct 05 '18 at 14:52

1 Answers1

0

Solved......

For some reason when you package with the --asar option the electron-packager can't figure out a working directory even while executing it's code. So.... if you put data within the application directory packaging will archive your data with everything else making them read only. Even adding new files to the resource directory doesn't work.

I simply created a separate directory from my application directory and pointed my fs functions to point to that.

Don
  • 11
  • 1
  • 4