kandi background
Explore Kits

AutoUpdater.NET | class library that allows .NET developers | Form library

 by   ravibpatel C# Version: v1.6.4 License: MIT

 by   ravibpatel C# Version: v1.6.4 License: MIT

Download this library from

kandi X-RAY | AutoUpdater.NET Summary

AutoUpdater.NET is a C# library typically used in User Interface, Form, Xamarin applications. AutoUpdater.NET has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.
AutoUpdater.NET is a class library that allows .NET developers to easily add auto update functionality to their classic desktop application projects.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • AutoUpdater.NET has a medium active ecosystem.
  • It has 1714 star(s) with 498 fork(s). There are 100 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 134 open issues and 249 have been closed. On average issues are closed in 44 days. There are 5 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of AutoUpdater.NET is v1.6.4
AutoUpdater.NET Support
Best in #Form
Average in #Form
AutoUpdater.NET Support
Best in #Form
Average in #Form

quality kandi Quality

  • AutoUpdater.NET has 0 bugs and 0 code smells.
AutoUpdater.NET Quality
Best in #Form
Average in #Form
AutoUpdater.NET Quality
Best in #Form
Average in #Form

securitySecurity

  • AutoUpdater.NET has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • AutoUpdater.NET code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
AutoUpdater.NET Security
Best in #Form
Average in #Form
AutoUpdater.NET Security
Best in #Form
Average in #Form

license License

  • AutoUpdater.NET is licensed under the MIT License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
AutoUpdater.NET License
Best in #Form
Average in #Form
AutoUpdater.NET License
Best in #Form
Average in #Form

buildReuse

  • AutoUpdater.NET releases are available to install and integrate.
  • Installation instructions, examples and code snippets are available.
AutoUpdater.NET Reuse
Best in #Form
Average in #Form
AutoUpdater.NET Reuse
Best in #Form
Average in #Form
Top functions reviewed by kandi - BETA

kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample Here

Get all kandi verified functions for this library.

Get all kandi verified functions for this library.

AutoUpdater.NET Key Features

AutoUpdater.NET uses Assembly version to determine the current version of the application. You can update it by going to Properties of the project as shown in following screenshot. Version specified in XML file should be higher than Assembly version to trigger the update.

AutoUpdater.NET Examples and Code Snippets

See all related Code Snippets

The NuGet Package

copy iconCopydownload iconDownload
PM> Install-Package Autoupdater.NET.Official

XML file

copy iconCopydownload iconDownload
<?xml version="1.0" encoding="UTF-8"?>
<item>
    <version>2.0.0.0</version>
    <url>http://rbsoft.org/downloads/AutoUpdaterTest.zip</url>
    <changelog>https://github.com/ravibpatel/AutoUpdater.NET/releases</changelog>
    <mandatory>false</mandatory>
</item>

Adding one line to make it work

copy iconCopydownload iconDownload
using AutoUpdaterDotNET;

Current version detection

copy iconCopydownload iconDownload
AutoUpdater.Start("http://rbsoft.org/updates/AutoUpdaterTest.xml", myAssembly);

Provide installed version manually

copy iconCopydownload iconDownload
AutoUpdater.InstalledVersion = new Version("1.2");

Download Update file and XML using FTP

copy iconCopydownload iconDownload
AutoUpdater.Start("ftp://rbsoft.org/updates/AutoUpdaterTest.xml", new NetworkCredential("FtpUserName", "FtpPassword"));

Check for updates synchronously

copy iconCopydownload iconDownload
AutoUpdater.Synchronous = true;

Disable Skip Button

copy iconCopydownload iconDownload
AutoUpdater.ShowSkipButton = false;

Disable Remind Later Button

copy iconCopydownload iconDownload
AutoUpdater.ShowRemindLaterButton = false;

Ignore previous Remind Later or Skip settings

copy iconCopydownload iconDownload
AutoUpdater.Mandatory = true;

Forced updates

copy iconCopydownload iconDownload
AutoUpdater.Mandatory = true;
AutoUpdater.UpdateMode = Mode.Forced;

Basic Authentication

copy iconCopydownload iconDownload
BasicAuthentication basicAuthentication = new BasicAuthentication("myUserName", "myPassword");
AutoUpdater.BasicAuthXML = AutoUpdater.BasicAuthDownload = AutoUpdater.BasicAuthChangeLog = basicAuthentication;

Set User-Agent for http web requests

