From 7dcd217ecd6976b6f17851dcd3826afacfba965c Mon Sep 17 00:00:00 2001 From: Goose-Bomb Date: Fri, 1 Nov 2019 23:53:25 -0700 Subject: [PATCH] Tackle problems of migration --- GBCLV3.Tests/AssetTest.cs | 3 - GBCLV3.Tests/InstallTest.cs | 3 - GBCLV3.Tests/LaunchTest.cs | 3 - GBCLV3.Tests/LibraryTest.cs | 4 - GBCLV3.Tests/ModTest.cs | 2 - GBCLV3.Tests/ResourcePackTest.cs | 2 - GBCLV3.Tests/TestUtils.cs | 1 - GBCLV3.Tests/UpdateTest.cs | 1 - GBCLV3.Tests/VersionTest.cs | 3 - GBCLV3/Bootstrapper.cs | Bin 11156 -> 11098 bytes GBCLV3/FodyWeavers.xml | 1 - GBCLV3/FodyWeavers.xsd | 86 ---- GBCLV3/GBCLV3.csproj | 14 +- GBCLV3/Models/Installation/Fabric.cs | 8 +- GBCLV3/Models/Installation/OptiFine.cs | 8 +- .../Installation/FabricInstallService.cs | 5 - .../Installation/ForgeInstallService.cs | 9 +- .../Installation/OptifineInstallService.cs | 8 +- GBCLV3/Services/Launcher/LaunchService.cs | 1 - GBCLV3/Services/ModService.cs | 4 +- GBCLV3/Services/ResourcePackService.cs | 5 +- GBCLV3/Services/ThemeService.cs | 8 +- GBCLV3/Utils/CryptUtil.cs | 3 +- GBCLV3/Utils/SystemUtil.cs | 9 + GBCLV3/ViewModels/DownloadViewModel.cs | 2 +- GBCLV3/ViewModels/FabricInstallViewModel.cs | 4 +- GBCLV3/ViewModels/GameSettingsViewModel.cs | 5 +- .../ViewModels/LauncherSettingsViewModel.cs | 2 +- GBCLV3/ViewModels/ModViewModel.cs | 6 +- GBCLV3/ViewModels/Pages/AboutViewModel.cs | 7 +- GBCLV3/ViewModels/ResourcePackViewModel.cs | 8 +- .../ViewModels/VersionsManagementViewModel.cs | 7 +- .../Windows/ErrorReportViewModel.cs | 7 +- GBCLV3/ViewModels/Windows/MainViewModel.cs | Bin 6014 -> 6012 bytes MigrationBackup/9bea372f/GBCLV3/GBCLV3.csproj | 412 ------------------ .../9bea372f/GBCLV3/NuGetUpgradeLog.html | 175 -------- .../9bea372f/GBCLV3/packages.config | 19 - 37 files changed, 59 insertions(+), 786 deletions(-) delete mode 100644 MigrationBackup/9bea372f/GBCLV3/GBCLV3.csproj delete mode 100644 MigrationBackup/9bea372f/GBCLV3/NuGetUpgradeLog.html delete mode 100644 MigrationBackup/9bea372f/GBCLV3/packages.config diff --git a/GBCLV3.Tests/AssetTest.cs b/GBCLV3.Tests/AssetTest.cs index 239886d..7699617 100644 --- a/GBCLV3.Tests/AssetTest.cs +++ b/GBCLV3.Tests/AssetTest.cs @@ -1,8 +1,5 @@ using System.Diagnostics; using System.Linq; -using GBCLV3.Models; -using GBCLV3.Services; -using GBCLV3.Services.Launcher; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace GBCLV3.Tests diff --git a/GBCLV3.Tests/InstallTest.cs b/GBCLV3.Tests/InstallTest.cs index 4c9862b..f0906a4 100644 --- a/GBCLV3.Tests/InstallTest.cs +++ b/GBCLV3.Tests/InstallTest.cs @@ -1,8 +1,5 @@ using System.Diagnostics; using System.Linq; -using GBCLV3.Services; -using GBCLV3.Services.Launcher; -using GBCLV3.Services.Installation; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace GBCLV3.Tests diff --git a/GBCLV3.Tests/LaunchTest.cs b/GBCLV3.Tests/LaunchTest.cs index cba4a93..24e8d3b 100644 --- a/GBCLV3.Tests/LaunchTest.cs +++ b/GBCLV3.Tests/LaunchTest.cs @@ -1,8 +1,5 @@ using System.Diagnostics; using System.Linq; -using GBCLV3.Models.Launcher; -using GBCLV3.Services; -using GBCLV3.Services.Launcher; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace GBCLV3.Tests diff --git a/GBCLV3.Tests/LibraryTest.cs b/GBCLV3.Tests/LibraryTest.cs index bcb7cd0..e692208 100644 --- a/GBCLV3.Tests/LibraryTest.cs +++ b/GBCLV3.Tests/LibraryTest.cs @@ -1,9 +1,5 @@ using System.Diagnostics; using System.Linq; -using GBCLV3.Models; -using GBCLV3.Models.Launcher; -using GBCLV3.Services; -using GBCLV3.Services.Launcher; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace GBCLV3.Tests diff --git a/GBCLV3.Tests/ModTest.cs b/GBCLV3.Tests/ModTest.cs index 463db08..7ac7cb0 100644 --- a/GBCLV3.Tests/ModTest.cs +++ b/GBCLV3.Tests/ModTest.cs @@ -1,6 +1,4 @@ using System.Diagnostics; -using GBCLV3.Services; -using GBCLV3.Services.Launcher; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace GBCLV3.Tests diff --git a/GBCLV3.Tests/ResourcePackTest.cs b/GBCLV3.Tests/ResourcePackTest.cs index af4fb17..94136b1 100644 --- a/GBCLV3.Tests/ResourcePackTest.cs +++ b/GBCLV3.Tests/ResourcePackTest.cs @@ -1,7 +1,5 @@ using System.Diagnostics; using System.Linq; -using GBCLV3.Services; -using GBCLV3.Services.Launcher; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace GBCLV3.Tests diff --git a/GBCLV3.Tests/TestUtils.cs b/GBCLV3.Tests/TestUtils.cs index d0cb282..6066e7c 100644 --- a/GBCLV3.Tests/TestUtils.cs +++ b/GBCLV3.Tests/TestUtils.cs @@ -1,6 +1,5 @@ using System.Net; using System.Net.Http; -using GBCLV3.Models; namespace GBCLV3.Tests { diff --git a/GBCLV3.Tests/UpdateTest.cs b/GBCLV3.Tests/UpdateTest.cs index a998c81..a07ed4d 100644 --- a/GBCLV3.Tests/UpdateTest.cs +++ b/GBCLV3.Tests/UpdateTest.cs @@ -1,6 +1,5 @@ using System.Diagnostics; using System.Linq; -using GBCLV3.Services; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace GBCLV3.Tests diff --git a/GBCLV3.Tests/VersionTest.cs b/GBCLV3.Tests/VersionTest.cs index bf13472..18d82bd 100644 --- a/GBCLV3.Tests/VersionTest.cs +++ b/GBCLV3.Tests/VersionTest.cs @@ -1,8 +1,5 @@ using System.Diagnostics; using System.Linq; -using GBCLV3.Models; -using GBCLV3.Services; -using GBCLV3.Services.Launcher; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace GBCLV3.Tests diff --git a/GBCLV3/Bootstrapper.cs b/GBCLV3/Bootstrapper.cs index 452edae818d3a31d30089e7222ab923ea7e29f32..816cc38340259faf14a296faaa3247a508cef545 100644 GIT binary patch delta 10 ScmbOdek*LkvW*Y6XaN8pp9R4H delta 26 icmcZ=HYI$*GEQHHRE89WOoqgX@`@8P_%<%trUd|hiwQ^o diff --git a/GBCLV3/FodyWeavers.xml b/GBCLV3/FodyWeavers.xml index 3ffe73c..035f97a 100644 --- a/GBCLV3/FodyWeavers.xml +++ b/GBCLV3/FodyWeavers.xml @@ -1,5 +1,4 @@  - \ No newline at end of file diff --git a/GBCLV3/FodyWeavers.xsd b/GBCLV3/FodyWeavers.xsd index 112d363..2f1b8aa 100644 --- a/GBCLV3/FodyWeavers.xsd +++ b/GBCLV3/FodyWeavers.xsd @@ -33,92 +33,6 @@ - - - - - - A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks - - - - - A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. - - - - - A list of unmanaged 32 bit assembly names to include, delimited with line breaks. - - - - - A list of unmanaged 64 bit assembly names to include, delimited with line breaks. - - - - - The order of preloaded assemblies, delimited with line breaks. - - - - - - This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. - - - - - Controls if .pdbs for reference assemblies are also embedded. - - - - - Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. - - - - - As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. - - - - - Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. - - - - - Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. - - - - - A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | - - - - - A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. - - - - - A list of unmanaged 32 bit assembly names to include, delimited with |. - - - - - A list of unmanaged 64 bit assembly names to include, delimited with |. - - - - - The order of preloaded assemblies, delimited with |. - - - - diff --git a/GBCLV3/GBCLV3.csproj b/GBCLV3/GBCLV3.csproj index 0591cfe..e68871a 100644 --- a/GBCLV3/GBCLV3.csproj +++ b/GBCLV3/GBCLV3.csproj @@ -12,16 +12,22 @@ AnyCPU;x64 + + DEBUG;TRACE + + + - 1.12.0-preview2 + 1.12.1 - - 4.1.0 + + all + runtime; build; native; contentfiles; analyzers; buildtransitive 1.1.0 @@ -30,7 +36,7 @@ 3.1.3 - 1.2.0 + 1.3.0 diff --git a/GBCLV3/Models/Installation/Fabric.cs b/GBCLV3/Models/Installation/Fabric.cs index 90b0252..74f99fc 100644 --- a/GBCLV3/Models/Installation/Fabric.cs +++ b/GBCLV3/Models/Installation/Fabric.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Documents; +using System.Collections.Generic; using GBCLV3.Models.JsonClasses; -using GBCLV3.Models.Launcher; namespace GBCLV3.Models.Installation { diff --git a/GBCLV3/Models/Installation/OptiFine.cs b/GBCLV3/Models/Installation/OptiFine.cs index e26eb6c..ec3c91f 100644 --- a/GBCLV3/Models/Installation/OptiFine.cs +++ b/GBCLV3/Models/Installation/OptiFine.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace GBCLV3.Models.Installation +namespace GBCLV3.Models.Installation { class OptiFine { diff --git a/GBCLV3/Services/Installation/FabricInstallService.cs b/GBCLV3/Services/Installation/FabricInstallService.cs index 3622fad..472a432 100644 --- a/GBCLV3/Services/Installation/FabricInstallService.cs +++ b/GBCLV3/Services/Installation/FabricInstallService.cs @@ -1,15 +1,10 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Net.Http; -using System.Runtime.InteropServices; -using System.Text; using System.Text.Json; using System.Threading.Tasks; -using System.Windows.Documents; -using GBCLV3.Models; using GBCLV3.Models.Installation; using GBCLV3.Models.JsonClasses; using GBCLV3.Services.Launcher; diff --git a/GBCLV3/Services/Installation/ForgeInstallService.cs b/GBCLV3/Services/Installation/ForgeInstallService.cs index cfa8d6a..5a6a481 100644 --- a/GBCLV3/Services/Installation/ForgeInstallService.cs +++ b/GBCLV3/Services/Installation/ForgeInstallService.cs @@ -59,7 +59,7 @@ public async Task> GetDownloadListAsync(string id) string json = await _client.GetStringAsync(FORGE_LIST_URL + id); var forgeList = JsonSerializer.Deserialize>(json); - var nums = id.Split('.') + int[] nums = id.Split('.') .Select(numStr => { if (int.TryParse(numStr, out int num)) @@ -135,7 +135,12 @@ public async Task ManualInstall(Forge forge) // Just a dummy json...but required by forge installer if (!File.Exists(profilePath)) File.WriteAllText(profilePath, "{}"); - var process = Process.Start(installerPath); + var process = Process.Start(new ProcessStartInfo + { + FileName = installerPath, + UseShellExecute = true, + }); + await Task.Run(() => process.WaitForExit()); File.Delete(installerPath); File.Delete($"{forge.GameVersion}-{forge.Version}-installer.jar.log"); diff --git a/GBCLV3/Services/Installation/OptifineInstallService.cs b/GBCLV3/Services/Installation/OptifineInstallService.cs index 639fdb6..94d1aeb 100644 --- a/GBCLV3/Services/Installation/OptifineInstallService.cs +++ b/GBCLV3/Services/Installation/OptifineInstallService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace GBCLV3.Services.Installation +namespace GBCLV3.Services.Installation { class OptiFineInstallService { diff --git a/GBCLV3/Services/Launcher/LaunchService.cs b/GBCLV3/Services/Launcher/LaunchService.cs index f7ef373..863a739 100644 --- a/GBCLV3/Services/Launcher/LaunchService.cs +++ b/GBCLV3/Services/Launcher/LaunchService.cs @@ -2,7 +2,6 @@ using System.Diagnostics; using System.Linq; using System.Text; -using System.Threading; using System.Threading.Tasks; using GBCLV3.Models.Launcher; using GBCLV3.Utils; diff --git a/GBCLV3/Services/ModService.cs b/GBCLV3/Services/ModService.cs index 5d4aa5f..1d8e5a4 100644 --- a/GBCLV3/Services/ModService.cs +++ b/GBCLV3/Services/ModService.cs @@ -66,7 +66,7 @@ public async Task> MoveLoadAll(IEnumerable paths) return await Task.Run(() => paths.Select(path => { - var dstPath = $"{_gamePathService.ModsDir}/{Path.GetFileName(path)}"; + string dstPath = $"{_gamePathService.ModsDir}/{Path.GetFileName(path)}"; if (File.Exists(dstPath)) return null; File.Move(path, dstPath); @@ -85,7 +85,7 @@ private static Mod Load(string path) { using var archive = ZipFile.OpenRead(path); bool isEnabled = path.EndsWith(".jar"); - if (!isEnabled) path = path.Substring(0, path.Length - 9); + if (!isEnabled) path = path[0..^9]; var info = archive.GetEntry("mcmod.info"); if (info != null) diff --git a/GBCLV3/Services/ResourcePackService.cs b/GBCLV3/Services/ResourcePackService.cs index e7910af..b8f88c2 100644 --- a/GBCLV3/Services/ResourcePackService.cs +++ b/GBCLV3/Services/ResourcePackService.cs @@ -3,7 +3,6 @@ using System.IO; using System.IO.Compression; using System.Linq; -using System.Runtime.InteropServices; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; @@ -52,7 +51,7 @@ public ResourcePackService(GamePathService gamePathService) if (line.StartsWith("resourcePacks")) { // Extract “resourcePacks:[${enabledPackIDs}]” - enabledPackIDs = line.Substring(15, line.Length - 16) + enabledPackIDs = line[15..^1] .Split(',') .Select(id => id.Trim('\"')) .ToArray(); @@ -113,7 +112,7 @@ public async Task> MoveLoadAll(IEnumerable pat return await Task.Run(() => paths.Select(path => { - var dstPath = $"{_gamePathService.ResourcePacksDir}/{Path.GetFileName(path)}"; + string dstPath = $"{_gamePathService.ResourcePacksDir}/{Path.GetFileName(path)}"; if (File.Exists(dstPath)) return null; var pack = LoadZip(dstPath, null); diff --git a/GBCLV3/Services/ThemeService.cs b/GBCLV3/Services/ThemeService.cs index 2fcf743..1d47603 100644 --- a/GBCLV3/Services/ThemeService.cs +++ b/GBCLV3/Services/ThemeService.cs @@ -40,10 +40,10 @@ public string FontWeight private const string ICONS_SOURCE = "/GBCL;component/Resources/Styles/Icons.xaml"; private const string DEFAULT_BACKGROUND_IMAGE = "pack://application:,,,/Resources/Images/default_background.png"; - private static readonly Color REF_COLOR_SPIKE = Color.FromRgb(15, 105, 200); - private static readonly Color REF_COLOR_BULLZEYE = Color.FromRgb(210, 50, 55); - private static readonly Color REF_COLOR_TBONE = Color.FromRgb(165, 125, 10); - private static readonly Color REF_COLOR_STEGZ = Color.FromRgb(105, 175, 5); + private static readonly Color REF_COLOR_SPIKE = Color.FromRgb(15, 105, 200); + private static readonly Color REF_COLOR_BULLZEYE = Color.FromRgb(210, 50, 55); + private static readonly Color REF_COLOR_TBONE = Color.FromRgb(165, 125, 10); + private static readonly Color REF_COLOR_STEGZ = Color.FromRgb(105, 175, 5); private readonly Config _config; diff --git a/GBCLV3/Utils/CryptUtil.cs b/GBCLV3/Utils/CryptUtil.cs index 6ac18fa..7dfa9b7 100644 --- a/GBCLV3/Utils/CryptUtil.cs +++ b/GBCLV3/Utils/CryptUtil.cs @@ -1,5 +1,4 @@ -using System; -using System.IO; +using System.IO; using System.Security.Cryptography; using System.Text; diff --git a/GBCLV3/Utils/SystemUtil.cs b/GBCLV3/Utils/SystemUtil.cs index c19e3bd..3167944 100644 --- a/GBCLV3/Utils/SystemUtil.cs +++ b/GBCLV3/Utils/SystemUtil.cs @@ -28,6 +28,15 @@ public static string GetJavaDir() } } + public static void OpenLink(string url) + { + Process.Start(new ProcessStartInfo + { + FileName = url, + UseShellExecute = true, + }); + } + public static uint GetAvailableMemory() { using var counter = new PerformanceCounter("Memory", "Available MBytes", true); diff --git a/GBCLV3/ViewModels/DownloadViewModel.cs b/GBCLV3/ViewModels/DownloadViewModel.cs index 9788ba2..c0d7975 100644 --- a/GBCLV3/ViewModels/DownloadViewModel.cs +++ b/GBCLV3/ViewModels/DownloadViewModel.cs @@ -85,7 +85,7 @@ public void Setup(DownloadType type, DownloadService downloadService) private static string GetBytesProgressText(int downloaded, int total) { - string GetMB(int bytes) => (bytes / (1024.0 * 1024.0)).ToString("0.00"); + static string GetMB(int bytes) => (bytes / (1024.0 * 1024.0)).ToString("0.00"); // In case don't know the sizes of downloads in advance if (downloaded >= total) { diff --git a/GBCLV3/ViewModels/FabricInstallViewModel.cs b/GBCLV3/ViewModels/FabricInstallViewModel.cs index c842337..feb64b6 100644 --- a/GBCLV3/ViewModels/FabricInstallViewModel.cs +++ b/GBCLV3/ViewModels/FabricInstallViewModel.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; using System.Windows; using GBCLV3.Models; diff --git a/GBCLV3/ViewModels/GameSettingsViewModel.cs b/GBCLV3/ViewModels/GameSettingsViewModel.cs index 13cfbbc..6134cc3 100644 --- a/GBCLV3/ViewModels/GameSettingsViewModel.cs +++ b/GBCLV3/ViewModels/GameSettingsViewModel.cs @@ -1,5 +1,4 @@ using System; -using System.Diagnostics; using System.IO; using System.Windows.Controls; using GBCLV3.Models; @@ -15,6 +14,8 @@ class GameSettingsViewModel : Screen { #region Private Members + const string JRE_DOWNLOAD_URL = "https://bmclapi.bangbang93.com/java/jre_x64.exe"; + // IoC private readonly Config _config; private readonly LanguageService _languageService; @@ -183,7 +184,7 @@ public void SelectJrePath() } } - public void DonwloadJreInstaller() => Process.Start("https://bmclapi.bangbang93.com/java/jre_x64.exe"); + public void DonwloadJreInstaller() => SystemUtil.OpenLink(JRE_DOWNLOAD_URL); public void SelectGameDir() { diff --git a/GBCLV3/ViewModels/LauncherSettingsViewModel.cs b/GBCLV3/ViewModels/LauncherSettingsViewModel.cs index 2cc63e7..73eb699 100644 --- a/GBCLV3/ViewModels/LauncherSettingsViewModel.cs +++ b/GBCLV3/ViewModels/LauncherSettingsViewModel.cs @@ -30,7 +30,7 @@ public LauncherSettingsViewModel( LanguageService languageService, UpdateService updateService, ThemeService themeService, - + UpdateViewModel updateVM, IWindowManager windowManager) { diff --git a/GBCLV3/ViewModels/ModViewModel.cs b/GBCLV3/ViewModels/ModViewModel.cs index 054ac54..c9243bc 100644 --- a/GBCLV3/ViewModels/ModViewModel.cs +++ b/GBCLV3/ViewModels/ModViewModel.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; using System.Threading.Tasks; @@ -8,6 +7,7 @@ using GBCLV3.Models; using GBCLV3.Services; using GBCLV3.Services.Launcher; +using GBCLV3.Utils; using Stylet; using StyletIoC; @@ -83,10 +83,10 @@ public async void Reload() public void OpenDir() { Directory.CreateDirectory(_gamePathService.ModsDir); - Process.Start(_gamePathService.ModsDir); + SystemUtil.OpenLink(_gamePathService.ModsDir); } - public void OpenLink(string url) => Process.Start(url); + public void OpenLink(string url) => SystemUtil.OpenLink(url); public void SelectionChanged(ListBox _, SelectionChangedEventArgs e) { diff --git a/GBCLV3/ViewModels/Pages/AboutViewModel.cs b/GBCLV3/ViewModels/Pages/AboutViewModel.cs index d9b605b..7f07766 100644 --- a/GBCLV3/ViewModels/Pages/AboutViewModel.cs +++ b/GBCLV3/ViewModels/Pages/AboutViewModel.cs @@ -1,7 +1,4 @@ -using System.Diagnostics; -using GBCLV3.Models; -using GBCLV3.Services; -using GBCLV3.Utils; +using GBCLV3.Utils; using Stylet; using StyletIoC; @@ -50,7 +47,7 @@ public AboutViewModel(IWindowManager windowManager) public string Forge => "Support Minecraft Forge"; public string ForgePage => "https://www.patreon.com/LexManos"; - public void OpenLink(string url) => Process.Start(url); + public void OpenLink(string url) => SystemUtil.OpenLink(url); public void DontStop() => _windowManager.ShowMessageBox("${DontStop}", "${FlowerOfHope}"); diff --git a/GBCLV3/ViewModels/ResourcePackViewModel.cs b/GBCLV3/ViewModels/ResourcePackViewModel.cs index 87e38da..415c300 100644 --- a/GBCLV3/ViewModels/ResourcePackViewModel.cs +++ b/GBCLV3/ViewModels/ResourcePackViewModel.cs @@ -1,8 +1,8 @@ -using System.Diagnostics; -using System.Threading.Tasks; +using System.Threading.Tasks; using GBCLV3.Models; using GBCLV3.Services; using GBCLV3.Services.Launcher; +using GBCLV3.Utils; using Stylet; using StyletIoC; @@ -43,9 +43,9 @@ public ResourcePackViewModel( public BindableCollection DisabledPacks { get; private set; } - public void OpenDir() => Process.Start(_gamePathService.ResourcePacksDir); + public void OpenDir() => SystemUtil.OpenLink(_gamePathService.ResourcePacksDir); - public void Open(string path) => Process.Start(path); + public void Open(string path) => SystemUtil.OpenLink(path); public async void Delete(ResourcePack pack) { diff --git a/GBCLV3/ViewModels/VersionsManagementViewModel.cs b/GBCLV3/ViewModels/VersionsManagementViewModel.cs index 738eaeb..2099e54 100644 --- a/GBCLV3/ViewModels/VersionsManagementViewModel.cs +++ b/GBCLV3/ViewModels/VersionsManagementViewModel.cs @@ -1,12 +1,11 @@ using System; -using System.Diagnostics; using System.IO; using System.Windows; using GBCLV3.Models; using GBCLV3.Models.Installation; -using GBCLV3.Models.Launcher; using GBCLV3.Services; using GBCLV3.Services.Launcher; +using GBCLV3.Utils; using Stylet; using StyletIoC; using Version = GBCLV3.Models.Launcher.Version; @@ -76,13 +75,13 @@ public bool IsSegregateVersions public void OpenDir() { string versionsDir = $"{_gamePathService.VersionsDir}/{SelectedVersionID}"; - if (Directory.Exists(versionsDir)) Process.Start(versionsDir); + if (Directory.Exists(versionsDir)) SystemUtil.OpenLink(versionsDir); } public void OpenJson() { string jsonPath = $"{_gamePathService.VersionsDir}/{SelectedVersionID}/{SelectedVersionID}.json"; - if (File.Exists(jsonPath)) Process.Start(jsonPath); + if (File.Exists(jsonPath)) SystemUtil.OpenLink(jsonPath); } public async void Delete() diff --git a/GBCLV3/ViewModels/Windows/ErrorReportViewModel.cs b/GBCLV3/ViewModels/Windows/ErrorReportViewModel.cs index 5d003d2..a53bdb7 100644 --- a/GBCLV3/ViewModels/Windows/ErrorReportViewModel.cs +++ b/GBCLV3/ViewModels/Windows/ErrorReportViewModel.cs @@ -1,5 +1,4 @@ -using System.Diagnostics; -using System.Media; +using System.Media; using System.Windows; using GBCLV3.Models; using GBCLV3.Services; @@ -13,7 +12,7 @@ class ErrorReportViewModel : Screen { #region Private Members - private const string _issuesUrl = "https://github.com/Goose-Bomb/GBCLV3/issues"; + private const string ISSUES_URL = "https://github.com/Goose-Bomb/GBCLV3/issues"; private string _errorMessage; #endregion @@ -48,7 +47,7 @@ public string ErrorMessage public void Close() => this.RequestClose(); - public void Report() => Process.Start(_issuesUrl); + public void Report() => SystemUtil.OpenLink(ISSUES_URL); public void CopyMessage() => Clipboard.SetText(ErrorMessage, TextDataFormat.UnicodeText); diff --git a/GBCLV3/ViewModels/Windows/MainViewModel.cs b/GBCLV3/ViewModels/Windows/MainViewModel.cs index 075dccd61657f53d498fa05ec341c01fad79ee85..9b37dcd9991b2dbde9bcd5db62d0fd32b9c2080c 100644 GIT binary patch delta 24 gcmeyT_eXET8PUmKL{ugVh>1-uVB^> - - - - - - Debug - AnyCPU - {D0538262-7697-4A67-804D-1BFC6FDD141B} - WinExe - GBCLV3 - GBCL - v4.7.2 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - true - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - app.manifest - - - true - bin\x64\Debug\ - DEBUG;TRACE - full - x64 - prompt - MinimumRecommendedRules.ruleset - - - bin\x64\Release\ - TRACE - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - - - enderman.ico - - - - - - - - ..\packages\AdonisUI.1.12.0-preview2\lib\net45\AdonisUI.dll - - - ..\packages\AdonisUI.ClassicTheme.1.12.0-preview2\lib\net45\AdonisUI.ClassicTheme.dll - - - ..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll - - - ..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0-preview9.19421.4\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll - - - - ..\packages\Ookii.Dialogs.Wpf.1.1.0\lib\net45\Ookii.Dialogs.Wpf.dll - - - ..\packages\PropertyChanged.Fody.3.1.3\lib\net40\PropertyChanged.dll - - - ..\packages\Stylet.1.2.0\lib\net45\Stylet.dll - - - - ..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll - - - - - - - - ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll - - - - ..\packages\System.Numerics.Vectors.4.6.0-preview5.19224.8\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0-preview9.19421.4\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll - - - - - ..\packages\System.Text.Encodings.Web.4.6.0-preview9.19421.4\lib\netstandard2.0\System.Text.Encodings.Web.dll - - - ..\packages\System.Text.Json.4.6.0-preview9.19421.4\lib\net461\System.Text.Json.dll - - - ..\packages\System.Threading.Tasks.Extensions.4.6.0-preview.18571.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll - - - ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll - - - - - - - - - 4.0 - - - - - - - - MSBuild:Compile - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - - - - - - False - Microsoft .NET Framework 4.7.2 %28x86 和 x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - - - - - - - - - - - - - - - - - - - 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 - - - - - - \ No newline at end of file diff --git a/MigrationBackup/9bea372f/GBCLV3/NuGetUpgradeLog.html b/MigrationBackup/9bea372f/GBCLV3/NuGetUpgradeLog.html deleted file mode 100644 index ba4edb1..0000000 --- a/MigrationBackup/9bea372f/GBCLV3/NuGetUpgradeLog.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - NuGetMigrationLog -

- NuGet Migration Report - GBCLV3

Overview

Migration to PackageReference was completed successfully. Please build and run your solution to verify that all packages are available.
- If you run into any problems, have feedback, questions, or concerns, please - file an issue on the NuGet GitHub repository.
- Changed files and this report have been backed up here: - F:\Programming\C#\GBCLV3\MigrationBackup\9bea372f\GBCLV3

Packages processed

Top-level dependencies:

Package IdVersion
AdonisUI.ClassicTheme - v1.12.0-preview2
Costura.Fody - v4.1.0
Ookii.Dialogs.Wpf - v1.1.0
PropertyChanged.Fody - v3.1.3
Stylet - v1.2.0
System.Numerics.Vectors - v4.6.0-preview5.19224.8
System.Text.Json - v4.6.0-preview9.19421.4
System.Threading.Tasks.Extensions - v4.6.0-preview.18571.3

Transitive dependencies:

Package IdVersion
AdonisUI - v1.12.0-preview2
Fody - v6.0.0
Microsoft.Bcl.AsyncInterfaces - v1.0.0-preview9.19421.4
System.Buffers - v4.5.0
System.Memory - v4.5.3
System.Runtime.CompilerServices.Unsafe - v4.6.0-preview9.19421.4
System.Text.Encodings.Web - v4.6.0-preview9.19421.4
System.ValueTuple - v4.5.0

Package compatibility issues

Description
- No issues were found. -
\ No newline at end of file diff --git a/MigrationBackup/9bea372f/GBCLV3/packages.config b/MigrationBackup/9bea372f/GBCLV3/packages.config deleted file mode 100644 index 78e2b2b..0000000 --- a/MigrationBackup/9bea372f/GBCLV3/packages.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file