mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Merge pull request #224 from danielgronberg/danielgronbergmaster
RTC-2648: Added arguments for allowing multi instance and custom data dir
This commit is contained in:
12
js/main.js
12
js/main.js
@@ -66,8 +66,10 @@ const shouldQuit = app.makeSingleInstance((argv) => {
|
||||
processProtocolAction(argv);
|
||||
});
|
||||
|
||||
// quit if another instance is already running, ignore for dev env
|
||||
if (!isDevEnv && shouldQuit) {
|
||||
let allowMultiInstance = getCmdLineArg(process.argv, '--multiInstance', true) || isDevEnv;
|
||||
|
||||
// quit if another instance is already running, ignore for dev env or if app was started with multiInstance flag
|
||||
if (!allowMultiInstance && shouldQuit) {
|
||||
app.quit();
|
||||
}
|
||||
|
||||
@@ -155,6 +157,12 @@ function setupThenOpenMainWindow() {
|
||||
// allows installer to launch app and set appropriate global / user config params.
|
||||
let hasInstallFlag = getCmdLineArg(process.argv, '--install', true);
|
||||
let perUserInstall = getCmdLineArg(process.argv, '--peruser', true);
|
||||
let customDataArg = getCmdLineArg(process.argv, '--userDataPath=', false);
|
||||
|
||||
if (customDataArg && customDataArg.split('=').length > 1) {
|
||||
let customDataFolder = customDataArg.split('=')[1];
|
||||
app.setPath('userData', customDataFolder);
|
||||
}
|
||||
if (!isMac && hasInstallFlag) {
|
||||
getConfigField('launchOnStartup')
|
||||
.then(setStartup)
|
||||
|
||||
Reference in New Issue
Block a user