diff --git a/src/vs/workbench/electron-sandbox/window.ts b/src/vs/workbench/electron-sandbox/window.ts index 323316af370be..cf6af9debb4aa 100644 --- a/src/vs/workbench/electron-sandbox/window.ts +++ b/src/vs/workbench/electron-sandbox/window.ts @@ -697,23 +697,44 @@ export class NativeWindow extends Disposable { } } - // Windows 7 warning + // Windows 7/8/8.1 warning if (isWindows) { const version = this.environmentService.os.release.split('.'); + const majorVersion = version[0]; + const minorVersion = version[1]; + const eolReleases = new Map>([ + ['6', new Map([ + ['1', 'Windows 7 / Windows Server 2008 R2'], + ['2', 'Windows 8 / Windows Server 2012'], + ['3', 'Windows 8.1 / Windows Server 2012 R2'], + ])], + ]); // Refs https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfoa - if (parseInt(version[0]) === 6 && parseInt(version[1]) === 1) { - const message = localize('windows 7 eol', "{0} on Windows 7 will no longer receive any further updates.", this.productService.nameLong); + if (eolReleases.get(majorVersion)?.has(minorVersion)) { + const message = localize('windowseolmessage', "{0} on {1} will soon stop receiving updates. Consider upgrading your windows version.", this.productService.nameLong, eolReleases.get(majorVersion)?.get(minorVersion)); + const actions = [{ + label: localize('windowseolBannerLearnMore', "Learn More"), + href: 'https://aka.ms/vscode-faq-old-windows' + }]; + + this.bannerService.show({ + id: 'windowseol.banner', + message, + ariaLabel: localize('windowseolarialabel', "{0}. Use navigation keys to access banner actions.", message), + actions, + icon: Codicon.warning + }); this.notificationService.prompt( Severity.Warning, message, [{ label: localize('learnMore', "Learn More"), - run: () => this.openerService.open(URI.parse('https://aka.ms/vscode-faq-win7')) + run: () => this.openerService.open(URI.parse('https://aka.ms/vscode-faq-old-windows')) }], { - neverShowAgain: { id: 'windows7eol', isSecondary: true, scope: NeverShowAgainScope.APPLICATION }, + neverShowAgain: { id: 'windowseol', isSecondary: true, scope: NeverShowAgainScope.APPLICATION }, priority: NotificationPriority.URGENT, sticky: true }