-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDA-4182: Add GPOs to auto update channel #1896
Conversation
} else if (isWindowsOS) { | ||
this.autoUpdater = new NsisUpdater(opts); | ||
} | ||
this.getGenericServerOptions().then((opts) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only for Windows
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes windows-only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I think you need to wrap RegistryStore.getRegistry
and retrieveWindowsRegistry
inside isWindowsOS
src/app/auto-update-handler.ts
Outdated
? 'beta' | ||
: autoUpdateChannel; | ||
|
||
const registryAutoUpdate = RegistryStore.getRegistry(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also for Windows
only
src/app/auto-update-handler.ts
Outdated
@@ -221,16 +237,24 @@ export class AutoUpdate { | |||
return updateUrl; | |||
}; | |||
|
|||
private getGenericServerOptions = (): GenericServerOptions => { | |||
private getGenericServerOptions = async (): Promise<GenericServerOptions> => { | |||
await retrieveWindowsRegistry(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also for Windows
only
38760ce
to
cd8fd61
Compare
src/app/auto-update-handler.ts
Outdated
const registryAutoUpdate = RegistryStore.getRegistry(); | ||
const identifiedChannel = [ | ||
EChannelRegistry.BETA, | ||
EChannelRegistry.LATEST, | ||
].includes(registryAutoUpdate.currentChannel) | ||
? registryAutoUpdate.currentChannel | ||
: ''; | ||
const finalAutoUpdateChannel = | ||
isWindowsOS && identifiedChannel | ||
? identifiedChannel | ||
: autoUpdateChannel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const registryAutoUpdate = RegistryStore.getRegistry(); | |
const identifiedChannel = [ | |
EChannelRegistry.BETA, | |
EChannelRegistry.LATEST, | |
].includes(registryAutoUpdate.currentChannel) | |
? registryAutoUpdate.currentChannel | |
: ''; | |
const finalAutoUpdateChannel = | |
isWindowsOS && identifiedChannel | |
? identifiedChannel | |
: autoUpdateChannel; | |
let finalAutoUpdateChannel = autoUpdateChannel; | |
if (isWindowsOS) { | |
const registryAutoUpdate = RegistryStore.getRegistry(); | |
const identifiedChannel = [ | |
EChannelRegistry.BETA, | |
EChannelRegistry.LATEST, | |
].includes(registryAutoUpdate.currentChannel) | |
? registryAutoUpdate.currentChannel | |
: ''; | |
if (identifiedChannel) { | |
finalAutoUpdateChannel = identifiedChannel; | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on minor change and it LGTM
cd8fd61
to
5431fae
Compare
src/app/auto-update-handler.ts
Outdated
? registryAutoUpdate.currentChannel | ||
: ''; | ||
const channel = | ||
isWindowsOS && identifiedChannel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isWindowsOS
not needed here
src/app/auto-update-handler.ts
Outdated
await retrieveWindowsRegistry(); | ||
|
||
const registryAutoUpdate = RegistryStore.getRegistry(); | ||
const identifiedChannel = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const identifiedChannel = [ | |
const identifiedChannelFromRegistry = [ |
src/app/auto-update-handler.ts
Outdated
isWindowsOS && identifiedChannel | ||
? identifiedChannel | ||
: autoUpdateChannel; | ||
userAutoUpdateChannel = betaAutoUpdateChannelEnabled ? 'beta' : channel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPO has a higher prio than ACP (betaAutoUpdateChannelEnabled), so normally it should be like:
userAutoUpdateChannel = identifiedChannelFromRegistry ? identifiedChannelFromRegistry : betaAutoUpdateChannelEnabled ? 'beta' : channel;
5431fae
to
5620b71
Compare
5620b71
to
b484536
Compare
b484536
to
7c8fd05
Compare
} | ||
if (isMac) { | ||
config.backupGlobalConfig(); | ||
const { autoUpdateChannel } = config.getConfigFields([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated logic here, I would rather put it in a dedicated function that would return the channel.
IMO this function should be called directly in
this.autoUpdater.on('update-available', (info) => { ... })
this.autoUpdater.on('download-progress', (info) => { ... })
this.autoUpdater.on('update-downloaded', (info) => { ... })
Description
Auto-update params defined via GPOs
Read channel from registry and apply to SDA
Related PRs