diff --git a/AM2RLauncher/AM2RLauncher.Wpf/Program.cs b/AM2RLauncher/AM2RLauncher.Wpf/Program.cs index 2a3597a..78821e5 100644 --- a/AM2RLauncher/AM2RLauncher.Wpf/Program.cs +++ b/AM2RLauncher/AM2RLauncher.Wpf/Program.cs @@ -44,7 +44,7 @@ internal static class MainClass #endif //Log Wine - if (OS.IsThisRunningFromWine) log.Info("Currently running from WINE!"); + if (OS.IsThisRunningFromWINE) log.Info("Currently running from WINE!"); // Try catch in case it ever crashes before actually getting to the Eto application try diff --git a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs index e2c6fce..ed78d80 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs @@ -498,7 +498,7 @@ public partial class MainForm : Form bool useHQMusic = hqMusicAndroidCheck.Checked.Value; Progress progressIndicator = new Progress(UpdateProgressBar); - await Task.Run(() => Profile.CreateAPK(profileList[profileIndex.Value], useHQMusic, progressIndicator)); + await Task.Run(() => Profile.CreateApk(profileList[profileIndex.Value], useHQMusic, progressIndicator)); SetApkButtonState(ApkButtonState.Create); DisableProgressBar(); diff --git a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs index 503cab3..853a9ef 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs @@ -5,7 +5,6 @@ using AM2RLauncher.Properties; using Eto.Drawing; using Eto.Forms; using log4net; -using Pablo.Controls; using System; using System.Collections.Generic; using System.Diagnostics; @@ -284,7 +283,7 @@ public partial class MainForm : Form // Version number label Label versionLabel = new Label { - Text = $"v{VERSION}{(OS.IsThisRunningFromWine ? "-WINE" : "")}", + Text = $"v{VERSION}{(OS.IsThisRunningFromWINE ? "-WINE" : "")}", Width = 48, TextAlignment = TextAlignment.Right, TextColor = LauncherColors.Green, Font = new Font(SystemFont.Default, 12) }; @@ -300,7 +299,7 @@ public partial class MainForm : Form mainLayout.AddSpace(); // Yes, I'm hard-coding this string. Linux users can english. - Label wineLabel = OS.IsThisRunningFromWine ? new Label { Text = "Unsupported", TextColor = LauncherColors.Red, TextAlignment = TextAlignment.Right } : null; + Label wineLabel = OS.IsThisRunningFromWINE ? new Label { Text = "Unsupported", TextColor = LauncherColors.Red, TextAlignment = TextAlignment.Right } : null; mainLayout.AddColumn(versionLabel, wineLabel); drawable.Content = mainLayout; diff --git a/AM2RLauncher/AM2RLauncherLib/HelperMethods.cs b/AM2RLauncher/AM2RLauncherLib/HelperMethods.cs index 5a85a86..d49091d 100644 --- a/AM2RLauncher/AM2RLauncherLib/HelperMethods.cs +++ b/AM2RLauncher/AM2RLauncherLib/HelperMethods.cs @@ -2,7 +2,6 @@ using System; using System.IO; using System.Net; -using System.Net.NetworkInformation; using System.Security.Cryptography; namespace AM2RLauncherLib; diff --git a/AM2RLauncher/AM2RLauncherLib/OS.cs b/AM2RLauncher/AM2RLauncherLib/OS.cs index cbe8451..d32299f 100644 --- a/AM2RLauncher/AM2RLauncherLib/OS.cs +++ b/AM2RLauncher/AM2RLauncherLib/OS.cs @@ -51,7 +51,7 @@ public static class OS /// /// Checks if this is run via WINE. /// - public static readonly bool IsThisRunningFromWine = CheckIfRunFromWINE(); + public static readonly bool IsThisRunningFromWINE = CheckIfRunFromWINE(); /// /// Checks if this is run via Flatpak. diff --git a/AM2RLauncher/AM2RLauncherLib/Profile.cs b/AM2RLauncher/AM2RLauncherLib/Profile.cs index ad2a39e..6b9f0d2 100644 --- a/AM2RLauncher/AM2RLauncherLib/Profile.cs +++ b/AM2RLauncher/AM2RLauncherLib/Profile.cs @@ -461,7 +461,7 @@ public static class Profile if (OS.IsLinux) { string assetsPath = profilePath; - profilePath = profilePath.Substring(0, profilePath.LastIndexOf("/")); + profilePath = $"{Core.ProfilesPath}/{profile.Name}"; // Rename all songs to lowercase foreach (FileInfo file in new DirectoryInfo(assetsPath).GetFiles()) @@ -571,7 +571,7 @@ public static class Profile /// to be compiled into an APK. /// Whether to create the APK with high quality music or not. /// Provides the current progress of this method. - public static void CreateAPK(ProfileXML profile, bool useHqMusic, IProgress progress) + public static void CreateApk(ProfileXML profile, bool useHqMusic, IProgress progress) { // Overall safety check just in case of bad situations if (!profile.SupportsAndroid) @@ -695,7 +695,7 @@ public static class Profile // Write log header to file StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append($"AM2RLauncher {Core.Version} log generated at {date}"); - if (OS.IsThisRunningFromWine) + if (OS.IsThisRunningFromWINE) stringBuilder.Append("Using WINE!"); File.WriteAllText(logFile, stringBuilder.ToString()); @@ -725,15 +725,16 @@ public static class Profile if (!File.Exists(am2rConfigPath)) File.WriteAllText(am2rConfigPath, "[Screen]\nFullscreen=\"0\"\nScale=\"3\""); - ProcessStartInfo startInfo = new ProcessStartInfo(); - - startInfo.UseShellExecute = false; - startInfo.WorkingDirectory = gameDirectory; - #if NOAPPIMAGE - startInfo.FileName = $"{gameDirectory}/runner"; - #else - startInfo.FileName = $"{gameDirectory}/AM2R.AppImage"; - #endif + ProcessStartInfo startInfo = new ProcessStartInfo + { + UseShellExecute = false, + WorkingDirectory = gameDirectory, + #if NOAPPIMAGE + FileName = $"{gameDirectory}/runner" + #else + FileName = $"{gameDirectory}/AM2R.AppImage" + #endif + }; log.Info($"CWD of Profile is {startInfo.WorkingDirectory}");