Fix issues when home directory does not exist.

pull/52/head
Miepee 4 years ago
parent c5b011627b
commit 3583ef65c8

@ -144,9 +144,7 @@ public partial class MainForm : Form
log.Info("Checking whether to transfer Flatpak saves...");
string oldHomePath = CrossPlatformOperations.Home;
log.Info("Old home path is " + oldHomePath);
var option = Environment.SpecialFolderOption.DoNotVerify;
log.Info("option is " + option);
Environment.SetEnvironmentVariable("HOME", $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData, option)}/AM2RProfileSaves");
Environment.SetEnvironmentVariable("HOME", $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData, Environment.SpecialFolderOption.DoNotVerify)}/AM2RProfileSaves");
string newHomePath = CrossPlatformOperations.Home;
log.Info("New home path is " + newHomePath);

@ -25,7 +25,7 @@ public static class CrossPlatformOperations
/// <summary>
/// Path to the Home Folder.
/// </summary>
public static string Home => Environment.GetFolderPath(Environment.SpecialFolder.UserProfile, Environment.SpecialFolderOption.Create);
public static string Home => Environment.GetFolderPath(Environment.SpecialFolder.UserProfile, Environment.SpecialFolderOption.DoNotVerify);
/// <summary>
/// Config file path for *nix based systems. <br/>

Loading…
Cancel
Save