mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-02-08 15:49:23 -06:00
GP-6349: LaunchSupport now can use application.settingsdir system
property in launch.properties
This commit is contained in:
@@ -402,6 +402,7 @@ public class AppConfig {
|
||||
userSettingsDirName += "_location_" + dirName;
|
||||
}
|
||||
|
||||
|
||||
// Ensure there is a user home directory (there definitely should be)
|
||||
String userHomeDirPath = System.getProperty("user.home");
|
||||
if (userHomeDirPath == null || userHomeDirPath.isEmpty()) {
|
||||
@@ -420,6 +421,20 @@ public class AppConfig {
|
||||
return new File(userSettingsDir, saveFileName);
|
||||
}
|
||||
|
||||
// Handle application.settingsdir system property
|
||||
for (String arg : launchProperties.getVmArgList()) {
|
||||
if (arg.startsWith("-Dapplication.settingsdir")) {
|
||||
String[] parts = arg.split("=", 2);
|
||||
if (parts.length == 2) {
|
||||
String path = parts[1].trim();
|
||||
if (!path.isEmpty()) {
|
||||
userSettingsDir = new File(path, appName + "/" + userSettingsDirName);
|
||||
return new File(userSettingsDir, saveFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Look for XDG environment variable
|
||||
String xdgConfigHomeDirStr = System.getenv("XDG_CONFIG_HOME");
|
||||
if (xdgConfigHomeDirStr != null && !xdgConfigHomeDirStr.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user