Fix application path detection

Launching from args sets the Environment.CurrentDirectory to that of the
files that launched the program; instead we want the
Application.StartupPath (where the exe is, which is where our backup
files are).

Closes #948
This commit is contained in:
Kurt 2017-03-19 10:42:48 -07:00
parent 07b4db8bbe
commit ab88f5b4e2

View file

@ -268,7 +268,7 @@ namespace PKHeX.WinForms
#region Path Variables #region Path Variables
public static string WorkingDirectory => WinFormsUtil.IsClickonceDeployed ? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "PKHeX") : Environment.CurrentDirectory; public static string WorkingDirectory => WinFormsUtil.IsClickonceDeployed ? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "PKHeX") : Application.StartupPath;
public static string DatabasePath => Path.Combine(WorkingDirectory, "pkmdb"); public static string DatabasePath => Path.Combine(WorkingDirectory, "pkmdb");
public static string MGDatabasePath => Path.Combine(WorkingDirectory, "mgdb"); public static string MGDatabasePath => Path.Combine(WorkingDirectory, "mgdb");
private static string BackupPath => Path.Combine(WorkingDirectory, "bak"); private static string BackupPath => Path.Combine(WorkingDirectory, "bak");