Jump to content
aehimself

Free & low maintenance update mechanism

Recommended Posts

The whole thing started with this topic. Due to lack of possibilities, I wrote my own update mechanism which noes not rely on any advanced stuff but still should be versatile enough.

 

Since the initial version TAEUpdater got some improvements and things are looking great. Some more stuff was implemented like hash-based verification, messages, E-tag caching, separate internal, development and production channels, ability to downgrade to a previous version, etc. I'm running it in my main application for a while and it seems to do the job correctly.


Since not all of us might update from an unauthenticated web server, now 3 different file providers are shipped: HTTP, flatfile and custom. HTTP uses Delphi's TNetHTTPClient, flatfile reads the files from a local disk and custom has all necessary events exposed via events. I also got rid of some personal dependencies (like compressing the update file or using System.Zip2) and now everything is handed to the user for the solution to be more... generic. I still use my own version discovery and comparison method to be able to determine which published one is "newer" but that is going to be my next step. As a workaround, you can call .LoadUpdateFile, check the new version in each ActualProduct.Files and call .Update manually.

 

What it needs:

- An update file containing the product, all its files and versions. You can build this with TAEUpdateFile.SaveToStream in AE.Updater.UpdateFile.pas

- Update packages, which can be zipped or encrypted, on FTP, HTTP, custom protocol - doesn't matter as events should be in place for performing all these actions

 

Plans for the future:

- Getting rid of more dependencies, maybe it'll become a standalone updater package with no extras

- By accomplishing the above the code will get closer and closer to be truly cross-platform (atm it's WIndows only)

- Get rid of modern stuff (like generics) and implement proper versioning conditionals so the package can be compiled and installed on anything other than D11.2

- Really, really basic documentation on how to use...

 

Disclaimer: further changes are on their way. I'll possibly add / remove events / splitting the component in multiple subcomponents which might make existing .DFMs failing to be streamed. Also, publish your new versions on the Internal channel if I might break the core functionality 😞

 

All words as one - I just wanted to give the existing Delphi community a chance to implement auto-updating feature to their applications without having to pay for the component or the backend. Feel free to check it out. And suggest ways of improvement of course 🙂

  • Like 4
  • Thanks 1

Share this post


Link to post
On 10/29/2022 at 1:40 AM, aehimself said:

Get rid of modern stuff (like generics) and implement proper versioning conditionals so the package can be compiled and installed on anything other than D11.2

Generics are with us since D2009 and you unlikely want to support something older as it will require too much manual job.

 

Impressive project! Glad to see my stack trace unit 🙂 you'll probably want to update its code from https://github.com/Fr0sT-Brutal/Delphi_StackTraces/blob/master/Ice.Debug.pas since it has an improvement of excluding non-relevant entries and better comments

Share this post


Link to post
49 minutes ago, Fr0sT.Brutal said:

Generics are with us since D2009 and you unlikely want to support something older as it will require too much manual job.

 

Impressive project! Glad to see my stack trace unit 🙂 you'll probably want to update its code from https://github.com/Fr0sT-Brutal/Delphi_StackTraces/blob/master/Ice.Debug.pas since it has an improvement of excluding non-relevant entries and better comments

There are lots of people who dislike Generics and would like to avoid having them in their projects. Using a standard TList and casting pointers can be an easy solution. In theory this whole thing could be D7 compatible if I'd invest enough free time in it. We'll see.

 

So the author of said stack trace unit was you? 🙂 I remember having it for ages without any sign of where / who it came from so I can give appropriate credit. There were also some cyrillic characters in it which threw me totally off. As it seems it grew a lot, and since the new version is on GitHub it's easier just to remove it from mine.

I don't like redundancy.

Share this post


Link to post
2 hours ago, aehimself said:

There are lots of people who dislike Generics and would like to avoid having them in their projects. Using a standard TList and casting pointers can be an easy solution. In theory this whole thing could be D7 compatible if I'd invest enough free time in it. We'll see.

LOL. Probably you should show them SysUtils and see how they'll try to avoid that unit 😄

2 hours ago, aehimself said:

So the author of said stack trace unit was you? 🙂 I remember having it for ages without any sign of where / who it came from so I can give appropriate credit. There were also some cyrillic characters in it which threw me totally off. As it seems it grew a lot, and since the new version is on GitHub it's easier just to remove it from mine.

I don't like redundancy.

The post you linked to was mine 🙂 and yep, the code is mine, I just didn't bother to add © for these few lines. Anyway these functions are slightly improved, fully translated to English and contained in the unit I linked above. You can extract the necessary parts to your unit

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×