Skip to content
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

chore: push eol notifications for windows 8 and 8.1 #177668

Merged
merged 1 commit into from
Mar 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'],
])],
]);
Comment on lines +705 to +711
Copy link
Member

Choose a reason for hiding this comment

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

Should this be extracted outside of this method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Version mappings are different between Windows and MacOS, so keeping them separate is better for simplicity.


// 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'
deepak1556 marked this conversation as resolved.
Show resolved Hide resolved
}];

this.bannerService.show({
id: 'windowseol.banner',
message,
ariaLabel: localize('windowseolarialabel', "{0}. Use navigation keys to access banner actions.", message),
actions,
icon: Codicon.warning
});
Comment on lines +721 to +727
Copy link
Member

Choose a reason for hiding this comment

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

Nice 👌

Copy link

@lorand-horvath lorand-horvath Mar 24, 2023

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 version and I don't really need a reminder every time. I want to be able to dismiss it forever. Is that possible to do?

Choose a reason for hiding this comment

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

@deepak1556 I second @lorand-horvath request, we do not need a nag every time a project is opened!


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