Enable SA data to be stored in user documents folder

This commit is contained in:
NAmorim committed 2021-10-21 18:44:42 +01:00
1 parent 6680d4495c
commit 7d7be12a48
3 files changed
+9 -12

No files matched your search

+3 -6
View File
@@ -8,6 +8,7 @@ const {autoUpdater} = require("electron-updater")
// Enable non contribution mode (test)
process.env.SA_MODE = 'gitDisable'
process.env.PACKAGED_PATH = app.getAppPath()
process.env.DATA_PATH = app.getPath('documents')
const WINDOW_WIDTH = null
const WINDOW_HEIGHT = null
@@ -22,12 +23,8 @@ const port = 34248 // Default HTTP port
run()
function run() {
if (process.env.PORTABLE_EXECUTABLE_DIR) {
process.env.PORTABLE_USER_DOCUMENTS = app.getPath("userData")
}
const { fork } = require('child_process')
const platform = fork(path.join(__dirname, '/PlatformRoot.js'), ["noBrowser"], {stdio: ['pipe', 'pipe', 'pipe', 'ipc']})
const platform = fork(path.join(__dirname, '/PlatformRoot.js'), ["noBrowser"], {stdio: ['pipe', 'pipe', 'pipe', 'ipc'], env: process.env})
platform.on('message', message => {
if(message == "Running") {
open()
@@ -38,7 +35,7 @@ function run() {
function open () {
let bw_options = {
width: WINDOW_WIDTH ? WINDOW_WIDTH : 1280,
height: WINDOW_HEIGHT ? WINDOW_HEIGHT : 720,
height: WINDOW_HEIGHT ? WINDOW_HEIGHT : 768,
resizable: true
}