diff --git a/stella/Makefile b/stella/Makefile index 4578d3dfa..c79c9aff9 100644 --- a/stella/Makefile +++ b/stella/Makefile @@ -13,7 +13,7 @@ ## See the file "license" for information on usage and redistribution of ## this file, and for a DISCLAIMER OF ALL WARRANTIES. ## -## $Id: Makefile,v 1.34 2008-03-09 15:30:27 stephena Exp $ +## $Id: Makefile,v 1.35 2008-03-09 17:52:40 stephena Exp $ ## ## Based on code from ScummVM - Scumm Interpreter ## Copyright (C) 2002-2004 The ScummVM project @@ -196,7 +196,7 @@ src/win32/stella_icon.o: src/win32/stella.ico src/win32/stella.rc win32dist: stella$(EXEEXT) rm -rf $(DISTNAME) mkdir -p $(DISTNAME)/docs/graphics - $(STRIP) stella$(EXEEXT) -o $(DISTNAME)/stella$(EXEEXT) + $(STRIP) stella$(EXEEXT) -o $(DISTNAME)/Stella$(EXEEXT) cp Announce.txt Changes.txt Copyright.txt License.txt README-SDL.txt Readme.txt Todo.txt $(DISTNAME)/docs cp -r docs/*.html $(DISTNAME)/docs cp -r docs/graphics/*.png $(DISTNAME)/docs/graphics diff --git a/stella/src/win32/OSystemWin32.cxx b/stella/src/win32/OSystemWin32.cxx index 0e7ae2651..9f110b8c9 100644 --- a/stella/src/win32/OSystemWin32.cxx +++ b/stella/src/win32/OSystemWin32.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: OSystemWin32.cxx,v 1.21 2008-02-06 13:45:24 stephena Exp $ +// $Id: OSystemWin32.cxx,v 1.22 2008-03-09 17:52:40 stephena Exp $ //============================================================================ #include @@ -21,6 +21,7 @@ #include #include "bspf.hxx" +#include "FSNode.hxx" #include "OSystem.hxx" #include "OSystemWin32.hxx" @@ -38,12 +39,28 @@ OSystemWin32::OSystemWin32() : OSystem() { - // TODO - there really should be code here to determine which version - // of Windows is being used. - // If using a version which supports multiple users (NT and above), - // the relevant directories should be created in per-user locations. - // For now, we just put it in the same directory as the executable. - const string& basedir = "."; + string basedir = "."; + + if(!FilesystemNode::fileExists("disable_profiles.txt")) + { + OSVERSIONINFO win32OsVersion; + ZeroMemory(&win32OsVersion, sizeof(OSVERSIONINFO)); + win32OsVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&win32OsVersion); + + // Check for non-9X version of Windows; Win9x will use the app directory + if(win32OsVersion.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS) + { + // If this doesn't exist, we just fall back to the default (same directory as app) + char configFile[256]; + if(GetEnvironmentVariable("USERPROFILE", configFile, sizeof(configFile))) + { + strcat(configFile, "\\Stella"); + basedir = configFile; + } + } + } + setBaseDir(basedir); setConfigFile(basedir + "\\stella.ini"); }