recommended: System.Environment.ProcessPath

This commit is contained in:
Robert McRackan 2022-08-02 07:58:42 -04:00
parent fc25e73b1a
commit fe2de6ecf7
2 changed files with 2 additions and 3 deletions

View File

@ -25,7 +25,7 @@ namespace AppScaffolding
: value; : value;
#region appsettings.json #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); public static bool APPSETTINGS_Json_Exists => File.Exists(APPSETTINGS_JSON);

View File

@ -149,8 +149,7 @@ namespace LibationAvalonia.Views
private void runWindowsUpgrader(string zipFile) private void runWindowsUpgrader(string zipFile)
{ {
var thisExe = Environment.ProcessPath;
var thisExe = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
var thisDir = System.IO.Path.GetDirectoryName(thisExe); var thisDir = System.IO.Path.GetDirectoryName(thisExe);
var args = $"--input {zipFile} --output {thisDir} --executable {thisExe}"; var args = $"--input {zipFile} --output {thisDir} --executable {thisExe}";