diff --git a/Vocaluxe/Base/CDataBase.cs b/Vocaluxe/Base/CDataBase.cs index 90b52a93..97d4278c 100644 --- a/Vocaluxe/Base/CDataBase.cs +++ b/Vocaluxe/Base/CDataBase.cs @@ -262,6 +262,20 @@ namespace Vocaluxe.Base private static bool InitHighscoreDB() { + string OldDBFilePath = Path.Combine(Environment.CurrentDirectory, CSettings.sFileOldHighscoreDB); + if (File.Exists(OldDBFilePath)) + { + if (File.Exists(_HighscoreFilePath)) + { + CLog.LogError("Found old Highscore DB (" + OldDBFilePath + "). If you want to import it just delete the new one (" + _HighscoreFilePath + ")"); + } + else + { + File.Copy(OldDBFilePath, _HighscoreFilePath); + File.Move(OldDBFilePath, OldDBFilePath + ".old"); + } + } + SQLiteConnection connection = new SQLiteConnection(); connection.ConnectionString = "Data Source=" + _HighscoreFilePath; SQLiteCommand command; diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index bbd6164f..a1aa2db7 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -69,6 +69,7 @@ namespace Vocaluxe.Base public const string sFileCover = "Cover.xml"; public const string sFileFonts = "Fonts.xml"; + public const string sFileOldHighscoreDB = "Ultrastar.db"; public static string sFileHighscoreDB = "HighscoreDB.sqlite"; public const string sFileCoverDB = "CoverDB.sqlite"; public const string sFilePerformanceLog = "Performance.log";