Checking EZPPClient Files after download, suggest repair if errors where found

This commit is contained in:
HorizonCode 2021-05-26 08:09:59 +02:00
parent 6dc54f175e
commit 2e795ad2e4

View File

@ -81,12 +81,12 @@ namespace EZPPClient_Installer
UpdateInstallButton(false);
List<string> outdatedFiles = DownloadUtil.FilesToDownload(osuEZPPPath);
List<string> 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<string> filesToDownload = DownloadUtil.FilesToDownload(EZPPFolder);
List<string> 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<string> outdatedFiles = DownloadUtil.FilesToDownload(osuEZPPPath);
List<string> 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<string> outdatedFiles = DownloadUtil.FilesToDownload(osuEZPPPath);
List<string> outdatedFiles = DownloadUtil.FilesToDownload(osuEZPPPath, false);
if (!IsEmpty(outdatedFiles))
{
InstallButton.Content = "Update";
UpdateInstallButton(true);
InstallButton.Content = "Update";
}
else
{
InstallButton.Content = "Install";
UpdateInstallButton(true);
}
}