1 Star 1 Fork 0

中联软件 / AppAutoUpdater

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

AutoUpdater

AutoUpdater

AutoUpdater is a library which allows developers to easily add auto update feature to their desktop (Windows, macOS and Linux) application.

This project has been migrated from CodePlex and isn't actively maintained. It's provided for archival purposes only. You can find the original page https://archive.codeplex.com/?p=autoupdater

I'm currently working on a cross-platform project which will support Platforms Android, iOS, Windows, MacOs. Linux, for Android and iOS, there have built-in auto update feature to use, but for Windows, MacOs, Linux, I found my previous open source project which I built in 10 years ago and got around 1 million downloads in Codeplex for last ten years still works, as Codeplex has been stopped, I migrate it from Codeplex to Github and will continue to maintain this repository, issues here.

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, WPF, UWP and Xamarin).

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:

autoupdatersolution_4

Figure 1

autoupdatersolution_5

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_1

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 https://github.com/knightswarrior/AppAutoUpdater/,If in doubt please contact me,Thanks!

MIT License Copyright (c) 2020 Knights Warrior Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
C# 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C#
1
https://gitee.com/sytsoft_163/AppAutoUpdater.git
git@gitee.com:sytsoft_163/AppAutoUpdater.git
sytsoft_163
AppAutoUpdater
AppAutoUpdater
master

搜索帮助