From ca4174bf978fc74150b6b619bbb68ae3d53e4f2c Mon Sep 17 00:00:00 2001 From: canni0 Date: Tue, 26 Jan 2010 02:03:18 +0000 Subject: - added windows version check in addition to commit #2094 Behaviour changes as follows: Use local path (old behaviour) if ... - ... config.ini is detected -> use local path (old behaviour) Use global path (%APPDATA%/ultrastardx) if ... - ... no config.ini is present (allows portable installations) - ... user is running Vista or later git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2097 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/base/UPlatformWindows.pas | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/base/UPlatformWindows.pas b/src/base/UPlatformWindows.pas index 102ae67a..cf69a359 100644 --- a/src/base/UPlatformWindows.pas +++ b/src/base/UPlatformWindows.pas @@ -129,7 +129,7 @@ end; * of usdx prior to version 1.1 * - It is global if no config.ini exists in the directory of the * executable the config files are in a separate folder - * (e.g. APPDATA\ultrastardx) + * (e.g. %APPDATA%\ultrastardx) * On windows resources (themes, language-files) * reside in the directory of the executable in every case * @@ -138,12 +138,15 @@ end; procedure TPlatformWindows.DetectLocalExecution(); var LocalDir, ConfigIni: IPath; + OSVerInfo: TOSVersionInfo; begin - // we just check if the 'languages' folder exists in the - // directory of the executable. If so -> local execution. + // we just check if 'config.ini' exists in the + // directory of the executable or if windows version + // is less than Windows Vista (major version = 6). + // If so -> local execution. LocalDir := GetExecutionDir(); ConfigIni := LocalDir.Append('config.ini'); - UseLocalDirs := (ConfigIni.IsFile and ConfigIni.Exists); + UseLocalDirs := ((ConfigIni.IsFile and ConfigIni.Exists) and (OSVerInfo.dwMajorVersion < 6)); end; function TPlatformWindows.GetLogPath: IPath; -- cgit v1.2.3