Ejemplo n.º 1
0
        public void start(string startupPath, string args = "", SynapseModuleMode Mode = SynapseModuleMode.Production)
        {
            string targetDir = Mode == SynapseModuleMode.Production ? startupPath + "\\Prod\\" + TECHNICALNAME : startupPath + "\\Dev\\" + TECHNICALNAME;

            //to be removed when DB is updated
            PATH = PATH.Substring(PATH.LastIndexOf("\\"));
            string file = null;

            if (File.Exists(PATH))
            {
                file = PATH;
            }
            if (File.Exists(targetDir + "\\" + PATH))
            {
                file = targetDir + "\\" + PATH;
            }
            else
            {
                SynapseCore.Controls.SynapseForm.SynapseLogger.Debug("Not exist " + startupPath + "\\" + PATH);
            }
            if (file != null)
            {
                SynapseCore.Controls.SynapseForm.SynapseLogger.Debug("starting " + file);
                System.Diagnostics.Process proc = new System.Diagnostics.Process();
                proc.EnableRaisingEvents        = false;
                proc.StartInfo.WindowStyle      = System.Diagnostics.ProcessWindowStyle.Normal;
                proc.StartInfo.FileName         = file;
                proc.StartInfo.WorkingDirectory = Path.GetFullPath(file);
                //proc.StartInfo.Arguments = filename;
                proc.StartInfo.Arguments = args;
                proc.Start();
                //proc.WaitForExit();
            }
        }
Ejemplo n.º 2
0
        public string getModuleExecutablePath(string startupPath, SynapseModuleMode Mode = SynapseModuleMode.Production)
        {
            string targetDir = Mode == SynapseModuleMode.Production ? startupPath + "\\Prod\\" + TECHNICALNAME : startupPath + "\\Dev\\" + TECHNICALNAME;

            //to be removed when DB is updated
            PATH = PATH.Substring(PATH.LastIndexOf("\\"));
            string file = null;

            if (File.Exists(PATH))
            {
                file = PATH;
            }
            if (File.Exists(targetDir + "\\" + PATH))
            {
                file = targetDir + "\\" + PATH;
            }
            else
            {
                SynapseCore.Controls.SynapseForm.SynapseLogger.Debug("Not exist " + targetDir + "\\" + PATH);
            }

            return(file);
        }