Release a AutoUpdater tool

简介:

Description

Fixing bugs and adding new features is a part of developing software applications. From my experience, sending application updates to users is also a critical part of developing applications, especially when the user has no advanced knowledge of computers. In the Internet era today, the software developer must make application deployment and updating easier and often makes automatic application updates to do this.I already searched through the internet on this topic, but not much seems suited to my needs. So, I tried to create one myself. This sample application is developed in C# as a library with the project name “AutoUpdater”. The DLL “AutoUpdater” can be used in a C# Windows application(WinForm and WPF).

About the features

There are certain features about the AutoUpdater:

1,Easy to implement and use. 
2,Application automatic re-run after checking update. 
3,Update process transparent to the user . 
4,To avoid blocking the main thread using multi-threaded download. 
5,Ability to upgrade the system and also the auto update program. 
6,A code that doesn't need change when used by different systems and could be compiled in a library. 
7,Easy for user to download the update files.

The following UI

There are two pages and very pretty simple,just as follows:
2010-10-13
Figure 1
2010-10-13
Figure 2

How to use?

In the program that you want to be auto updateable, you just need to call the AutoUpdate function in the Main procedure. The AutoUpdate  function will check the version with the one read from a file located in a Web Site/FTP. If the program version is lower than the one read the program downloads the auto update program and launches it and the function returns True, which means that an auto update will run and the current program should be closed. The auto update program receives several parameters from the program to be updated and performs the auto update necessary and after that launches the updated system.
      #region check and download new version program
      bool bHasError = false;
      IAutoUpdater autoUpdater = new AutoUpdater();
      try
      {
          autoUpdater.Update();
      }
      catch (WebException exp)
      {
          MessageBox.Show("Can not find the specified resource");
          bHasError = true;
      }
      catch (XmlException exp)
      {
          bHasError = true;
          MessageBox.Show("Download the upgrade file error");
      }
      catch (NotSupportedException exp)
      {
          bHasError = true;
          MessageBox.Show("Upgrade address configuration error");
      }
      catch (ArgumentException exp)
      {
          bHasError = true;
          MessageBox.Show("Download the upgrade file error");
      }
      catch (Exception exp)
      {
          bHasError = true;
          MessageBox.Show("An error occurred during the upgrade process");
      }
      finally
      {
          if (bHasError == true)
          {
              try
              {
                  autoUpdater.RollBack();
              }
              catch (Exception)
              {
                 //Log the message to your file or database
              }
          }
      }
      #endregion
That’s all and just enjoy it!

About the solutions

The application is pretty simple,just contains two pages and some helper classes.
autoupdatersolution
Figure 3

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

About the Author

you can download the tool via  http://autoupdater.codeplex.com/,If in doubt please contact me,Thanks!





















本文转自KnightsWarrior51CTO博客,原文链接:http://blog.51cto.com/knightswarrior/407531  ,如需转载请自行联系原作者

相关文章
|
设计模式 Java 关系型数据库
面试官:说说你的项目亮点?
面试官:说说你的项目亮点?
389 0
面试官:说说你的项目亮点?
|
JavaScript 前端开发 开发者
事件处理:深入理解Vue的事件机制
【4月更文挑战第23天】Vue.js的事件处理机制是其核心特性之一,允许开发者响应用户操作。通过`v-on`(或简写`@`)指令绑定DOM事件到方法,当事件触发时执行相应代码。事件修饰符如`.stop`、`.prevent`等简化了常见逻辑。此外,Vue支持自定义事件,便于组件间通信,如子组件通过`$emit`触发事件,父组件使用`v-on`监听并处理。理解这些概念能帮助开发者更有效地控制Vue应用的事件流程。
348 0
|
存储 人工智能 弹性计算
函数计算部署 AI 大模型解决方案测评
函数计算部署 AI 大模型解决方案测评
解决vue2升级vue3后,输入框无法输入的问题
解决vue2升级vue3后,输入框无法输入的问题
764 0
|
SQL 数据采集 DataWorks
DataWorks产品使用合集之如何判断自己需要多大的独享资源组
DataWorks作为一站式的数据开发与治理平台,提供了从数据采集、清洗、开发、调度、服务化、质量监控到安全管理的全套解决方案,帮助企业构建高效、规范、安全的大数据处理体系。以下是对DataWorks产品使用合集的概述,涵盖数据处理的各个环节。
96 1
|
Kubernetes Java Docker
K8s 中 Pod OOMKilled 原因
K8s 中 Pod OOMKilled 原因
983 0
|
JavaScript 前端开发
CodeMirror实现代码对比功能
CodeMirror实现代码对比功能
CodeMirror实现代码对比功能
|
存储 云安全 运维
如何安全存放数据到对象存储 OSS 及数据湖的13问
数据作为企业的血液和命脉,需要妥善的保存。对象存储作为云计算的数据存储底座,并且还在支持数据湖存储能力,它是企业存储数据的理想之地。但是如何安全的存放数据到存储,特别是公共云对象存储,相信不少的的数据负责人都会有很多疑问,本文从账户认证能力、网络安全配置、访问授权方法、数据加密功能、访问日志审计、数据安全机制等纬度总结了13个安全问题,帮助回答企业上云存放数据的安全顾虑。一、企业上云存放数据的安全
1141 1
如何安全存放数据到对象存储 OSS 及数据湖的13问