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:
Figure 1
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.
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!
分享到:
相关推荐
AutoUpdater.NET是一款强大的.NET框架下的自动更新库,它允许开发者轻松地集成到自己的应用程序中,实现客户端程序的自动更新功能。这个1.4.4版本是System9op针对其项目进行定制或优化的一个版本,旨在提供更加稳定...
**WPF自动更新软件AutoUpdater详解** 在软件开发领域,保持应用程序的最新状态至关重要,以确保用户能够获得最新的功能和安全修复。WPF(Windows Presentation Foundation)是.NET框架的一部分,用于构建美观、交互...
if ((p.ProcessName == "AutoUpdater.exe" || p.ProcessName == "AutoUpdater") && p.StartInfo.Arguments.Contains(APP.MachineID)) p.Kill(); } } } ////设置自动更新 public static void MakeUpdate()...
<AutoUpdater> <UpdateInfo> </UpdateInfo> <UpdateFile FileName = "VB40.rar"/> <UpdateFile FileName = "VB4-1.CAB"/> </UpdateFileList> <RestartApp> </RestartApp> </AutoUpdater>
AutoUpdater是一款用于应用程序自动升级的组件,其新版v2.0提供了更为完善的更新机制和用户体验。这个组件的主要功能是帮助开发者轻松实现应用的后台自动检查更新、下载新版本并完成安装,无需用户手动操作,极大地...
4. **安装更新**:验证无误后,AutoUpdater会安排一个合适的时机(如下次重启或用户确认后)来安装更新,通常通过替换旧文件来实现。 5. **启动新版本**:更新安装完成后,AutoUpdater会引导用户启动新版本的程序,...
**AutoUpdater.NET** 是一个基于 .NET 框架的开源工具,用于为Windows桌面应用程序添加自动更新功能。开发者可以轻松地集成此库到他们的应用中,以便在有新版本可用时通知用户并引导他们进行更新。这个工具支持多种...
AutoUpdater自动升级工具是一款基于C#开发的简易应用程序,它为开发者提供了方便的方式来集成到自己的项目中,实现软件的自动更新功能。这个工具的核心在于它能够检查服务器上是否存在新版本的软件,并在检测到更新...
AutoUpdater.Lib.UpdateInfo new_client = new AutoUpdater.Lib.UpdateInfo(); new_client.AppName = clientApp.Name; new_client.AppVersion = new Version("1.0.0.6"); new_client.Desc = "修改已知BUG;提升...
《C#实现自动更新程序详解——以AutoUpdater-master为例》 在软件开发中,保持应用程序的更新对于修复错误、添加新功能以及提升用户体验至关重要。C#作为一种强大的编程语言,提供了丰富的库和工具来帮助开发者实现...
本文将深入探讨一个基于C#实现的WinForm自动更新机制,标题为“AutoUpdater(C#)”的项目。我们将讨论其工作原理、主要组件以及如何实现更新流程。 首先,这个自动更新系统的核心在于比较服务端与客户端的版本信息。...
本项目"conan5566linyiling-AutoUpdater-master"是一个C#语言编写的客户端程序自动更新的示例,专为C#开发者提供了一种实现自动更新功能的方法。 在C#编程中,实现自动更新通常涉及到以下几个核心知识点: 1. **...
3、把程序清单“UpdaterFileList.xml”文件拷贝一份至“AutoUpdater.exe”文件中,如果需要更新所有文件,则删除“UpdaterFileList.xml”中“Files”节点下的所有“File”节点。 4、运行“AutoUpdater.exe”程序; ...
用以自动更新.NET程序的开发库,该库使用简单。可以使用FTP服务器或者WEB服务器作为更新媒介。教程详见https://blog.csdn.net/zhy29563/article/details/106153726
《Sharp AutoUpdater:开源.NET应用程序自动更新解决方案》 在当今快速迭代的软件开发环境中,保持应用程序的最新状态至关重要。为了简化这一过程,开发者们引入了各种自动更新工具,其中之一便是Sharp AutoUpdater...
AutoUpdater.NET是一个类库,允许.NET开发人员轻松地将自动更新功能添加到其经典的桌面应用程序项目中。 NuGet软件包 PM > Install-Package Autoupdater.NET.Official 这个怎么运作 AutoUpdater.NET从您的服务器...
An Autoupdater program for POS Application.
标题 "autoupdater C#" 涉及到的是在C#编程环境中开发自动更新程序的实践。自动更新程序是软件应用程序的重要组成部分,它允许软件在后台检查并安装新版本,确保用户始终运行的是最新、最安全的软件版本。在C#中实现...
更新软件包文件MD5代码(2b406701f8ad92922feb537fc789561a) 对于调试等参数,可以将参数设置为: 0.9.0.0 1.0.0.0 ...