Exemplo n.º 1
0
        private void StartDownload(List <DownloadFileInfo> downloadList)
        {
            DownloadProgress dp = new DownloadProgress(downloadList);

            if (dp.ShowDialog() == DialogResult.OK)
            {
                //更新成功
                config.SaveConfig(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, FILENAME));

                if (bNeedRestart)
                {
                    MessageBox.Show("程序需要重新启动才能应用更新,请点击确定重新启动程序。", "自动更新", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Process.Start(Application.ExecutablePath);
                    Environment.Exit(0);
                }
            }
        }
Exemplo n.º 2
0
        private void StartDownload(List <DownloadFileInfo> downloadList)
        {
            DownloadProgress dp = new DownloadProgress(downloadList, config.AppName);

            if (dp.ShowDialog() == DialogResult.OK)
            {
                //
                if (DialogResult.Cancel == dp.ShowDialog())
                {
                    return;
                }
                //更新成功
                config.SaveConfig(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConstFile.FILENAME));

                if (bNeedRestart)
                {
                    //删除临时文件(下载)文件夹
                    //Directory.Delete(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConstFile.TEMPFOLDERNAME), true);

                    MessageBox.Show(ConstFile.APPLYTHEUPDATE, ConstFile.MESSAGETITLE, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    CommonUnitity.StartMainApplication(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, config.AppName));
                }
            }
        }
Exemplo n.º 3
0
        private void StartDownload(List<DownloadFileInfo> downloadList) {
            DownloadProgress dp = new DownloadProgress(downloadList,config.AppName);
            if (dp.ShowDialog() == DialogResult.OK) {
                //
                if (DialogResult.Cancel == dp.ShowDialog()) {
                    return;
                }
                //更新成功
                config.SaveConfig(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConstFile.FILENAME));

                if (bNeedRestart) {
                    //删除临时文件(下载)文件夹
                    //Directory.Delete(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConstFile.TEMPFOLDERNAME), true);

                    MessageBox.Show(ConstFile.APPLYTHEUPDATE, ConstFile.MESSAGETITLE, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    CommonUnitity.StartMainApplication(Path.Combine(AppDomain.CurrentDomain.BaseDirectory,config.AppName));
                }
            }
        }