Beispiel #1
0
        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());
        }
Beispiel #2
0
        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());
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 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);
 }
Beispiel #5
0
        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("当前已经是最新版本", "提示");
            }
        }
Beispiel #6
0
        private void frmAutoUpdate_Load(object sender, EventArgs e)
        {
            mConfig = new clsConfig();
            InitLog();
            ftpConfig();

            UpdateInfo info = new UpdateInfo();
            FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(info.ExecuteFile);
            string currVesion = myFileVersionInfo.FileVersion;

            if (currVesion == info.Version)
            {
                MessageBox.Show("当前已经是最新版本");
            }
            else
            {
                this.lblVersionInfo.Text = "从版本" + currVesion + "更新至版本" + info.Version;
                KillProcess();
                if (!Directory.Exists(updateFolder))
                {
                    Directory.CreateDirectory(updateFolder);
                }
                //if (updateInfo.UpdateFileList.Count > 0)
                //{
                //    DownloadFiles(updateInfo.URLAddress, updateInfo.UpdateFileList[0]);
                //    fileCount++;
                //}
                /////////////////////download dir from FTP
               // DownloadDir();
            }
        }