mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Fixed a bug when starting the server manager and it tries to download steamcmd, but fails as steamcmd is unavailable for download.
This commit is contained in:
parent
8ed965307a
commit
dbeaa7699d
11 changed files with 94 additions and 27 deletions
|
|
@ -17,6 +17,7 @@
|
|||
<ProgressBar x:Name="CompletionProgress" Height="10"/>
|
||||
<Label x:Name="StatusLabel" Content="{DynamicResource AutoUpdater_Status}" HorizontalContentAlignment="Center"/>
|
||||
<Button Content="{DynamicResource AutoUpdater_CancelButtonLabel}" Width="75" HorizontalAlignment="Center" IsCancel="True" Click="Button_Click"/>
|
||||
<TextBlock x:Name="ErrorLabel" Text="Error Text" Margin="0,2,0,0" TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Foreground="{DynamicResource WarningMessage}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
using ServerManagerTool.Common.Utils;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using WPFSharp.Globalizer;
|
||||
|
||||
|
|
@ -12,15 +13,16 @@ namespace ServerManagerTool
|
|||
/// </summary>
|
||||
public partial class AutoUpdateWindow : Window
|
||||
{
|
||||
private GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
|
||||
|
||||
private SteamCmdUpdater updater = new SteamCmdUpdater();
|
||||
private readonly GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
|
||||
private readonly SteamCmdUpdater updater = new SteamCmdUpdater();
|
||||
private CancellationTokenSource cancelSource;
|
||||
|
||||
public AutoUpdateWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
WindowUtils.RemoveDefaultResourceDictionary(this, Config.Default.DefaultGlobalizationFile);
|
||||
|
||||
this.ErrorLabel.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
|
|
@ -32,10 +34,13 @@ namespace ServerManagerTool
|
|||
this.StatusLabel.Content = message;
|
||||
this.CompletionProgress.Value = u.CompletionPercent;
|
||||
|
||||
if(u.FailureText != null)
|
||||
if (u.FailureText != null)
|
||||
{
|
||||
// TODO: Report error through UI
|
||||
throw new Exception(u.FailureText);
|
||||
this.ErrorLabel.Text = u.FailureText;
|
||||
this.ErrorLabel.Visibility = Visibility.Visible;
|
||||
await Task.Delay(10000);
|
||||
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
if (u.CompletionPercent >= 100 || u.Cancelled)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue