diff --git a/EZPPClient Installer/MainWindow.xaml.cs b/EZPPClient Installer/MainWindow.xaml.cs index d1286d9..635aa3e 100644 --- a/EZPPClient Installer/MainWindow.xaml.cs +++ b/EZPPClient Installer/MainWindow.xaml.cs @@ -81,12 +81,12 @@ namespace EZPPClient_Installer UpdateInstallButton(false); - List outdatedFiles = DownloadUtil.FilesToDownload(osuEZPPPath); + List outdatedFiles = DownloadUtil.FilesToDownload(osuEZPPPath, false); if (!IsEmpty(outdatedFiles)) { - InstallButton.Content = "Update"; UpdateInstallButton(true); + InstallButton.Content = "Update"; linkFoldersCheckbox.IsEnabled = false; } } @@ -166,7 +166,7 @@ namespace EZPPClient_Installer private void UpdateInstallButton(bool enable) { - InstallButton.IsEnabled = enable; + InstallButton.Content = enable ? "Install" : "Reinstall"; linkFoldersCheckbox.IsEnabled = enable; } @@ -193,7 +193,7 @@ namespace EZPPClient_Installer string EZPPFolder = osuFolder + @"\EZPPClient"; - if (!InstallButton.Content.Equals("Update")) + if (InstallButton.Content.Equals("Install")) { if (linkFoldersCheckbox.IsChecked.Value) { @@ -302,7 +302,7 @@ namespace EZPPClient_Installer - List filesToDownload = DownloadUtil.FilesToDownload(EZPPFolder); + List filesToDownload = DownloadUtil.FilesToDownload(EZPPFolder, InstallButton.Content.Equals("Reinstall")); Visibility prevInstallBtnVis = InstallButton.Visibility; Visibility prevUninstallBtnVis = Uninstall_Button.Visibility; @@ -326,31 +326,61 @@ namespace EZPPClient_Installer Download_Text.Visibility = Visibility.Hidden; Download_Progressbar.Visibility = Visibility.Hidden; - _ = new ContentDialog() - { - Title = "Success!", - Content = InstallButton.Content.Equals("Update") ? "The EZPPClient was successfully updated!" : "The EZPPClient was successfully installed!", - PrimaryButtonText = "Yaaay :3" - }.ShowAsync(); - SystemSounds.Asterisk.Play(); - this.Focus(); - Uninstall_Button.Visibility = Visibility.Visible; UpdateInstallButton(false); string osuEZPPPath = folderTextbox.Text + @"\EZPPClient"; - List outdatedFiles = DownloadUtil.FilesToDownload(osuEZPPPath); + List outdatedFiles = DownloadUtil.FilesToDownload(osuEZPPPath, false); if (!IsEmpty(outdatedFiles)) { - InstallButton.Content = "Update"; UpdateInstallButton(true); + InstallButton.Content = "Update"; linkFoldersCheckbox.IsEnabled = false; + string updateText = "It seems like the installation was faulty, please hit Update to repair the EZPPClient."; + + switch (InstallButton.Content) + { + case "Update": + updateText = "It seems like the update was faulty, please hit Update to repair the EZPPClient."; + break; + case "Reinstall": + updateText = "It seems like the reinstallation was faulty, please hit Update to repair the EZPPClient."; + break; + } + + _ = new ContentDialog() + { + Title = "Hmmm..", + Content = updateText, + PrimaryButtonText = "Okay qwq" + }.ShowAsync(); + SystemSounds.Asterisk.Play(); + this.Focus(); } else { - InstallButton.Content = "Install"; - linkFoldersCheckbox.IsEnabled = false; + string updateText = "The EZPPClient was successfully installed!"; + + switch (InstallButton.Content) + { + case "Update": + updateText = "The EZPPClient was successfully updated!"; + break; + case "Reinstall": + updateText = "The EZPPClient was successfully reinstalled!"; + break; + } + + _ = new ContentDialog() + { + Title = "Success!", + Content = updateText, + PrimaryButtonText = "Yaaay :3" + }.ShowAsync(); + SystemSounds.Asterisk.Play(); + this.Focus(); + UpdateInstallButton(false); } } @@ -394,16 +424,15 @@ namespace EZPPClient_Installer UpdateInstallButton(false); string osuEZPPPath = folderTextbox.Text + @"\EZPPClient"; - List outdatedFiles = DownloadUtil.FilesToDownload(osuEZPPPath); + List outdatedFiles = DownloadUtil.FilesToDownload(osuEZPPPath, false); if (!IsEmpty(outdatedFiles)) { - InstallButton.Content = "Update"; UpdateInstallButton(true); + InstallButton.Content = "Update"; } else { - InstallButton.Content = "Install"; UpdateInstallButton(true); } }