From 32e0bfcb18d283f9ffa4090703124ca9d19c1da4 Mon Sep 17 00:00:00 2001 From: SuperSonic16 <25761885+thesupersonic16@users.noreply.github.com> Date: Fri, 21 Feb 2025 15:05:59 +1100 Subject: [PATCH] Fixed typos for linux compatibility. --- Source/HedgeModManager.UI/Languages/en-AU.axaml | 1 + .../ViewModels/MainWindowViewModel.cs | 4 ++++ Source/HedgeModManager/LinuxCompatibility.cs | 11 ++++++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Source/HedgeModManager.UI/Languages/en-AU.axaml b/Source/HedgeModManager.UI/Languages/en-AU.axaml index 745c192..31c5b33 100644 --- a/Source/HedgeModManager.UI/Languages/en-AU.axaml +++ b/Source/HedgeModManager.UI/Languages/en-AU.axaml @@ -154,6 +154,7 @@ Hedge Mod Manager does not have write access to the game files. Please make sure the game files are writable. Mod configuration has been saved. Hedge Mod Manager currently cannot launch games while in Gaming Mode. Please exit Hedge Mod Manager then launch the game. Failed to install mod. Check log for exception. + An error occurred while trying to install the mod loader. Check log for exception. Please update Hedge Mod Manager using your system's package manager. Hedge Mod Manager does not have permissions to the selected directory. Please select another directory. There is an update available for {0}. Would you like to update the mod? diff --git a/Source/HedgeModManager.UI/ViewModels/MainWindowViewModel.cs b/Source/HedgeModManager.UI/ViewModels/MainWindowViewModel.cs index 59c7349..b81b3f6 100644 --- a/Source/HedgeModManager.UI/ViewModels/MainWindowViewModel.cs +++ b/Source/HedgeModManager.UI/ViewModels/MainWindowViewModel.cs @@ -298,6 +298,10 @@ await CreateSimpleDownload("Download.Text.InstallModLoader", "Failed to install } IsBusy = false; Dispatcher.UIThread.Invoke(RefreshUI); + }).OnError((d, e) => + { + OpenErrorMessage("Modal.Title.InstallError", "Modal.Message.ModLoaderInstallError", "Failed to install modloader", e); + return Task.CompletedTask; }).RunAsync(this); } diff --git a/Source/HedgeModManager/LinuxCompatibility.cs b/Source/HedgeModManager/LinuxCompatibility.cs index ebcbbeb..c1ea8ab 100644 --- a/Source/HedgeModManager/LinuxCompatibility.cs +++ b/Source/HedgeModManager/LinuxCompatibility.cs @@ -41,17 +41,17 @@ await Task.Run(() => if (entry.FullName.EndsWith('/')) { // Untested, tests from HMM 7 to 8 is needed - if (Directory.Exists(path) || File.Exists(path)) + if (Directory.Exists(destinationPath) || File.Exists(destinationPath)) { - var attributes = new FileInfo(path).Attributes; + var attributes = new FileInfo(destinationPath).Attributes; if (attributes.HasFlag(FileAttributes.ReparsePoint)) { - Logger.Debug($"Symlink detected, unlinking \"{path}\""); - File.Delete(path); + Logger.Debug($"Symlink detected, unlinking \"{destinationPath}\""); + File.Delete(destinationPath); } else { - Directory.Delete(path, true); + Directory.Delete(destinationPath, true); } } continue; @@ -63,6 +63,7 @@ await Task.Run(() => File.Delete(destinationPath); } + Directory.CreateDirectory(Path.GetDirectoryName(destinationPath)!); entry.ExtractToFile(destinationPath, true); } Logger.Debug($"Extracted .NET runtime");