diff --git a/MeltyInstaller/MainWindow.xaml b/MeltyInstaller/MainWindow.xaml index 5377bc2..9d12f48 100644 --- a/MeltyInstaller/MainWindow.xaml +++ b/MeltyInstaller/MainWindow.xaml @@ -48,7 +48,7 @@ - + diff --git a/MeltyInstaller/MainWindow.xaml.cs b/MeltyInstaller/MainWindow.xaml.cs index 47ee1ec..3ff65b7 100644 --- a/MeltyInstaller/MainWindow.xaml.cs +++ b/MeltyInstaller/MainWindow.xaml.cs @@ -82,14 +82,18 @@ public void PrintLog(string log) private async void Install() { + installPath.IsEnabled = false; + selectPath.IsEnabled = false; install.IsEnabled = false; installCCCaster.IsEnabled = false; installConcerto.IsEnabled = false; - PrintLog("Creating Directory..."); - Directory.CreateDirectory(path); - - progressBar.Value += 5; + if (!Directory.Exists(path)) + { + PrintLog("Creating Directory..."); + Directory.CreateDirectory(path); + progressBar.Value += 5; + } client = new HttpClient(); @@ -172,13 +176,13 @@ private async Task DownloadFile(string urlAddress, string fileName) if (totalReads % 512 == 0) { PrintLog($"{fileName} download progress: {totalRead / 1048576}mb of {totalSize / 1048576}mb"); + progressBar.Value += 0.3; } } } while (isMoreToRead); } - progressBar.Value += 20; PrintLog($"Finished Download of: {fileName}"); } else @@ -215,6 +219,10 @@ private Task UnzipFile(string fileName) private void close_Click(object sender, RoutedEventArgs e) { + if (close.Content.ToString() == "Done") + { + System.Diagnostics.Process.Start("explorer.exe", path); + } Application.Current.MainWindow.Close(); } }