[longomatch/win32] Use dafults folder for config files.Vista requieres extra permissions



commit ab5f3718e495a67e5c73c6525df8cd22811ffd3f
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Aug 20 21:34:28 2009 +0200

    Use dafults folder for config files.Vista requieres extra permissions

 LongoMatch/Main.cs |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/LongoMatch/Main.cs b/LongoMatch/Main.cs
index 0b06265..8b987de 100644
--- a/LongoMatch/Main.cs
+++ b/LongoMatch/Main.cs
@@ -65,16 +65,13 @@ namespace LongoMatch
 				
 			LongoMatch.Video.Player.GstPlayer.InitBackend("");
 			
-			if (homeDirectory == null)
-				PromptForHomeDir();
-			
+				
 			//Comprobamos los archivos de inicio
 			CheckDirs();
 			CheckFiles();			
 			
 			//Iniciamos la base de datos
-			db = new DataBase(Path.Combine(DBDir(),"longomatch.db"));
-			
+			db = new DataBase(Path.Combine(DBDir(),"longomatch.db"));			
 		
 			
 			//Check for previous database
@@ -197,15 +194,19 @@ namespace LongoMatch
 			baseDirectory = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory,"../");
 
 			try{
-				StreamReader reader = new StreamReader(System.IO.Path.Combine(baseDirectory, "etc/"+WIN32_CONFIG_FILE));
+				StreamReader reader = new StreamReader(System.IO.Path.Combine(homeDirectory,WIN32_CONFIG_FILE));
 				homeDirectory = reader.ReadLine();
 				configDirectory = homeDirectory;
 				if (!System.IO.Directory.Exists(homeDirectory))
 					System.IO.Directory.CreateDirectory(homeDirectory);
 				reader.Close();
 			}
+			//No config file exists, use default
 			catch {
-				homeDirectory = null;
+				//Vista permissions doesn't not allow to use the 'etc' dir
+				//in the installation path. Use the default homeDirectory
+				//and let the user change it by hand
+				configDirectory=homeDirectory;
 			}		
 		}
 		



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]