How to enable automatic updates in a cross-platform Qt application?

I like applications that can independently update themselves without any effort from the user (think: Sparkle framework for Mac). Is there any code / library that I can use for this in a Qt application without worrying about OS details?

At least for Windows, Mac, and custom Linux binaries.

I could integrate Sparkle into the Mac version, the code is something for the Linux case (only for stand-alone, user-owned binary code, I will not mess with distribution if my program is ever packaged) and find someone to help I'm on the Windows side, but it's terribly painful.

+48
cross-platform qt auto-update
Jan 16 '10 at 14:11
source share
12 answers

OK, so I assume that I perceive this as a "no (cross-platform) way." This is too bad!

0
Jan 24 '10 at 15:07
source share

This is not a complete solution, but a cross-platform (Windows, Mac, Linux) tool for creating packages for automatic updates and their installation is available at https://github.com/mendeley/Update-Installer . This tool does not publish updates or download them.

This was written for use with a Qt-based application, but to make the update installer small, standalone and easy to build, the installer uses only standard system libraries (C ++ runtime, pthreads / libz / libbz2 on Linux / Mac, Win32 API in Windows, Cocoa on Mac, GTK with Linux backup). This makes it easy to deliver updates that include new versions of Qt and other non-system libraries that your application depends on.

Before considering this, I would suggest:

  • If you build only two platforms, consider using standard and proven automatic update frameworks for these platforms - for example. Sparkle on Mac, Google Omaha on Windows, or automatic update systems built into popular installations (e.g. InstallShield). I have not tried BitRock.
  • The Mac Mac App Store may be a good option. However, see https://bugreports.qt.io/browse/QTBUG-16549 .
  • On Linux, consider creating a .deb package and a simple repository to host it. After users have the repository installed, system-wide software update tools will take care of checking and installing new releases. However, the steps to create a new repository are too complex for many new Ubuntu / Debian users. What we did, as well as what Dropbox and Google did, was to create a .deb package that installs the repository as part of the package installation.

A few other notes on creating the update:

  • In Windows Vista / 7, if the application is installed in system-wide mode (for example, in C: \ Program Files \ $ APPNAME), your users will see a scary UAC prompt when the updater tries to get write permissions to the installation directory. This can be avoided either by installing in a directory accessible to the user (I understand that this is what Google Chrome does) or by obtaining an Authenticode certificate and using it to sign the updater binary.
  • In Windows Vista / 7, an .exe or DLL application cannot be removed if it is used, but the updater can move the existing .exe / DLL from the outside to a temporary directory and designate it to be deleted the next time it reboots.
  • In Ubuntu, third-party repositories are disabled after distribution updates. Google works around this, creating a cron job to re-add the repository, if necessary.
+21
Sep 11 '11 at 12:03
source share

Shameless Plugin: Fervor , a simple multi-platform (Qt-based) autoupdater application inspired by Sparkle.

+9
Jun 02 2018-12-12T00
source share

Shameless plugin: This is a relatively old question, but I thought it might be useful to mention the newly created library, which I called "QSimpleUpdater". In addition to notifying you, if there is a newer version, it allows you to download the change log in any format (for example, HTML or RTF) and download updates directly from the application using the dialog box.

As you can expect from the Qt project, it works on any platform supported by Qt (tested on Windows, Mac, and Linux).

References:

Screenshot:

enter image description here

+6
Jan 16 '15 at 1:02
source share

