private File getSaveFile(File installDir, String saveFileName) throws FileNotFoundException {
		boolean isDev = new File(installDir, "build.gradle").isFile();
		String appName = applicationName.replaceAll("\\s", "").toLowerCase();

		String userSettingsDirName = appName + "_" + applicationVersion + "_" +
			applicationReleaseName.replaceAll("\\s", "").toUpperCase();
		if (isDev) {
			userSettingsDirName += "_location_" + installDir.getParentFile().getName();
		}
		
		// Ensure there is a user home directory (there definitely should be)
		String userHomeDirPath = System.getProperty("user.home");
		if (userHomeDirPath == null || userHomeDirPath.isEmpty()) {
			throw new FileNotFoundException("User home directory is not known.");
		}
		File userHomeDir = new File(userHomeDirPath);
		if (!userHomeDir.isDirectory()) {
			throw new FileNotFoundException("User home directory does not exist: " + userHomeDir);
		}

		File userSettingsDir = null;

		// Handle legacy application layout
		if (applicationLayoutVersion.equals("1")) {
			userSettingsDir = new File(userHomeDir, "." + appName + "/." + userSettingsDirName);
			return new File(userSettingsDir, saveFileName);
		}

		// Look for XDG environment variable
		String xdgConfigHomeDirStr = System.getenv("XDG_CONFIG_HOME");
		if (xdgConfigHomeDirStr != null && !xdgConfigHomeDirStr.isEmpty()) {
			userSettingsDir = new File(xdgConfigHomeDirStr, appName + "/" + userSettingsDirName);
			return new File(userSettingsDir, saveFileName);
		}

		// Look in current user settings directory
		switch (JavaFinder.getCurrentPlatform()) {
			case WINDOWS:
				String localAppDataDirPath = System.getenv("APPDATA");
				if (localAppDataDirPath == null || localAppDataDirPath.trim().isEmpty()) {
					throw new FileNotFoundException("\"APPDATA\" environment variable is not set");
				}
				userSettingsDir =
					new File(localAppDataDirPath, appName + "/" + userSettingsDirName);
				break;
			case LINUX:
				userSettingsDir =
					new File(userHomeDir, ".config/" + appName + "/" + userSettingsDirName);
				break;
			case MACOS:
				userSettingsDir =
					new File(userHomeDir, "Library/" + appName + "/" + userSettingsDirName);
				break;
			default:
				throw new FileNotFoundException(
					"Failed to find the user settings directory: Unsupported operating system.");
		}

		return new File(userSettingsDir, saveFileName);
	}
Gets the given "save file".
 
@param installDir The Ghidra installation directory.  This is the directory that has the
  "Ghidra" subdirectory in it.
@throws FileNotFoundException if the user's home directory was not found.
GhidraBuild/LaunchSupport/src/main/java/ghidra/launch/AppConfig.java