public static string GetProSuiteExecutablePath(string exeName) { string extension = Path.GetExtension(exeName); if (string.IsNullOrEmpty(extension) || !extension.EndsWith("exe", StringComparison.InvariantCultureIgnoreCase)) { exeName = $"{exeName}.exe"; } string fullPath; if (TryGetExecutablePathFromEnvVar(exeName, out fullPath)) { return(fullPath); } if (TryGetExecutablePathFromRegisteredInstallDir(exeName, out fullPath)) { return(fullPath); } // TODO: Probably a different directory searcher implementation should be used (skip AppData) var searcher = new AppDirectorySearcher( CompanyName, ProductName, GetInstallDirectory().FullName, "bin"); return(searcher.GetConfigFilePath(exeName, false)); }
public static string GetConfigFilePath([NotNull] string configFileName, bool required = true) { Assert.ArgumentNotNullOrEmpty(configFileName, nameof(configFileName)); var searcher = new AppDirectorySearcher( CompanyName, ProductName, GetInstallDirectory().FullName); return(searcher.GetConfigFilePath(configFileName, required)); }