using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace ICSSoft.AutoUpdate.Edition.SetupPatch { static class Program { public static System.Threading.Mutex Run; /// /// 应用程序的主入口点。 /// [STAThread] static void Main(string[] arg) { string EditionCode = ""; string pathFolderName = ""; string MainProgramName = ""; if (arg.Count() == 3) { EditionCode = arg[0]; pathFolderName = arg[1]; MainProgramName = arg[2]; } bool noRun = false; Run = new System.Threading.Mutex(true, Application.ProductName, out noRun); if (!noRun) { MessageBox.Show("本程序已经启动,无法再次启动"); Application.Exit(); return; } Run.ReleaseMutex(); Run = new System.Threading.Mutex(true, MainProgramName, out noRun); if (!noRun) { MessageBox.Show("主程序已经启动,无法启动补丁安装工具"); Application.Exit(); return; } Run.ReleaseMutex(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { patchSetUp Client = new patchSetUp(EditionCode, pathFolderName, MainProgramName); Client.Do(); } catch (Exception ex) { MessageBox.Show("补丁安装失败!"+ex.Message); } } } }