Skip to content

Commit

Permalink
some small fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
okkdev committed Aug 4, 2021
1 parent 1aa5408 commit 203197b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MeltyInstaller/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

<Border BorderThickness="0.5" BorderBrush="Black" Padding="2,2,2,2" Grid.Row="7" Grid.RowSpan="4">
<ScrollViewer x:Name="scrollLog" VerticalScrollBarVisibility="Auto">
<TextBlock x:Name="installLog" />
<TextBox x:Name="installLog" Background="Transparent" BorderThickness="0" IsReadOnly="True" TextWrapping="Wrap" />
</ScrollViewer>
</Border>

Expand Down
18 changes: 13 additions & 5 deletions MeltyInstaller/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 203197b

Please sign in to comment.