static UserConfiguration() { bool DataConverted = false; if (File.Exists(Locations.ConfigFile)) { using (StreamReader sr = new StreamReader(Locations.ConfigFile)) { string sLine = sr.ReadLine(); if (!sLine.Contains("=")) { Current = new UserConfiguration(); Current.ArtemisInstallPath = sLine; if (!string.IsNullOrEmpty(Current.ArtemisInstallPath)) { if (!File.Exists(Path.Combine(Current.ArtemisInstallPath, Locations.ArtemisEXE))) { Current.ArtemisInstallPath = Locations.FindArtemisInstallPath(); } } if (sLine != null) { sLine = sr.ReadLine(); if (!string.IsNullOrEmpty(sLine)) { bool b; if (bool.TryParse(sLine, out b)) { Current.UseArtemisExtender = b; } } if (sLine != null) { sLine = sr.ReadLine(); Current.ArtemisExtenderPath = sLine; if (sLine != null) { sLine = sr.ReadLine(); Current.ArtemisExtenderCopy = sLine; } } } DataConverted = true; } } } if (DataConverted) { FileHelper.DeleteFile(Locations.ConfigFile); Current.Save(); } else { Current = INIConverter.ToObject(Locations.ConfigFile, new UserConfiguration()) as UserConfiguration; } if (string.IsNullOrEmpty(Current.ArtemisExtenderCopy) || !File.Exists(Current.ArtemisExtenderCopy)) { Current.UseArtemisExtender = false; } Current.Original = new UserConfiguration(); Current.AcceptChanges(); }