aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes
diff options
context:
space:
mode:
Diffstat (limited to 'Game/Code/Classes')
-rw-r--r--Game/Code/Classes/UFiles.pas41
-rw-r--r--Game/Code/Classes/UMain.pas16
2 files changed, 12 insertions, 45 deletions
diff --git a/Game/Code/Classes/UFiles.pas b/Game/Code/Classes/UFiles.pas
index 565c5ee3..9cd3bdc1 100644
--- a/Game/Code/Classes/UFiles.pas
+++ b/Game/Code/Classes/UFiles.pas
@@ -54,47 +54,6 @@ implementation
uses TextGL,
UIni,
UMain;
-{*
-//--------------------
-// Function sets all Absolute Paths e.g. Song Path and makes sure the Directorys exist
-//--------------------
-procedure InitializePaths;
-
- // Initialize a Path Variable
- // After Setting Paths, make sure that Paths exist
- function initialize_path( out aPathVar : String; const aLocation : String ): boolean;
- var
- lWriteable: Boolean;
- begin
- aPathVar := aLocation;
-
- If DirectoryExists(aPathVar) then
- lWriteable := ForceDirectories(aPathVar)
- else
- lWriteable := false;
-
- if not Writeable then
- Log.LogError('Error: Dir ('+ aLocation +') is Readonly');
-
- result := lWriteable;
- end;
-
-begin
- GamePath := ExtractFilePath(ParamStr(0));
-
- initialize_path( LogPath , GamePath );
- initialize_path( SoundPath , GamePath + 'Sounds\' );
- initialize_path( SongPath , GamePath + 'Songs\' );
- initialize_path( ThemePath , GamePath + 'Themes\' );
- initialize_path( ScreenshotsPath , GamePath + 'Screenshots\');
- initialize_path( CoversPath , GamePath + 'Covers\' );
- initialize_path( LanguagesPath , GamePath + 'Languages\' );
- initialize_path( PluginPath , GamePath + 'Plugins\' );
- initialize_path( PlaylistPath , GamePath + 'Playlists\' );
-
- DecimalSeparator := ',';
-end;
-*}
//--------------------
// Clears Song Header values
diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas
index 9b6ea3d5..66e1d07e 100644
--- a/Game/Code/Classes/UMain.pas
+++ b/Game/Code/Classes/UMain.pas
@@ -748,14 +748,22 @@ procedure InitializePaths;
function initialize_path( out aPathVar : String; const aLocation : String ): boolean;
var
lWriteable: Boolean;
+ lAttrib : integer;
begin
- aPathVar := aLocation;
+ lWriteable := false;
+ aPathVar := aLocation;
+
+ // Make sure the directory is needex
+ ForceDirectories(aPathVar);
If DirectoryExists(aPathVar) then
- lWriteable := ForceDirectories(aPathVar)
- else
- lWriteable := false;
+ begin
+ lAttrib := fileGetAttr('C:Temp');
+ lWriteable := ( lAttrib and faDirectory <> 0 ) AND
+ NOT ( lAttrib and faReadOnly <> 0 )
+ end;
+
if not lWriteable then
Log.LogError('Error: Dir ('+ aLocation +') is Readonly');