ExeSessionProcess.GetExecutablePath() doesn't search in 'Program Files (x86)' directory

Advertisement

tattdogg
Joined:
Posts:
19
Location:
Minsk, Belarus

ExeSessionProcess.GetExecutablePath() doesn't search in 'Program Files (x86)' directory

Hi

ExeSessionProcess.GetExecutablePath() doesn't search in 'Program Files (x86)' directory

Possible fix: https://github.com/mirror/winscp/pull/1/commits/0996f04cda7ca0d90febce16e0f3da986709d820

Also you can add search in %PATH% variable:
Environment.GetEnvironmentVariable("PATH")?.Split(';').SingleOrDefault(x => x.EndsWith("\\WinSCP\\"));

Thanks,
tattdogg

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,478
Location:
Prague, Czechia

Re: ExeSessionProcess.GetExecutablePath() doesn't search in 'Program Files (x86)' directory

Thanks for spotting this.

The ProgramFilesX86 requires .NET 4, so I cannot use it.
Also what primarily needs fixing, is the GetInstallationPath implementation.

Anyway, both are fixed:
https://winscp.net/tracker/1421

Though note that you generally should not rely on WinSCP.exe in "Program Files". You should distribute the executable with your .NET application.
https://winscp.net/eng/docs/library_install

The lookup in "Program Files" is really only the last resort fallback.

Reply with quote

Advertisement

You can post new topics in this forum