diff --git a/Duplicati/Library/Utility/Utility.cs b/Duplicati/Library/Utility/Utility.cs index 75fc1f0e1..78558e93b 100644 --- a/Duplicati/Library/Utility/Utility.cs +++ b/Duplicati/Library/Utility/Utility.cs @@ -1077,50 +1077,6 @@ namespace Duplicati.Library.Utility /// public static StringComparison ClientFilenameStringComparison => IsFSCaseSensitive ? StringComparison.CurrentCulture : StringComparison.CurrentCultureIgnoreCase; - /// - /// Searches the system paths for the file specified - /// - /// The file to locate - /// The full path to the file, or null if the file was not found - public static string LocateFileInSystemPath(string filename) - { - try - { - if (Path.IsPathRooted(filename)) - return File.Exists(filename) ? filename : null; - - try - { - filename = Path.GetFileName(filename); - } - catch - { - // ignored - } - - string homedir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + Path.PathSeparator.ToString(); - - //Look in application base folder and all system path folders - foreach (string s in (homedir + Environment.GetEnvironmentVariable("PATH")).Split(Path.PathSeparator)) - if (!string.IsNullOrEmpty(s) && s.Trim().Length > 0) - try - { - foreach (string sx in Directory.GetFiles(ExpandEnvironmentVariables(s), filename)) - return sx; - } - catch - { - // ignored - } - } - catch - { - // ignored - } - - return null; - } - /// /// The path to the users home directory ///