copy iconCopydownload iconDownload
AutoUpdater.HttpUserAgent = "AutoUpdater";

Enable Error Reporting

copy iconCopydownload iconDownload
AutoUpdater.ReportErrors = true;

Run update process without Administrator privileges

copy iconCopydownload iconDownload
AutoUpdater.RunUpdateAsAdmin = false;

Open Download Page

copy iconCopydownload iconDownload
AutoUpdater.OpenDownloadPage = true;

Remind Later

copy iconCopydownload iconDownload
AutoUpdater.LetUserSelectRemindLater = false;
AutoUpdater.RemindLaterTimeSpan = RemindLaterFormat.Days;
AutoUpdater.RemindLaterAt = 2;

Proxy Server

copy iconCopydownload iconDownload
var proxy = new WebProxy("ProxyIP:ProxyPort", true)
{
    Credentials = new NetworkCredential("ProxyUserName", "ProxyPassword")
};
AutoUpdater.Proxy = proxy;

Specify where to download the update file

copy iconCopydownload iconDownload
AutoUpdater.DownloadPath = Environment.CurrentDirectory;

Specify where to extract zip file containing updated files

copy iconCopydownload iconDownload
var currentDirectory = new DirectoryInfo(Environment.CurrentDirectory);
if (currentDirectory.Parent != null)
{
    AutoUpdater.InstallationPath = currentDirectory.Parent.FullName;
}

Specify size of the UpdateForm

copy iconCopydownload iconDownload
AutoUpdater.UpdateFormSize = new System.Drawing.Size(800, 600);

Change storage method of Remind Later and Skip options

copy iconCopydownload iconDownload
string jsonPath = Path.Combine(Environment.CurrentDirectory, "settings.json");
AutoUpdater.PersistenceProvider = new JsonFilePersistenceProvider(jsonPath);

WinForms

copy iconCopydownload iconDownload
System.Timers.Timer timer = new System.Timers.Timer
{
    Interval = 2 * 60 * 1000,
    SynchronizingObject = this
};
timer.Elapsed += delegate
{
    AutoUpdater.Start("http://rbsoft.org/updates/AutoUpdaterTest.xml");
};
timer.Start();

WPF

copy iconCopydownload iconDownload
DispatcherTimer timer = new DispatcherTimer {Interval = TimeSpan.FromMinutes(2)};
timer.Tick += delegate
{
    AutoUpdater.Start("http://rbsoft.org/updates/AutoUpdaterTestWPF.xml");
};
timer.Start();

Handling Application exit logic manually

copy iconCopydownload iconDownload
AutoUpdater.ApplicationExitEvent += AutoUpdater_ApplicationExitEvent;

private void AutoUpdater_ApplicationExitEvent()
{
    Text = @"Closing application...";
    Thread.Sleep(5000);
    Application.Exit();
}

Handling updates manually

copy iconCopydownload iconDownload
AutoUpdater.CheckForUpdateEvent += AutoUpdaterOnCheckForUpdateEvent;

