Merge pull request #509 from wabbajack-tools/remove-autoupdater-net

Remove AutoUpdater.NET
This commit is contained in:
Timothy Baldridge 2020-02-11 16:22:52 -07:00 committed by GitHub
commit 11689bfdfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2 additions and 66 deletions

View File

@ -1,5 +1,4 @@
using AutoUpdaterDotNET;
using DynamicData;
using DynamicData;
using DynamicData.Binding;
using ReactiveUI;
using ReactiveUI.Fody.Helpers;
@ -142,21 +141,6 @@ namespace Wabbajack
execute: () => NavigateTo(SettingsPane.Value));
OpenTerminalCommand = ReactiveCommand.Create(() => OpenTerminal());
// Latch onto update events and update GUI
AutoUpdater.CheckForUpdateEvent += (args) =>
{
UpdateAvailable = args?.IsUpdateAvailable ?? false;
};
// Trigger a query for updates soon after starting
Observable.Return(Unit.Default)
.Delay(TimeSpan.FromSeconds(3))
.ObserveOnGuiThread()
.Subscribe(_ =>
{
AutoUpdater.Start(@"https://www.wabbajack.org/current-version.xml");
});
}
private void OpenTerminal()

View File

@ -1,5 +1,4 @@
using AutoUpdaterDotNET;
using ReactiveUI;
using ReactiveUI;
using ReactiveUI.Fody.Helpers;
using System;
using System.IO;
@ -38,24 +37,6 @@ namespace Wabbajack
CompileCommand = ReactiveCommand.Create(() => mainVM.NavigateTo(mainVM.Compiler.Value));
BrowseCommand = ReactiveCommand.Create(() => mainVM.NavigateTo(mainVM.Gallery.Value));
UpdateCommand = ReactiveCommand.Create(
canExecute: mainVM.WhenAny(x => x.UpdateAvailable)
.ObserveOnGuiThread(),
execute: () =>
{
try
{
if (AutoUpdater.DownloadUpdate())
{
mainVM.ShutdownApplication();
}
}
catch (Exception exception)
{
Utils.Error(exception, "Could not download update.");
}
});
}
}
}

View File

@ -34,25 +34,6 @@
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Button
x:Name="UpdateAvailableButton"
Margin="6"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Style="{StaticResource TransparentBackgroundButtonStyle}">
<StackPanel Margin="5" Orientation="Horizontal">
<icon:PackIconMaterial
VerticalAlignment="Center"
Foreground="{StaticResource ComplementaryBrush}"
Kind="Download" />
<TextBlock
Margin="5,0,0,0"
VerticalAlignment="Center"
FontSize="14"
Foreground="{StaticResource ComplementaryBrush}"
Text="Update Available" />
</StackPanel>
</Button>
<Grid Grid.Row="1" Margin="5,15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />

View File

@ -37,15 +37,6 @@ namespace Wabbajack
this.WhenAny(x => x.ViewModel.CompileCommand)
.BindToStrict(this, x => x.CompileButton.Command)
.DisposeWith(dispose);
this.WhenAny(x => x.ViewModel.UpdateCommand)
.BindToStrict(this, x => x.UpdateAvailableButton.Command)
.DisposeWith(dispose);
this.WhenAny(x => x.ViewModel.UpdateCommand.CanExecute)
.Switch()
.Select(x => x ? Visibility.Visible : Visibility.Collapsed)
.BindToStrict(this, x => x.UpdateAvailableButton.Visibility)
.DisposeWith(dispose);
});
}
}

View File

@ -50,7 +50,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autoupdater.NET.Official" Version="1.5.8" />
<PackageReference Include="CefSharp.Wpf" Version="79.1.350" />
<PackageReference Include="DynamicData" Version="6.14.8" />
<PackageReference Include="Extended.Wpf.Toolkit" Version="3.8.1" />