浏览代码

Bug 1741: Failure in .NET assembly when ProgramFiles(x86) environment variable is not set and WinSCP executable cannot be found anywhere

https://winscp.net/tracker/1741
(cherry picked from commit 8e45684db4609b1ab9982b0fab16fcdc0866af97)

Source commit: 177a79c9c6bd33d63e550ae4c05c71cebf38076d
Martin Prikryl 6 年之前
父节点
当前提交
97fedbbddf
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      dotnet/internal/ExeSessionProcess.cs

+ 1 - 2
dotnet/internal/ExeSessionProcess.cs

@@ -864,8 +864,7 @@ namespace WinSCP
             string programFiles;
             if (IntPtr.Size == 8)
             {
-                // In .NET 4 we can use Environment.SpecialFolder.ProgramFilesX86
-                programFiles = Environment.GetEnvironmentVariable("ProgramFiles(x86)");
+                programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
             }
             else
             {