I'm creating multiplatform native app in Ionic and Cordova using Angular.
When app is compiled for windows I'm using Electron (v4) and electron-builder.
I have my electron app installed a few times in different folders and I would like for each installation to use a separate userData directory.
I've tried using app.setPath('userData', '{INSTALL_DIR}/data') in preload script and in cordova custom plugin, but those approaches don't work properly cause it is executed after app.ready event has been fired.
Placing above code in electron main process in cdv-electron-main.js works perfectly but it's a very bad workaround (in addition not recommended in Cordova Electron docs).
I also think that I can't use flag --user-data-dir, because I have a custom electron settings file defined in cordova config.xml.
Do you have any ideas how to change userData directory before app.ready event fired without modifying electron main process?