mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-11-21 16:38:41 -06:00
SDA-3913 (Set up first time launch for auto updated version) (#1513)
* SDA-3913 - Set up first time launch for auto updated version * SDA-3913 - Read temp global config file and fix installer.nsh file
This commit is contained in:
parent
712457d5d8
commit
2dbe0e997e
@ -25,8 +25,8 @@ FunctionEnd
|
||||
!macroend
|
||||
|
||||
!macro copyLocalGlobalConfig
|
||||
IfFileExists $LOCALAPPDATA\Symphony\Symphony\config\Symphony.config 0 +2
|
||||
CopyFiles /SILENT $LOCALAPPDATA\Symphony\Symphony\config\Symphony.config $WINDIR\Temp\temp-local-Symphony.config
|
||||
IfFileExists $LOCALAPPDATA\Programs\Symphony\Symphony\config\Symphony.config 0 +2
|
||||
CopyFiles /SILENT $LOCALAPPDATA\Programs\Symphony\Symphony\config\Symphony.config $WINDIR\Temp\temp-local-Symphony.config
|
||||
!macroend
|
||||
|
||||
!macro replaceSystemGlobalConfig
|
||||
@ -36,7 +36,7 @@ FunctionEnd
|
||||
|
||||
!macro replaceLocalGlobalConfig
|
||||
IfFileExists $WINDIR\Temp\temp-local-Symphony.config 0 +2
|
||||
CopyFiles /SILENT $WINDIR\Temp\temp-local-Symphony.config $PROGRAMFILES64\Symphony\Symphony\config\Symphony.config
|
||||
CopyFiles /SILENT $WINDIR\Temp\temp-local-Symphony.config $LOCALAPPDATA\Programs\Symphony\Symphony\config\Symphony.config
|
||||
!macroend
|
||||
|
||||
!macro bothM
|
||||
|
@ -402,6 +402,7 @@ class Config {
|
||||
filteredFields.buildNumber = buildNumber;
|
||||
filteredFields.installVariant = this.installVariant;
|
||||
filteredFields.bootCount = 0;
|
||||
filteredFields.startedAfterAutoUpdate = false;
|
||||
logger.info(
|
||||
`config-handler: setting first time launch for build`,
|
||||
buildNumber,
|
||||
@ -413,6 +414,7 @@ class Config {
|
||||
buildNumber,
|
||||
installVariant: this.installVariant,
|
||||
bootCount: this.bootCount,
|
||||
startedAfterAutoUpdate: false,
|
||||
});
|
||||
}
|
||||
|
||||
@ -579,10 +581,9 @@ class Config {
|
||||
this.userConfig &&
|
||||
(this.userConfig as IConfig).startedAfterAutoUpdate
|
||||
) {
|
||||
await this.updateUserConfig({
|
||||
installVariant: this.installVariant,
|
||||
startedAfterAutoUpdate: false,
|
||||
});
|
||||
// Update config as usual
|
||||
await this.setUpFirstTimeLaunch();
|
||||
// Skip welcome screen
|
||||
this.isFirstTime = false;
|
||||
return;
|
||||
}
|
||||
@ -706,6 +707,20 @@ class Config {
|
||||
`Global config file missing! App will not run as expected!`,
|
||||
);
|
||||
}
|
||||
if (fs.existsSync(this.tempGlobalConfigFilePath)) {
|
||||
this.globalConfig = this.parseConfigData(
|
||||
fs.readFileSync(this.tempGlobalConfigFilePath, 'utf8'),
|
||||
);
|
||||
logger.info(
|
||||
`config-handler: temp global config exists using this file: `,
|
||||
this.tempGlobalConfigFilePath,
|
||||
this.globalConfig,
|
||||
);
|
||||
if (isMac) {
|
||||
this.copyGlobalConfig();
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.globalConfig = this.parseConfigData(
|
||||
fs.readFileSync(this.globalConfigPath, 'utf8'),
|
||||
);
|
||||
|
@ -13,7 +13,6 @@ import {
|
||||
IApiArgs,
|
||||
INotificationData,
|
||||
} from '../common/api-interface';
|
||||
import { isMac } from '../common/env';
|
||||
import { i18n, LocaleType } from '../common/i18n';
|
||||
import { logger } from '../common/logger';
|
||||
import { activityDetection } from './activity-detection';
|
||||
@ -353,9 +352,6 @@ ipcMain.on(
|
||||
break;
|
||||
case apiCmds.setPodUrl:
|
||||
await config.updateUserConfig({ url: arg.newPodUrl });
|
||||
if (isMac) {
|
||||
config.copyGlobalConfig();
|
||||
}
|
||||
app.relaunch();
|
||||
app.exit();
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user