static void Main(string[] args) { //打开软件更新的互斥体 bool createdNew; Mutex mutex = new Mutex(true, "SimplusD_Update", out createdNew); if (!createdNew) { MessageBox.Show("已经有更新程序在运行!", MainSoftwareName, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } try { LogService.Initialize(); UpdateClass update = new UpdateClass(); update.Run(args); } finally { LogService.Close(); mutex.ReleaseMutex(); mutex.Close(); } }
private void SetupFinish_FormClosed(object sender, FormClosedEventArgs e) { if (chkRunSimplusD.Checked) { string simplusdFile = Path.Combine(Application.StartupPath, MainClass.SimplusDExe); UpdateClass.End(true); } }
public SetupFinish(UpdateClass update) { InitializeComponent(); }