Skip to content

Commit

Permalink
Merge pull request #279 from Q-Sharp/main
Browse files Browse the repository at this point in the history
fix aúto update
  • Loading branch information
Razzmatazzz authored Sep 27, 2024
2 parents 21f0562 + 4595672 commit 8a411c1
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 60 deletions.
14 changes: 7 additions & 7 deletions RemnantSaveGuardian/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

using RemnantSaveGuardian.Models;
using RemnantSaveGuardian.Properties;
using RemnantSaveGuardian.Services;

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Threading;
using System.Windows;
using System.Windows.Markup;
using System.Windows.Threading;

using Wpf.Ui.Mvvm.Contracts;
using Wpf.Ui.Mvvm.Services;

namespace RemnantSaveGuardian
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App
{
// The.NET Generic Host provides dependency injection, configuration, logging, and other services.
// https://docs.microsoft.com/dotnet/core/extensions/generic-host
Expand Down
8 changes: 1 addition & 7 deletions RemnantSaveGuardian/EventTransfer.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;

namespace RemnantSaveGuardian
{
internal class EventTransfer
internal class EventTransfer
{
internal static event EventHandler<MessageArgs>? Event;
internal class MessageArgs : EventArgs
Expand Down
4 changes: 2 additions & 2 deletions RemnantSaveGuardian/LocalizationProvider.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;

using WPFLocalizeExtension.Extensions;

namespace RemnantSaveGuardian
{
internal class Loc
internal class Loc
{
public static T GetLocalizedValue<T>(string key, LocalizationOptions options)
{
Expand Down
2 changes: 1 addition & 1 deletion RemnantSaveGuardian/RemnantSaveGuardian.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<SatelliteResourceLanguages>en;ru;de;es;fr;it;ja;ko;pt-BR;zh-Hans;zh-Hant</SatelliteResourceLanguages>
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationIcon>Assets\256.ico</ApplicationIcon>
<AssemblyVersion>1.3.2.0</AssemblyVersion>
<AssemblyVersion>1.3.3.0</AssemblyVersion>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>

Expand Down
3 changes: 1 addition & 2 deletions RemnantSaveGuardian/RemnantWorldEvent.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;

namespace RemnantSaveGuardian
{
public class RemnantWorldEvent
public class RemnantWorldEvent
{
//private string _world;
private List<string> _locations;
Expand Down
7 changes: 1 addition & 6 deletions RemnantSaveGuardian/SaveWatcher.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RemnantSaveGuardian
{
internal static class SaveWatcher
internal static class SaveWatcher
{
public static event EventHandler SaveUpdated;
private static FileSystemWatcher watcher = new ()
Expand Down
3 changes: 2 additions & 1 deletion RemnantSaveGuardian/UpdateCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public static async void CheckForNewVersion()

Version remoteVersion = new Version(latestRelease["tag_name"].ToString());
Version localVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
localVersion = new Version(localVersion.Major, localVersion.Minor, localVersion.Build);
if (localVersion.CompareTo(remoteVersion) == -1)
{
NewVersion?.Invoke(null, new() { Version = remoteVersion, Uri = new(latestRelease["html_url"].ToString()) });
Expand Down Expand Up @@ -70,7 +71,7 @@ public static async void CheckForNewVersion()
{
InstalledVersion = localVersion,
CurrentVersion = remoteVersion.ToString(),
DownloadURL = $"https://github.com/Razzmatazzz/RemnantSaveGuardian/releases/download/{remoteVersion}/RemnantSaveGuardian.zip"
DownloadURL = $"https://github.com/Razzmatazzz/RemnantSaveGuardian/releases/download/{remoteVersion}/RemnantSaveGuardian_{remoteVersion}.0.zip"
};
messageBox.Close();
AutoUpdater.DownloadUpdate(args);
Expand Down
4 changes: 2 additions & 2 deletions RemnantSaveGuardian/ViewModels/BackupsViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;

using Wpf.Ui.Common.Interfaces;

namespace RemnantSaveGuardian.ViewModels
{
public partial class BackupsViewModel : ObservableObject, INavigationAware
public partial class BackupsViewModel : ObservableObject, INavigationAware
{
public void OnNavigatedTo()
{
Expand Down
7 changes: 2 additions & 5 deletions RemnantSaveGuardian/ViewModels/LogViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
using CommunityToolkit.Mvvm.ComponentModel;
using RemnantSaveGuardian.Models;
using System;
using System.Collections.Generic;
using System.Windows.Media;

using Wpf.Ui.Common.Interfaces;

namespace RemnantSaveGuardian.ViewModels
{
public partial class LogViewModel : ObservableObject, INavigationAware
public partial class LogViewModel : ObservableObject, INavigationAware
{
private bool _isInitialized = false;

Expand Down
6 changes: 3 additions & 3 deletions RemnantSaveGuardian/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using CommunityToolkit.Mvvm.ComponentModel;

using System;
using System.Collections.ObjectModel;
using System.Diagnostics;

using Wpf.Ui.Common;
using Wpf.Ui.Controls;
using Wpf.Ui.Controls.Interfaces;
using Wpf.Ui.Mvvm.Contracts;
using WPFLocalizeExtension.Providers;

namespace RemnantSaveGuardian.ViewModels
{
public partial class MainWindowViewModel : ObservableObject
public partial class MainWindowViewModel : ObservableObject
{
private bool _isInitialized = false;

Expand Down
6 changes: 2 additions & 4 deletions RemnantSaveGuardian/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
using System.Windows.Input;

using Wpf.Ui.Common.Interfaces;

namespace RemnantSaveGuardian.ViewModels
{
public partial class SettingsViewModel : ObservableObject, INavigationAware
public partial class SettingsViewModel : ObservableObject, INavigationAware
{
private bool _isInitialized = false;

Expand Down
7 changes: 2 additions & 5 deletions RemnantSaveGuardian/ViewModels/WorldAnalyzerViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
using CommunityToolkit.Mvvm.ComponentModel;
using RemnantSaveGuardian.Models;
using System;
using System.Collections.Generic;
using System.Windows.Media;

using Wpf.Ui.Common.Interfaces;

namespace RemnantSaveGuardian.ViewModels
{
public partial class WorldAnalyzerViewModel : ObservableObject, INavigationAware
public partial class WorldAnalyzerViewModel : ObservableObject, INavigationAware
{
private bool _isInitialized = false;

Expand Down
10 changes: 5 additions & 5 deletions RemnantSaveGuardian/Views/Pages/LogPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//using System.Drawing;
using System;
using System.Text.RegularExpressions;

using Wpf.Ui.Common.Interfaces;
using Wpf.Ui.Controls;

namespace RemnantSaveGuardian.Views.Pages
{
/// <summary>
/// Interaction logic for LogView.xaml
/// </summary>
public partial class LogPage : INavigableView<ViewModels.LogViewModel>
/// <summary>
/// Interaction logic for LogView.xaml
/// </summary>
public partial class LogPage : INavigableView<ViewModels.LogViewModel>
{
public ViewModels.LogViewModel ViewModel
{
Expand Down
9 changes: 4 additions & 5 deletions RemnantSaveGuardian/Views/Pages/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
using System.Windows;
using System.Windows.Controls;
using Wpf.Ui.Common.Interfaces;
using RemnantSaveGuardian.Views.Windows;
using RemnantSaveGuardian.Helpers;

namespace RemnantSaveGuardian.Views.Pages
{
/// <summary>
/// Interaction logic for SettingsPage.xaml
/// </summary>
public partial class SettingsPage : INavigableView<ViewModels.SettingsViewModel>
/// <summary>
/// Interaction logic for SettingsPage.xaml
/// </summary>
public partial class SettingsPage : INavigableView<ViewModels.SettingsViewModel>
{
public ViewModels.SettingsViewModel ViewModel
{
Expand Down
11 changes: 6 additions & 5 deletions RemnantSaveGuardian/Views/Windows/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using RemnantSaveGuardian.Helpers;
using RemnantSaveGuardian.Services;
using RemnantSaveGuardian.ViewModels;
using RemnantSaveGuardian.Views.Pages;

using System;
using System.IO;
using System.Linq;
Expand All @@ -14,14 +14,15 @@
using Wpf.Ui.Controls;
using Wpf.Ui.Controls.Interfaces;
using Wpf.Ui.Mvvm.Contracts;

using WPFLocalizeExtension.Engine;

namespace RemnantSaveGuardian.Views.Windows
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : INavigationWindow
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : INavigationWindow
{
public ViewModels.MainWindowViewModel ViewModel
{
Expand Down

0 comments on commit 8a411c1

Please sign in to comment.