Miepee 5 years ago
commit 3252d23ed5

3
.gitignore vendored

@ -349,3 +349,6 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Visual Studio Code folder
.vscode/

@ -46,6 +46,7 @@ namespace AM2RLauncher.Gtk
{
log.Error("An unhandled exception has occurred: \n*****Stack Trace*****\n\n" + e.StackTrace.ToString());
Console.WriteLine(Language.Text.UnhandledException + "\n" + e.Message + "\n*****Stack Trace*****\n\n" + e.StackTrace.ToString());
Console.WriteLine("Check the logs at " + launcherDataPath + " for more info!");
}
}
@ -95,7 +96,7 @@ namespace AM2RLauncher.Gtk
}
catch { }
return Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
return Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
}
}
}

@ -25,11 +25,6 @@ namespace AM2RLauncher
/// </summary>
private static readonly Platform currentPlatform = Platform.Instance;
/// <summary>
/// Current Path where the Launcher is located. For more info, check <see cref="GenerateCurrentPath"/>.
/// </summary>
public static readonly string CURRENTPATH = GenerateCurrentPath();
/// <summary>
/// Name of the Launcher executable.
/// </summary>
@ -45,6 +40,11 @@ namespace AM2RLauncher
/// </summary>
public static readonly string NIXXDGCONFIG = Environment.GetEnvironmentVariable("XDG_CONFIG_HOME");
/// <summary>
/// Current Path where the Launcher is located. For more info, check <see cref="GenerateCurrentPath"/>.
/// </summary>
public static readonly string CURRENTPATH = GenerateCurrentPath();
/// <summary>
/// Generates the mirror list, depending on the current Platform.
/// </summary>
@ -499,7 +499,7 @@ namespace AM2RLauncher
}
log.Info("Something went wrong, falling back to the default CurrentPath.");
return Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
return Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
}
}
}

@ -746,7 +746,7 @@ namespace AM2RLauncher
profileAuthorLabel.Text = Language.Text.Author + " " + profileList[profileDropDown.SelectedIndex].Author;
profileVersionLabel.Text = Language.Text.VersionLabel + " " + profileList[profileDropDown.SelectedIndex].Version;
CrossPlatformOperations.WriteToConfig("ProfileIndex", profileIndex + ""); // Loj, tell me a better way to do this
CrossPlatformOperations.WriteToConfig("ProfileIndex", profileIndex.ToString());
if (profileDropDown.SelectedIndex != 0 && (profileList[profileDropDown.SelectedIndex].SaveLocation == "%localappdata%/AM2R" ||
profileList[profileDropDown.SelectedIndex].SaveLocation == "default"))
@ -754,7 +754,6 @@ namespace AM2RLauncher
else
saveWarningLabel.Visible = false;
UpdateStateMachine();
Console.WriteLine("end profile drop down changed");
}
/// <summary>Gets called when user selects a different item from <see cref="languageDropDown"/> and writes that to the config.</summary>

@ -194,7 +194,6 @@ namespace AM2RLauncher
if (enabled)
{
settingsProfileDropDown.SelectedIndex = profileDropDown.SelectedIndex;
SettingsProfileDropDownSelectedIndexChanged(null, null);
}
}
}

@ -140,7 +140,8 @@ namespace AM2RLauncher
log.Info("Set Launcher CWD to " + Environment.CurrentDirectory);
// But log actual folder location nonetheless
log.Info("Actual Launcher location: " + Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location));
// TODO: test if this logs correctly on windows now
log.Info("Actual Launcher location: " + Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory));
// Set the language to what User wanted or choose local language
string userLanguage = CrossPlatformOperations.ReadFromConfig("Language").ToLower();
@ -211,6 +212,7 @@ namespace AM2RLauncher
Icon = new Icon(1f, am2rIcon);
Title = "AM2RLauncher " + VERSION + ": " + splash;
MinimumSize = new Size(500, 400);
// TODO: for some reason, this sometimes doesn't work on Linux. Eto bug maybe?
ClientSize = new Size(int.Parse(CrossPlatformOperations.ReadFromConfig("Width")), int.Parse(CrossPlatformOperations.ReadFromConfig("Height")));
if (ClientSize.Width < 500)
ClientSize = new Size(500, ClientSize.Height);

@ -38,6 +38,7 @@ Alternatively, for Arch Linux users an [AUR Package](https://aur.archlinux.org/p
The AM2RLauncher stores its files in the following places:
- On Windows, it stores the config file to the `AM2RLauncher.exe.config` next to the binary, and its data files in the same folder as the binary.
- On Linux, it stores the config file to `$XDG_CONFIG_HOME/AM2RLauncher` and its data files to `$XDG_DATA_HOME/AM2RLauncher` (which are defaulting back to `~/.config` and `~/.local/share` respectively).
The AM2RLauncher data can get quite big, so if you wish to change where it stores it, you can do so with the `AM2RLAUNCHERDATA` environment variable (i.e `AM2RLAUNCHERDATA="D:\MyLauncherData"` or `AM2RLAUNCHERDATA="/mnt/bigDrive/launcherData"`).
# Compiling Instructions:
@ -49,5 +50,5 @@ Open the solution with Visual Studio 2019.
Alternatively, build via `dotnet build` / the `buildAll` batch file.
## Linux Instructions
In order to build for linux, use `dotnet publish AM2RLauncher.Gtk -p:PublishSingleFile=true -c release -r ubuntu.18.04-x64`, MonoDevelop sadly doesn't work.
In order to build for linux, use `dotnet publish AM2RLauncher.Gtk -p:PublishSingleFile=true -p:DebugType=embedded -c release -r ubuntu.18.04-x64 --no-self-contained`, MonoDevelop sadly doesn't work.
You *have* to specify it to build for Ubuntu, even on non-Ubuntu distros, because one of our Dependencies, libgit2sharp fails on the `linux-x64` RID.

Loading…
Cancel
Save