From 2de90c62bea966c9c565230fec9b2876e78d8e0a Mon Sep 17 00:00:00 2001 From: Stephanie Gawroriski Date: Sun, 13 Oct 2024 21:11:35 +0000 Subject: [PATCH] Windows path correction. --- assets/doc/usage-standalone.mkd | 16 +++++++++++++--- .../runtime/cldc/full/WindowsPathProvider.java | 10 ++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/assets/doc/usage-standalone.mkd b/assets/doc/usage-standalone.mkd index a9895621b0..b84fdeb03f 100644 --- a/assets/doc/usage-standalone.mkd +++ b/assets/doc/usage-standalone.mkd @@ -129,11 +129,19 @@ following paths are considered for automatic configuration and classpath inclusion. * Windows: - * Cache: `%LOCALAPPDATA%/squirreljme/cache` + * Cache (Local): + * Vista/7/8/10/11: `%LOCALAPPDATA%/squirreljme/cache` + * 95/98/ME/2000/XP: `%APPDATA%/squirreljme/cache` * Or otherwise `%PROGRAMDATA%/squirreljme/cache` - * Configuration: `%APPDATA%/squirreljme/config` + * Configuration (Roaming): + * 95/98/ME/XP/Vista/7/8/10/11: `%APPDATA%/squirreljme/config` * Or otherwise `%PROGRAMDATA%/squirreljme/config` - * Data: `%APPDATA%/squirreljme/data` + * Data (Roaming): + * 95/98/ME/XP/Vista/7/8/10/11: `%APPDATA%/squirreljme/data` + * Or otherwise `%PROGRAMDATA%/squirreljme/data` + * State (Local): + * Vista/7/8/10/11: `%LOCALAPPDATA%/squirreljme/data` + * 95/98/ME/2000/XP: `%APPDATA%/squirreljme/data` * Or otherwise `%PROGRAMDATA%/squirreljme/data` * Linux, macOS, BSD, and other UNIX/UNIX-like systems: * Cache: `$XDG_CACHE_HOME/squirreljme` @@ -142,6 +150,8 @@ inclusion. * Or otherwise `$HOME/.config/squirreljme` * Data: `$XDG_DATA_HOME/squirreljme` * Or otherwise `$HOME/.local/share/squirreljme` + * State: `$XDG_STATE_HOME/squirreljme` + * Or otherwise `$HOME/.local/state/squirreljme` To override the defaults, you may instead use the following, if any start with `~` that is replaced with `$HOME` or `%USERPROFILE%`: diff --git a/modules/cldc/src/main/java/cc/squirreljme/runtime/cldc/full/WindowsPathProvider.java b/modules/cldc/src/main/java/cc/squirreljme/runtime/cldc/full/WindowsPathProvider.java index fe71d9024a..6d350a5a71 100644 --- a/modules/cldc/src/main/java/cc/squirreljme/runtime/cldc/full/WindowsPathProvider.java +++ b/modules/cldc/src/main/java/cc/squirreljme/runtime/cldc/full/WindowsPathProvider.java @@ -95,11 +95,17 @@ public class WindowsPathProvider // Where do we shove our data? String appDataEnv; - if (__roaming || osName.contains("95") || - osName.contains("98") || osName.contains("me")) + if (__roaming) appDataEnv = RuntimeShelf.systemEnv("APPDATA"); else + { + // If available appDataEnv = RuntimeShelf.systemEnv("LOCALAPPDATA"); + + // Otherwise + if (appDataEnv == null) + appDataEnv = RuntimeShelf.systemEnv("APPDATA"); + } // Resolve it if (appDataEnv != null) -- 2.11.4.GIT