diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2024-01-29 17:41:30 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2024-01-29 17:41:30 +0700 |
commit | ae9532af0fde0e0ab06d29d2efe660e80f73b417 (patch) | |
tree | ba4f258fb2744bc996fdefa1760b456770c9e2c7 | |
parent | 2b99f81ae8898c0eb330e313dc6462ea978bf8c4 (diff) | |
download | aspectj-ae9532af0fde0e0ab06d29d2efe660e80f73b417.tar.gz aspectj-ae9532af0fde0e0ab06d29d2efe660e80f73b417.zip |
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 <Alexander@Kriegisch.name>
-rw-r--r-- | build/src/main/java/$installer$/org/aspectj/Main.java | 7 |
1 files 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() { |