I am currently utilizing electron-store version 5.2.0 in my Angular project and I am seeking assistance in locating the path or understanding how to retrieve the path when using store.get("userOptionOptOut").
Within app.component.ts:
const Store = (window as any).require('electron-store');
const store = new Store();
const { ipcRenderer } = window.require('electron');
In the constructor of app.component.ts:
If(store.get('userOptionOptOut') !== undefined) {
this.userOptionOptOut = store.get('userOptionOptOut');
this.settingService.patchSettingBySettingPath(this.dataCollectionSetting, this.userOptionOptOut);
}
I have a config.json file located at C:\Users\XXXX\AppData\Roaming\XXXX\XXXX\AppConfig\AppName which stores the settings:
{
"userOptionOptOut": "On"
}
However, I encountered an error (View image below) while trying to verify the path, so I included the following code:
const { app } = window.require('electron');
console.log(app.getAppPath());
console.log(app.getPath("userData"));
console.log(app.getPath("appData"));