static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); /// #if DEBUG #else GENLSYS.MES.AutoUpdate.UpdateInfo info = new UpdateInfo(); FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(info.ExecuteFile); string currVesion = myFileVersionInfo.FileVersion; if (info.checkUpdate(currVesion)) { if (MessageBox.Show("当前版本是" + currVesion + ",最新版本为" + info.Version + ",是否更新?", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) == DialogResult.OK) { Process.Start(Application.StartupPath + @"\GENLSYS.MES.AutoUpdate.exe"); Application.Exit(); return; } } #endif PrepareBeforeRun(); //201307 George --Begin AppBarAutoDisplay.SetAppBarAutoDisplay(true); //201307 George --end Application.Run(new frmLogon()); }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //if (!CheckSmartClient(args)) return; //auto update #if DEBUG //RSALicense rsaLicense = new RSALicense(); //rsaLicense.privateKeyPath = Application.StartupPath + @"\privateKey.xml"; //rsaLicense.publicKeyPath = Application.StartupPath + @"\publicKey.xml"; //rsaLicense.licensePath = Application.StartupPath + @"\License.lic"; //rsaLicense.GenerateRSAKey(); //rsaLicense.GenerateLicense(90); RSALicense.LICENSEN_INFO = new LicenseInfo(); #else GENLSYS.MES.AutoUpdate.UpdateInfo info = new UpdateInfo(); FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(info.ExecuteFile); string currVesion = myFileVersionInfo.FileVersion; if (info.checkUpdate(currVesion)) { if (MessageBox.Show("当前版本是" + currVesion + ",最新版本为" + info.Version + ",是否更新?", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) == DialogResult.OK) { Process.Start(Application.StartupPath + @"\GENLSYS.MES.AutoUpdate.exe"); Application.Exit(); return; } } try { RSALicense rsaLicense = new RSALicense(); rsaLicense.privateKeyPath = Application.StartupPath + @"\privateKey.xml"; rsaLicense.licensePath = Application.StartupPath + @"\License.lic"; RSALicense.LICENSEN_INFO = rsaLicense.GetLicense(); } catch { RSALicense.LICENSEN_INFO.SetNoLicenseInfo(); } #endif //auto update PrepareBeforeRun(); if (!CheckInstance()) return; Application.Run(new frmLogon()); }
private void butUpdate_Click(object sender, EventArgs e) { UpdateInfo info = new UpdateInfo(); FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(info.ExecuteFile); string currVesion = myFileVersionInfo.FileVersion; if (info.checkUpdate(currVesion)) { if (MessageBox.Show("当前版本是" + currVesion + ",最新版本为" + info.Version + ",是否更新?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { Process.Start(Application.StartupPath + @"\GENLSYS.MES.AutoUpdate.exe"); Application.Exit(); } } else { MessageBox.Show("当前已经是最新版本", "提示"); } // frmUpgradeAssistant f = new frmUpgradeAssistant(); //f.ShowDialog(this); }
private void upgradeToolStripMenuItem_Click(object sender, EventArgs e) { UpdateInfo info = new UpdateInfo(); if (info.checkUpdate()) { if (MessageBox.Show("最新版本为" + info.Version + ",是否确认更新?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { Process.Start(Application.StartupPath + @"\GENLSYS.MES.AutoUpdate.exe"); } } else { MessageBox.Show("当前已经是最新版本", "提示"); } //frmUpgradeAssistant f = new frmUpgradeAssistant(); //f.ShowDialog(this); }
private void upgradeToolStripMenuItem_Click(object sender, EventArgs e) { //UpdateInfo info = new UpdateInfo(); //info.ClientVersion = ConfigReader.getCurrentRevision(); //if (info.checkUpdate(info.ClientVersion)) //{ // if (MessageBox.Show("最新版本为" + info.Version + ",是否确认更新?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) // { // Process.Start(Application.StartupPath + @"\GENLSYS.MES.AutoUpdate.exe"); // Application.Exit(); // } //} //else //{ // MessageBox.Show("当前已经是最新版本", "提示"); //} //frmUpgradeAssistant f = new frmUpgradeAssistant(); //f.ShowDialog(this); UpdateInfo info = new UpdateInfo(); FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(info.ExecuteFile); string currVesion = myFileVersionInfo.FileVersion; if (info.checkUpdate(currVesion)) { if (MessageBox.Show("当前版本是" + currVesion + ",最新版本为" + info.Version + ",是否更新?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { Process.Start(Application.StartupPath + @"\GENLSYS.MES.AutoUpdate.exe"); Application.Exit(); } } else { MessageBox.Show("当前已经是最新版本", "提示"); } }