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:
Kiran Niranjan 2022-10-06 08:17:59 +05:30 committed by GitHub
parent 712457d5d8
commit 2dbe0e997e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 11 deletions

View File

@ -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

View File

@ -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'),
);

View File

@ -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;