Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }