diff --git a/SignaMath/MainWindow.xaml.cs b/SignaMath/MainWindow.xaml.cs index 746d8ac..39634aa 100644 --- a/SignaMath/MainWindow.xaml.cs +++ b/SignaMath/MainWindow.xaml.cs @@ -35,7 +35,7 @@ public partial class MainWindow : Window { internal static MainWindow _MainWindow { get; set; } - private const string VERSION = "1.1.9"; + private const string VERSION = "1.2.0"; internal static string BASE_URL { get; } = Config.Server; private Software Software { get; set; } @@ -484,7 +484,7 @@ private async void Button_DownloadUpdate_Click(object sender, RoutedEventArgs e) }); }); - string filePath = @"V_SignaMath.exe"; + string filePath = $"SignaMath {Software.Version}.exe"; if (File.Exists(filePath)) { File.Delete(filePath); @@ -556,17 +556,35 @@ private async void Window_ContentRendered(object sender, EventArgs e) richTextBox_news.Document.Blocks.Clear(); richTextBox_news.AppendText(Software.Features.Replace("\\n", "\n")); } + else + { + // Supprime l'exe des anciennes version + foreach (var file in Directory.GetFiles(Environment.CurrentDirectory)) + { + if (file.Contains("SignaMath") && file.Contains("exe") && !file.Contains($"SignaMath {Software.Version}.exe")) + { + try + { + File.Delete(file); + } + catch + { + + } + } + } + } } else { - // serveur problème + // Problème serveur } } } catch { - // Pas de connexion internet / Problème serveur + // Pas de connexion internet } }