aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-09-16 12:51:15 +0200
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-09-16 12:51:15 +0200
commitbe0f950a6555389ab61f891f5105111bc8f4c538 (patch)
tree3d5702244512a6d7238ab26301b6b861a0cfe90a
parenta7b625652351c290d3bf7cf13106d9bb8861e012 (diff)
downloadlombok-be0f950a6555389ab61f891f5105111bc8f4c538.tar.gz
lombok-be0f950a6555389ab61f891f5105111bc8f4c538.tar.bz2
lombok-be0f950a6555389ab61f891f5105111bc8f4c538.zip
[issue #2964] Try to look in chocolatey's default installation dir.
-rw-r--r--src/installer/lombok/installer/eclipse/StandardProductDescriptor.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/installer/lombok/installer/eclipse/StandardProductDescriptor.java b/src/installer/lombok/installer/eclipse/StandardProductDescriptor.java
index 9bd3ae94..a9f55baf 100644
--- a/src/installer/lombok/installer/eclipse/StandardProductDescriptor.java
+++ b/src/installer/lombok/installer/eclipse/StandardProductDescriptor.java
@@ -157,10 +157,14 @@ public class StandardProductDescriptor implements EclipseProductDescriptor {
return base + pathSeparator + alternative.replaceAll("[\\/]", "\\" + pathSeparator);
}
+ private static final String[] BASE_WINDOWS_ROOTS = {"\\", "\\Program Files", "\\Program Files (x86)", "\\ProgramData\\Chocolatey\\lib"};
private static String[] windowsRoots() {
String localAppData = windowsLocalAppData();
- if (localAppData == null) return new String[] {"\\", "\\Program Files", "\\Program Files (x86)", USER_HOME};
- return new String[] {"\\", "\\Program Files", "\\Program Files (x86)", USER_HOME, localAppData};
+ String[] out = new String[BASE_WINDOWS_ROOTS.length + (localAppData == null ? 1 : 2)];
+ System.arraycopy(BASE_WINDOWS_ROOTS, 0, out, 0, BASE_WINDOWS_ROOTS.length);
+ out[BASE_WINDOWS_ROOTS.length] = USER_HOME;
+ if (localAppData != null) out[BASE_WINDOWS_ROOTS.length + 1] = localAppData;
+ return out;
}
private static String windowsLocalAppData() {