Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Electron modify file store in .asar

I would like, from the Electron index.html file, to modify a config file present in the .asar of my application. In my case I need to change, if necessary, my application database config in order to work.

I understood that .asar is in readOnly and I wanted to know if there is a way to modify this config file from Electron without changing its position in my application?

I see the extraResources option but I did not understand how it works.

It's also important that the config file stay in myapp/config folder.

Thanks for your help :)

like image 949
Syno Avatar asked Feb 24 '26 09:02

Syno


1 Answers

What build tool do you use? If you are using electron builder, you can check out asarUnpack in configuration file here or extraFiles here

like image 103
Hai Pham Avatar answered Feb 25 '26 21:02

Hai Pham