add modules to electron export, fix issues when downloading updates

This commit is contained in:
2024-01-18 12:43:46 +01:00
parent 6369c0e8af
commit 6aa0a6c969
17 changed files with 338 additions and 162 deletions

20
electron/executeUtil.js Normal file
View File

@@ -0,0 +1,20 @@
const childProcess = require("child_process");
const runFile = (folder, file, args, onExit) => {
childProcess.execFile(file, args, {
cwd: folder
}, (_err, _stdout, _stdin) => {
if (onExit) onExit();
})
}
const runFileDetached = (folder, file, args) => {
const subProcess = childProcess.spawn(file + (args ? " " + args : ''), {
cwd: folder,
detached: true,
stdio: 'ignore'
});
subProcess.unref();
}
module.exports = { runFile, runFileDetached };