private void AutoUpdaterOnCheckForUpdateEvent(UpdateInfoEventArgs args)
{
    if (args.Error == null)
    {
        if (args.IsUpdateAvailable)
        {
            DialogResult dialogResult;
            if (args.Mandatory.Value)
            {
                dialogResult =
                    MessageBox.Show(
                        $@"There is new version {args.CurrentVersion} available. You are using version {args.InstalledVersion}. This is required update. Press Ok to begin updating the application.", @"Update Available",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Information);
            }
            else
            {
                dialogResult =
                    MessageBox.Show(
                        $@"There is new version {args.CurrentVersion} available. You are using version {
                                args.InstalledVersion
                            }. Do you want to update the application now?", @"Update Available",
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Information);
            }
    
            // Uncomment the following line if you want to show standard update dialog instead.
            // AutoUpdater.ShowUpdateForm(args);
    
            if (dialogResult.Equals(DialogResult.Yes) || dialogResult.Equals(DialogResult.OK))
            {
                try
                {
                    if (AutoUpdater.DownloadUpdate(args))
                    {
                        Application.Exit();
                    }
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.Message, exception.GetType().ToString(), MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                }
            }
        }
        else
        {
            MessageBox.Show(@"There is no update available please try again later.", @"No update available",
                MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
    }
    else
    {
        if (args.Error is WebException)
        {
            MessageBox.Show(
                @"There is a problem reaching update server. Please check your internet connection and try again later.",
                @"Update Check Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        else
        {
            MessageBox.Show(args.Error.Message,
                args.Error.GetType().ToString(), MessageBoxButtons.OK,
                MessageBoxIcon.Error);
        }
    }
}

Handling parsing logic manually

copy iconCopydownload iconDownload
AutoUpdater.ParseUpdateInfoEvent += AutoUpdaterOnParseUpdateInfoEvent;
AutoUpdater.Start("http://rbsoft.org/updates/AutoUpdaterTest.json");

private void AutoUpdaterOnParseUpdateInfoEvent(ParseUpdateInfoEventArgs args)
{
    dynamic json = JsonConvert.DeserializeObject(args.RemoteData);
    args.UpdateInfo = new UpdateInfoEventArgs
    {
        CurrentVersion = json.version,
        ChangelogURL = json.changelog,
        DownloadURL = json.url,
        Mandatory = new Mandatory
        {
            Value = json.mandatory.value,
            UpdateMode = json.mandatory.mode,
            MinimumVersion = json.mandatory.minVersion
        },
        CheckSum = new CheckSum
        {
            Value = json.checksum.value,
            HashingAlgorithm = json.checksum.hashingAlgorithm
        }
    };
}

JSON file used in the Example above

copy iconCopydownload iconDownload
{
   "version":"2.0.0.0",
   "url":"http://rbsoft.org/downloads/AutoUpdaterTest.zip",
   "changelog":"https://github.com/ravibpatel/AutoUpdater.NET/releases",
   "mandatory":{
      "value":true,
      "minVersion": "2.0.0.0",
      "mode":1
   },
   "checksum":{
      "value":"E5F59E50FC91A9E52634FFCB11F32BD37FE0E2F1",
      "hashingAlgorithm":"SHA1"
   }
}

C# Autoupdater.net can't extract

copy iconCopydownload iconDownload
AutoUpdater.InstallationPath = currentDirectory.FullName;

Increasing a version between a XML Tag

copy iconCopydownload iconDownload
XmlDocument doc = new XmlDocument();
doc.Load(@"filepath");

var versionNode = doc.SelectSingleNode("item/version");
versionNode.InnerText = Assembly.GetExecutingAssembly().GetName().Version.ToString();
doc.Save(@"filepath");

See all related Code Snippets

Community Discussions

Trending Discussions on AutoUpdater.NET
  • c# AutoUpdater.NET - Application should not close, if update available
  • C# Autoupdater.net can't extract
  • Increasing a version between a XML Tag
Trending Discussions on AutoUpdater.NET

QUESTION

c# AutoUpdater.NET - Application should not close, if update available

Asked 2021-Aug-22 at 02:58

I'm using AutoUpdater.NET for updating my applications. It's a great library. My program collects data for inventory system-data, sent it to database and than close the application.

this.Close();

The problem is, that the program also close, if an update is available. I want, that the application stay open, until the user update or cancel. I know that I have to check, if update is available or update-form is open, but I don't know how. Could someone please help? (Sorry, I'm beginner)

AutoUpdater.Start(updatePath);
AutoUpdater.ShowSkipButton = false;
AutoUpdater.ShowRemindLaterButton = false;
AutoUpdater.Mandatory = true;
//AutoUpdater.UpdateMode = Mode.Forced;
AutoUpdater.RunUpdateAsAdmin = false;
var currentDirectory = new DirectoryInfo(Environment.CurrentDirectory);
if (currentDirectory.Parent != null)
{
    AutoUpdater.InstallationPath = currentDirectory.FullName;
}

ANSWER

Answered 2021-Aug-22 at 02:58

The solution (in my case) was to replace Environment.CurrentDirectory with Application.StartupPath

Source https://stackoverflow.com/questions/68810081

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install AutoUpdater.NET

If you like to use ftp XML URL to check for updates or download the update file then you can provide you FTP credentials in alternative Start method as shown below. If you are using FTP download URL in the XML file then credentials provided here will be used to authenticate the request.
If you don't want to download the latest version of the application and just want to open the URL between url tags of your XML file then you need to add following line with above code. This kind of scenario is useful if you want to show some information to users before they download the latest version of an application.

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases
Explore Kits

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Reuse Pre-built Kits with AutoUpdater.NET
Consider Popular Form Libraries
Try Top Libraries by ravibpatel
Compare Form Libraries with Highest Support
Compare Form Libraries with Highest Quality
Compare Form Libraries with Highest Security
Compare Form Libraries with Permissive License
Compare Form Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases
Explore Kits

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.