/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { isWeb, isWindows } from '../../../base/common/platform.js'; import { PolicyCategory } from '../../../base/common/policy.js'; import { localize } from '../../../nls.js'; import { ConfigurationScope, Extensions as ConfigurationExtensions, IConfigurationRegistry } from '../../configuration/common/configurationRegistry.js'; import { Registry } from '../../registry/common/platform.js'; const configurationRegistry = Registry.as(ConfigurationExtensions.Configuration); configurationRegistry.registerConfiguration({ id: 'update', order: 15, title: localize('updateConfigurationTitle', "Update"), type: 'object', properties: { 'update.mode': { type: 'string', enum: ['none', 'manual', 'start', 'default'], default: 'default', scope: ConfigurationScope.APPLICATION, description: localize('updateMode', "Configure whether you receive automatic updates. The updates are fetched from a Microsoft online service."), tags: ['usesOnlineServices'], enumDescriptions: [ localize('none', "Disable updates."), localize('manual', "Disable automatic background update checks. Updates will be available if you manually check for updates."), localize('start', "Check for updates only on startup. Disable automatic background update checks."), localize('default', "Enable automatic update checks. Code will check for updates automatically and periodically.") ], policy: { name: 'UpdateMode', category: PolicyCategory.Update, minimumVersion: '1.67', localization: { description: { key: 'updateMode', value: localize('updateMode', "Configure whether you receive automatic updates. The updates are fetched from a Microsoft online service."), }, enumDescriptions: [ { key: 'none', value: localize('none', "Disable updates."), }, { key: 'manual', value: localize('manual', "Disable automatic background update checks. Updates will be available if you manually check for updates."), }, { key: 'start', value: localize('start', "Check for updates only on startup. Disable automatic background update checks."), }, { key: 'default', value: localize('default', "Enable automatic update checks. Code will check for updates automatically and periodically."), } ] }, } }, 'update.channel': { type: 'string', default: 'default', scope: ConfigurationScope.APPLICATION, description: localize('updateMode', "Configure whether you receive automatic updates. The updates are fetched from a Microsoft online service."), deprecationMessage: localize('deprecated', "This setting is deprecated, please use '{0}' instead.", 'update.mode') }, 'update.enableWindowsBackgroundUpdates': { type: 'boolean', default: true, scope: ConfigurationScope.APPLICATION, title: localize('enableWindowsBackgroundUpdatesTitle', "Enable Background Updates"), description: localize('enableWindowsBackgroundUpdates', "Enable to download and install new VS Code versions in the background."), included: isWindows && !isWeb }, 'update.restartWhenIdle': { type: 'boolean', default: false, experiment: { mode: 'auto' }, scope: ConfigurationScope.APPLICATION, tags: ['experimental'], included: !isWeb, description: localize('restartWhenIdle', "Controls whether to restart automatically to apply a downloaded update after the screen has been locked for a minute while on power, keeping the machine from going to sleep until then. The restart only happens if every window can be restored exactly as it was, for example when no terminal process, task, debug session, chat request, or agent session is running, and it does not take focus from another application. Only supported on macOS."), policy: { name: 'UpdateRestartWhenIdle', category: PolicyCategory.Update, minimumVersion: '1.145', localization: { description: { key: 'restartWhenIdle', value: localize('restartWhenIdle', "Controls whether to restart automatically to apply a downloaded update after the screen has been locked for a minute while on power, keeping the machine from going to sleep until then. The restart only happens if every window can be restored exactly as it was, for example when no terminal process, task, debug session, chat request, or agent session is running, and it does not take focus from another application. Only supported on macOS."), } }, } }, 'update.showReleaseNotes': { type: 'boolean', default: true, scope: ConfigurationScope.APPLICATION, description: localize('showReleaseNotes', "Show Release Notes after an update. The Release Notes are fetched from a Microsoft online service."), tags: ['usesOnlineServices'], agentsWindow: { default: false, readOnly: true }, }, 'update.showReleaseHighlightsVideo': { type: 'boolean', default: false, experiment: { mode: 'auto' }, scope: ConfigurationScope.APPLICATION, included: !isWeb, description: localize('showReleaseHighlightsVideo', "Include an available highlights video when opening release notes. The video does not play automatically. Videos are fetched from a Microsoft online service."), tags: ['usesOnlineServices'], agentsWindow: { default: false, readOnly: true }, }, 'update.showPostInstallInfo': { type: 'boolean', default: false, experiment: { mode: 'auto' }, scope: ConfigurationScope.APPLICATION, description: localize('showPostInstallInfo', "Show a post-install update tooltip in the title bar instead of opening the release notes editor."), tags: ['usesOnlineServices'] }, 'update.showOutdatedBuildReminder': { type: 'boolean', default: true, experiment: { mode: 'auto' }, scope: ConfigurationScope.APPLICATION, description: localize('showOutdatedBuildReminder', "Show a reminder to update once this version of VS Code is two months old. The reminder is shown at most once a month."), included: !isWeb }, 'update.titleBar': { type: 'boolean', default: true, scope: ConfigurationScope.APPLICATION, description: localize('updateTitleBar', "Show the update indicator in the title bar."), included: !isWeb } } });