From ae9532af0fde0e0ab06d29d2efe660e80f73b417 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Mon, 29 Jan 2024 17:41:30 +0700 Subject: [PATCH] Update InstallContext.onWindowsPro for Windows 11+ The matcher is more future-proof now, as long as Windows names stay "Windows Server.*" and "Windows [1-8][0-9]?". This is not beautiful, but a quick drive-by improvement. Signed-off-by: Alexander Kriegisch --- build/src/main/java/$installer$/org/aspectj/Main.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/src/main/java/$installer$/org/aspectj/Main.java b/build/src/main/java/$installer$/org/aspectj/Main.java index 068258311..b7690f18f 100644 --- a/build/src/main/java/$installer$/org/aspectj/Main.java +++ b/build/src/main/java/$installer$/org/aspectj/Main.java @@ -573,10 +573,11 @@ class InstallContext { } public boolean onWindowsPro() { + // Except for some older versions/names, also match Windows 7, 8, 10, 11 up to 89, + // but not 9x, i.e. e.g. not Windows 95 or 98 // TODO: Think about a more future-proof solution also checking 'os.version' system property. See also this table: - // https://github.com/openjdk/jdk/blob/9604ee82690f89320614b37bfef4178abc869777/src/java.base/windows/native/libjava/java_props_md.c#L446 - // Alternatively, explicitly exclude unsupported versions because those won't change in the future. - return getOS().matches("^Windows (NT|2000|XP|Vista|Server|7|8|10).*"); + // https://github.com/openjdk/jdk/blob/7a300b63b5ca22dfe3e831e641f7a11b9c719b30/src/java.base/windows/native/libjava/java_props_md.c#L415 + return getOS().matches("^Windows (NT|2000|XP|Vista|Server|[1-8][0-9]?).*"); } public boolean onMacintosh() { -- 2.39.5