Code Monkey home page Code Monkey logo

ksautoupdater's Introduction

ksAutoUpdater

Easy to use interface for adding auto-update functionality to your Delphi applications.

The interface uses the ETag of the remote file to determine if it is different to the one running. If it finds a different ETag to the one stored locally, then it will download the updated version and can also check the build of the updated version before updating to ensure it's a newer version.

It will check for an update 5 seconds after creation, then it will use the "interval" seconds which was passed as the parameter to the CreateAutoUpdater call.

Note: I use the Amazon S3 service to host my update files. If you plan on using another storage service, this should work provided it supports the ETag property.

Example use

uses ksAutoUpdater;

type
  TForm1 = class(TForm)
  private
    FAutoUpdater: IksAutoUpdater;
    procedure DoUpdateFound(Sender: TObject; AETag: string);
  public
    ...
  end;


constructor TForm1.Create(AOwner: TComponent);
begin
  FAutoUpdater := CreateAutoUpdater('https://eres.s3-eu-west-1.amazonaws.com/blah/blah/yourExe.exe',
	    			    LastStoredETag,
				    10,
				    DoUpdateFound);
end;


procedure TForm1.DoUpdateFound(Sender: TObject; AETag: string);
begin
  if (MessageDlg('Update found!'+#13+#10+''+#13+#10+'Install update now?', mtConfirmation, [mbYes, mbNo], 0) = mrYes) then 
  begin
    // you will  want to store the AEtag parameter in an ini file (or DB) so it can be read the next time the application loads 
    // to prevent unnessessary downloading of the same *.exe again.

    FAutoUpdater.DoUpdate(True);	
  end;
end;

ksautoupdater's People

Contributors

gmurt avatar atkins126 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.