华恒Mes鼎捷代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.8 KiB

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;
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[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);
}
}
}
}