Skip to content

Commit

Permalink
recommended: System.Environment.ProcessPath
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcrackan committed Aug 2, 2022
1 parent fc25e73 commit fe2de6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/AppScaffolding/UNSAFE_MigrationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static string SettingsDirectory
: value;

#region appsettings.json
private static string APPSETTINGS_JSON { get; } = Path.Combine(Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName), "appsettings.json");
private static string APPSETTINGS_JSON { get; } = Path.Combine(Path.GetDirectoryName(Environment.ProcessPath), "appsettings.json");

public static bool APPSETTINGS_Json_Exists => File.Exists(APPSETTINGS_JSON);

Expand Down
3 changes: 1 addition & 2 deletions Source/LibationAvalonia/Views/MainWindow/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ private async void MainWindow_Opened(object sender, EventArgs e)

private void runWindowsUpgrader(string zipFile)
{

var thisExe = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
var thisExe = Environment.ProcessPath;
var thisDir = System.IO.Path.GetDirectoryName(thisExe);

var args = $"--input {zipFile} --output {thisDir} --executable {thisExe}";
Expand Down

0 comments on commit fe2de6e

Please sign in to comment.