Although it works slightly differently than Sparkle, BitRock InstallBuilde r contains an autoupdater written in Qt that can be used independently (disclaimer, I'm the original BitRock developer). This is a commercial application, but we have free licenses for open source projects.

+3
May 08 '11 at 1:48 a.m.
source share

I developed an autoupdate library that works great on Mac OS X, Linux, and almost all Unix, which allows you to unlink the file while the file is still open. The reason is that I simply extracted the downloaded package on top of the existing application. Unfortunately, since I relied on this functionality, I ran into problems on Windows because Windows does not allow to disable an open file.

The only alternative I can find is to use MoveFileEx with a replacement for reload flags, but this is terrible.

However, renaming the application’s working directory works in Windows 7 and Windows XP. I have not tried Windows Vista yet.

+2
Apr 03 '10 at 21:46
source share

Blog Post Mixing Cocoa and Qt may fix the issue for the Mac platform.

+2
Feb 12 '11 at 16:42
source share

I found WebUpdate to be very useful, although it is written using wxWidgets. But don’t worry, this is a standalone application that processes your updates. The steps to integrate it are quite simple - just write two XML files and run the updater. And yes, it is cross-platform.

The advantage of this is that it will automatically download and unzip / install everything you need, and not just provide a pop-up window with a notification about the new version and a link to download it. Another thing you can do with it is custom actions.

The main page of the project is here , you can read the docs or take a look at the official tutorial .

+2
Aug 10 2018-12-12T00:
source share

You can use UpdateNode , which gives you every opportunity to update your software. It uses the cross-platform Qt client and is free for Open Source!

UPDATE Just did another analysis of this and really wanted this solution:

Pros:

  • Free for Open Source !!! Even the client is Open Source: https://github.com/updatenode/unclient
  • The client is already localized in several languages
  • Very flexible in terms of updates. You can even update individual non-binary files.
  • Provides an additional way to display messages, although the client.
  • Ready to use binaries and installers for all common Linux distributions, a single Windows binary, as well as an installer and solution for Mac (which I have not tried since I don’t have a Mac)
  • An easy-to-use web service, good statistics and check for updates are integrated in a few minutes.

Minuses:

  • I miss the multi-user management in the online service. Perhaps they will do it in the future - I will definitely say that in my feedback portal
  • The client is only a GUI client - so you have to compress it to work without a GUI (perhaps this is only necessary for people like me ;-))

So, on the bottom line, as this solution is completely new, I think there are many possibilities. I will definitely use it in my project, and I look forward to more from them! Thumbs up!

+2
Mar 20 '14 at 9:02
source share

I suggest you read the plugin and how to create and use it. If your application architecture is modular and divided into different plugins. Check out the Google Auto Update utility http://code.google.com/p/omaha/ . We use it.

+1
Jan 16
source share

Thibault Cuvelier writes a tutorial (in French) for developing an upgrade program. I know that the explanations are in French (and everyone does not understand French), but I think that this can be read using a web translator like Google Translate.At the same time, you will have a cross-platform update module, but you need to write it by yourself.

For what I know, the only part of the update program that is explained in the tutorial is the file download part. In case this can help you, refer to the tutorial, Un updater avec Qt .

I hope this helps.

+1
Jan 17 '10 at 19:55
source share

This is an old question, but there is no protein in the answers that is the BEST SOLUTION , here is what I do in qt 5.12.4 with qt quick "my qml app" can do this in any other language

I do it on Windows, there is a Mac version of the protein too, I don’t know about Linux

  1. Download the Nuget Package Explorer release https://github.com/NuGetPackageExplorer/NuGetPackageExplorer/releases
  2. open the nuget package explorer and add this directory 'lib / net45'. It doesn't matter if you have a .net application or not, I did it for my qt application, otherwise it will not work.
  3. add all files to this folder, indicate your version in metadata
  4. save nupkg file
  5. download protein release https://github.com/Squirrel/Squirrel.Windows/releases
  6. add protein to the Windows environment path
  7. open cmd and cd in the nupkg file directory
  8. squirrel --releasify file_name.nupkg → now in the releases folder there should be a setup.exe file that will install the application and other files.
  9. to create a new version, execute 2,3,4,7,8 again, if upon updating it a delta file is created that is required only for updating, put these files in the service directory, for example, in the update folder on your website which you need. To disable directory browsing in IIS and automatically update the application, you must call Update.exe, which is located in the parent folder of the application root directory appdir/../update.exe --update http://yourserver.com/upates/ , after the application restarts the application with the new version
  10. .you can find the protein documentation at https://github.com/Squirrel/Squirrel.Windows/blob/develop/docs/getting-started/0-overview.md and the nuget package explorer here https://github.com/ NuGetPackageExplorer / NuGetPackageExplorer , and you can only use nuget.exe if you do not want to use the nuget package explorer, which you can use to dynamically create versions that can be downloaded from https://www.nuget.org/downloads

It's simple. Now you have an auto-update application that will download updates from the server and an auto-update application. For more information, you can read the documentation.
note : to use iis https://github.com/Squirrel/OldSquirrelForWindows/issues/205

+1
Aug 17 '19 at 7:27
source share



All Articles