Beispiel #1
0
        public static void RunPathIntegration(string option)
        {
            switch (option)
            {
            case OPT_ADD:
            {
                string oldValue = ExplorerSystem.EnvironmentPath;

                string appFolder = RuntimeInfo.AppFolder;

                if (RuntimeInfo.IsAppFolderInPath)
                {
                    return;
                }


                bool appFolderInPath = oldValue.Split(ExplorerSystem.PATH_DELIM).Any(p => p == appFolder);

                string cd  = Environment.CurrentDirectory;
                string exe = Path.Combine(cd, RuntimeInfo.NAME_EXE);

                if (!appFolderInPath)
                {
                    string newValue = oldValue + ExplorerSystem.PATH_DELIM + cd;
                    ExplorerSystem.EnvironmentPath = newValue;
                }

                break;
            }

            case OPT_REM:
                ExplorerSystem.RemoveFromPath(RuntimeInfo.AppFolder);
                break;
            }
        }
Beispiel #2
0
 public static void Remove() => ExplorerSystem.RemoveFromPath(RuntimeInfo.AppFolder);