Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #13 from porohkun/0.6/bugfix/hotfixes
Browse files Browse the repository at this point in the history
0.6/bugfix/hotfixes
  • Loading branch information
porohkun authored May 13, 2021
2 parents b3d9aee + 3d9f481 commit 98905a8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ValheimMjod/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected override void OnStartup(StartupEventArgs e)

PlayFab.LoginUser();

if (Settings.Instance.Main.LastLaunchedVersion < Settings.Version)
if (Settings.Instance.Main.LastLaunchedVersion == null || Settings.Instance.Main.LastLaunchedVersion < Settings.Version)
{
Settings.Instance.Main.LastLaunchedVersion = Settings.Version;
Process fileopener = new Process();
Expand Down
24 changes: 14 additions & 10 deletions ValheimMjod/Updater.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Squirrel;
using Rollbar;
using Squirrel;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Windows;
Expand Down Expand Up @@ -64,23 +66,25 @@ public async void CheckUpdates()
var filename = Path.GetFileName(location);
var fullPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(location), "..", filename));
System.Diagnostics.Process.Start(fullPath);
Application.Current.Shutdown();
}
}
}
catch (Exception ex)
catch (Exception e)
{
var errorMessage = $"{ex.Message}\r\n\r\n{ex.StackTrace}\r\n\r\nCopy error message to clipboard?";
if (MessageBox.Show(errorMessage, "Error in update/install process", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
Clipboard.SetText(errorMessage);
throw e;
}
finally
{
Application.Current.Shutdown();
}
}
}
catch (Exception ex)
catch (Exception e)
{
var errorMessage = $"{ex.Message}\r\n\r\n{ex.StackTrace}\r\n\r\nCopy error message to clipboard?";
if (MessageBox.Show(errorMessage, "Error before update/install process", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
Clipboard.SetText(errorMessage);
RollbarLocator.RollbarInstance.Error(e, new Dictionary<string, object>()
{
["version"] = Settings.Version.ToString()
});
}
}
}
Expand Down

0 comments on commit 98905a8

Please sign in to comment.