Beispiel #1
0
        private void OnClickSync(ClickContext context)
        {
            if (string.IsNullOrWhiteSpace(Click))
            {
                return;
            }


            if (!Click.StartsWith("launch "))
            {
                return;
            }

            var launchString = Click.Substring(7).Trim();

            if (string.IsNullOrWhiteSpace(launchString))
            {
                //TODO:Log.Warn
                return;
            }

            (var path, var args) = ParseLaunchString(launchString);

            path = Environment.ExpandEnvironmentVariables(path);

            if (!System.IO.Path.IsPathRooted(path))
            {
                var root = Path.GetDirectoryName(Menu.Package.Record.Path);

                path = System.IO.Path.Combine(root, path);
            }

            RunProcess(path, args);
        }