Skip to content

Commit

Permalink
chore: push eol notifications for windows 8 and 8.1 (#177668)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak1556 authored Mar 23, 2023
1 parent b0defa2 commit d186a2b
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions src/vs/workbench/electron-sandbox/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, Map<string, string>>([
['6', new Map<string, string>([
['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
}
Expand Down

1 comment on commit d186a2b

@lorand-horvath
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deepak1556 Please add a neverShowAgain option to the windowseol bannerService in line 721. It's annoying to have to close it every time I start Insiders. I know I'm running an unsupported windows and I don't really need a reminder every time. I want to be able to dismiss it forever. Is that possible to do?

Please sign in to comment.