GP-0: Fixing enablement of installed extensions in dev mode

This commit is contained in:
Ryan Kurtz 2025-09-29 05:11:39 -04:00
parent cde92ede12
commit 605d579070
3 changed files with 12 additions and 17 deletions

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -268,10 +268,8 @@ public class ExtensionDetails implements Comparable<ExtensionDetails> {
}
/**
* Returns true if this extension is installed under an installation folder or inside of a
* source control repository folder.
* @return true if this extension is installed under an installation folder or inside of a
* source control repository folder.
* {@return true if this extension is installed under an installation folder or inside of a
* source control repository folder}
*/
public boolean isInstalledInInstallationFolder() {
if (installDir == null) {
@ -287,11 +285,10 @@ public class ExtensionDetails implements Comparable<ExtensionDetails> {
}
// extDirs.get(0) is the user extension dir
ResourceFile appExtDir = extDirs.get(1);
if (FileUtilities.isPathContainedWithin(appExtDir.getFile(false), installDir)) {
return true;
}
return false;
return extDirs.stream()
.skip(1)
.anyMatch(
dir -> FileUtilities.isPathContainedWithin(dir.getFile(false), installDir));
}
/**

View file

@ -227,9 +227,8 @@ public class GhidraApplicationLayout extends ApplicationLayout {
* Returns a prioritized list of directories where Ghidra extensions are installed. These
* should be at the following locations:<br>
* <ul>
* <li><code>[user settings dir]/Extensions</code></li>
* <li><code>[application install dir]/Ghidra/Extensions</code> (Release Mode)</li>
* <li><code>ghidra/Ghidra/Extensions</code> (Development Mode)</li>
* <li>{@code [user settings dir]/Extensions}</li>
* <li>{@code [application root dirs]/Extensions}</li>
* </ul>
*
* @return the install folder, or null if can't be determined

View file

@ -129,9 +129,8 @@ public abstract class ApplicationLayout {
* Returns a prioritized {@link List ordered list} of the application Extensions installation
* directories. Typically, the values may be any of the following locations:<br>
* <ul>
* <li><code>[user settings dir]/Extensions</code></li>
* <li><code>[application install dir]/Ghidra/Extensions</code> (Release Mode)</li>
* <li><code>ghidra/Ghidra/Extensions</code> (Development Mode)</li>
* <li>{@code [user settings dir]/Extensions}</li>
* <li>{@code [application root dirs]/Extensions}</li>
* </ul>
*
* @return an {@link List ordered list} of the application Extensions installation directories.