diff --git a/xcom2-launcher/xcom2-launcher/Classes/Helper/GitVersionInfo.cs b/xcom2-launcher/xcom2-launcher/Classes/Helper/GitVersionInfo.cs index d444690..d834ea7 100644 --- a/xcom2-launcher/xcom2-launcher/Classes/Helper/GitVersionInfo.cs +++ b/xcom2-launcher/xcom2-launcher/Classes/Helper/GitVersionInfo.cs @@ -23,7 +23,7 @@ static class GitVersionInfo static GitVersionInfo() { var assembly = Assembly.GetExecutingAssembly(); - var fields = assembly.GetType("XCOM2Launcher.GitVersionInformation").GetFields(); + var fields = assembly.GetType("GitVersionInformation").GetFields(); int.TryParse(fields.Single(f => f.Name == "Major").GetValue(null).ToString(), out Major); int.TryParse(fields.Single(f => f.Name == "Minor").GetValue(null).ToString(), out Minor); diff --git a/xcom2-launcher/xcom2-launcher/Classes/Log4Net/SentryAppender.cs b/xcom2-launcher/xcom2-launcher/Classes/Log4Net/SentryAppender.cs index b5836dd..1370d45 100644 --- a/xcom2-launcher/xcom2-launcher/Classes/Log4Net/SentryAppender.cs +++ b/xcom2-launcher/xcom2-launcher/Classes/Log4Net/SentryAppender.cs @@ -114,7 +114,7 @@ protected override void Append(LoggingEvent loggingEvent) if (SendIdentity && !string.IsNullOrEmpty(loggingEvent.Identity)) { - evt.User = new User + evt.User = new SentryUser { Id = loggingEvent.Identity }; diff --git a/xcom2-launcher/xcom2-launcher/Program.cs b/xcom2-launcher/xcom2-launcher/Program.cs index 5c29adf..829a842 100644 --- a/xcom2-launcher/xcom2-launcher/Program.cs +++ b/xcom2-launcher/xcom2-launcher/Program.cs @@ -127,11 +127,11 @@ private static void Main() } // clean up old files - if (File.Exists(Program.XEnv.DefaultConfigDir + @"\DefaultModOptions.ini.bak")) + if (File.Exists(XEnv.DefaultConfigDir + @"\DefaultModOptions.ini.bak")) { // Restore backup - File.Copy(Program.XEnv.DefaultConfigDir + @"\DefaultModOptions.ini.bak", Program.XEnv.DefaultConfigDir + @"\DefaultModOptions.ini", true); - File.Delete(Program.XEnv.DefaultConfigDir + @"\DefaultModOptions.ini.bak"); + File.Copy(XEnv.DefaultConfigDir + @"\DefaultModOptions.ini.bak", XEnv.DefaultConfigDir + @"\DefaultModOptions.ini", true); + File.Delete(XEnv.DefaultConfigDir + @"\DefaultModOptions.ini.bak"); } Application.Run(new MainForm(settings)); @@ -193,16 +193,16 @@ private static IDisposable InitSentry() o.Debug = false; o.Environment = environment; o.MaxBreadcrumbs = 50; - o.BeforeSend = sentryEvent => - { - sentryEvent.User.Email = null; - return sentryEvent; - }; + o.SetBeforeSend(sentryEvent => + { + sentryEvent.User.Email = null; + return sentryEvent; + }); }); SentrySdk.ConfigureScope(scope => { - scope.User = new User + scope.User = new SentryUser { Id = GlobalSettings.Instance.Guid, Username = GlobalSettings.Instance.UserName, @@ -341,7 +341,7 @@ public static Settings InitializeSettings() // Verify Game Path if (!Directory.Exists(settings.GamePath)) - settings.GamePath = Program.XEnv.DetectGameDir(); + settings.GamePath = XEnv.DetectGameDir(); if (settings.GamePath == "") { @@ -477,14 +477,14 @@ public static bool CheckForUpdate() Log.Info("Pre-Release updates enabled"); // fetch all releases including pre-releases and select the first/newest var jsonAllReleases = client.DownloadString("https://api.github.com/repos/X2CommunityCore/xcom2-launcher/releases"); - var allReleases = Newtonsoft.Json.JsonConvert.DeserializeObject>(jsonAllReleases); + var allReleases = JsonConvert.DeserializeObject>(jsonAllReleases); release = allReleases.FirstOrDefault(); } else { // fetch latest non-pre-release var json = client.DownloadString("https://api.github.com/repos/X2CommunityCore/xcom2-launcher/releases/latest"); - release = Newtonsoft.Json.JsonConvert.DeserializeObject(json); + release = JsonConvert.DeserializeObject(json); } if (release == null) @@ -493,8 +493,8 @@ public static bool CheckForUpdate() return false; } - bool parsingSucceeded = SemVersion.TryParse(GitVersionInfo.SemVer, out SemVersion currentVersion); - parsingSucceeded &= SemVersion.TryParse(release.tag_name.TrimStart('v'), out SemVersion newVersion); + bool parsingSucceeded = SemVersion.TryParse(GitVersionInfo.SemVer, SemVersionStyles.Any, out SemVersion currentVersion); + parsingSucceeded &= SemVersion.TryParse(release.tag_name.TrimStart('v'), SemVersionStyles.Any ,out SemVersion newVersion); if (parsingSucceeded) { @@ -502,7 +502,7 @@ public static bool CheckForUpdate() if (!Settings.Instance.IncludeAlphaVersions && newVersion.Prerelease.Contains("alpha")) return false; - if (currentVersion < newVersion) + if (currentVersion.CompareSortOrderTo(newVersion) == -1) { // New version available Log.Info("New version available " + newVersion); diff --git a/xcom2-launcher/xcom2-launcher/app.config b/xcom2-launcher/xcom2-launcher/app.config index c877875..27070b2 100644 --- a/xcom2-launcher/xcom2-launcher/app.config +++ b/xcom2-launcher/xcom2-launcher/app.config @@ -14,7 +14,27 @@ - + + + + + + + + + + + + + + + + + + + + + diff --git a/xcom2-launcher/xcom2-launcher/packages.config b/xcom2-launcher/xcom2-launcher/packages.config index 5bc650e..7ecb00a 100644 --- a/xcom2-launcher/xcom2-launcher/packages.config +++ b/xcom2-launcher/xcom2-launcher/packages.config @@ -1,25 +1,25 @@  - - + + - - - - + + + + - - + + - - + + - - + + - - + + \ No newline at end of file diff --git a/xcom2-launcher/xcom2-launcher/xcom2-launcher.csproj b/xcom2-launcher/xcom2-launcher/xcom2-launcher.csproj index 6e974c2..cfe7680 100644 --- a/xcom2-launcher/xcom2-launcher/xcom2-launcher.csproj +++ b/xcom2-launcher/xcom2-launcher/xcom2-launcher.csproj @@ -1,5 +1,6 @@  + Debug @@ -70,35 +71,35 @@ ..\packages\FCTB.2.16.24\lib\FastColoredTextBox.dll - - ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll + + ..\packages\log4net.2.0.17\lib\net45\log4net.dll ..\packages\Markdown.2.2.1\lib\net451\Markdown.dll - - ..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll - - ..\packages\Microsoft-WindowsAPICodePack-Core.1.1.4\lib\net472\Microsoft.WindowsAPICodePack.dll + + ..\packages\Microsoft-WindowsAPICodePack-Core.1.1.5\lib\net472\Microsoft.WindowsAPICodePack.dll - - ..\packages\Microsoft-WindowsAPICodePack-Shell.1.1.4\lib\net472\Microsoft.WindowsAPICodePack.Shell.dll + + ..\packages\Microsoft-WindowsAPICodePack-Shell.1.1.5\lib\net472\Microsoft.WindowsAPICodePack.Shell.dll - - ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\packages\ObjectListView.Official.2.9.1\lib\net20\ObjectListView.dll - - ..\packages\Semver.2.0.6\lib\net452\Semver.dll + + ..\packages\Semver.2.3.0\lib\net452\Semver.dll - - ..\packages\Sentry.3.2.0\lib\net461\Sentry.dll + + ..\packages\Sentry.4.4.0\lib\net462\Sentry.dll False @@ -108,36 +109,37 @@ ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - ..\packages\System.Collections.Immutable.5.0.0\lib\net461\System.Collections.Immutable.dll + + ..\packages\System.Collections.Immutable.8.0.0\lib\net462\System.Collections.Immutable.dll + - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - ..\packages\System.Reflection.Metadata.5.0.0\lib\net461\System.Reflection.Metadata.dll + + ..\packages\System.Reflection.Metadata.8.0.0\lib\net462\System.Reflection.Metadata.dll - - ..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll True True - - ..\packages\System.Text.Encodings.Web.5.0.0\lib\net461\System.Text.Encodings.Web.dll + + ..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll - - ..\packages\System.Text.Json.5.0.0\lib\net461\System.Text.Json.dll + + ..\packages\System.Text.Json.8.0.3\lib\net462\System.Text.Json.dll ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll @@ -382,11 +384,14 @@ - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + + + + + \ No newline at end of file