How can I enable auto-updates in a Qt cross-platform application?

前端 未结 12 512
孤街浪徒
孤街浪徒 2020-12-22 18:37

I love applications that are able to update themselves without any effort from the user (think: Sparkle framework for Mac). Is there any code/library I can leverage to do th

相关标签:
12条回答
  • 2020-12-22 19:37

    You can use UpdateNode which gives you all the possibilities to update your software. It's using a cross platform Qt client and is free for Open Source!

    UPDATE Just did some further analysis on that and really like 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 single non-binaries.
    • Provides additionally a way to display messages though the client.
    • Ready to use binaries & installer for all common Linux distributions, single Windows binary, as well as installer and a solution for Mac (which I have not tried, as I don't have a Mac)
    • Easy to use web service, nice statistics and update check is integrated within few minutes

    Cons:

    • I am missing a multi-user management in the online service. Maybe they will do it in future - I will definitely suggest that in their feedback portal
    • The client is a GUI client only - so, you will need to shrink it down to run without a GUI frontend (maybe only necessary for people like me ;-) )

    So, bottom line, as this solution is quite new, I think there is lot of potential here. I will definitely use it in my project and I am looking forward for more from them! Thumbs up!

    0 讨论(0)
  • 2020-12-22 19:37

    I suggest you read on plugin and how to create and use them. If your application architecture is modular and be split into different plugins. Take a look at Google Auto Update utility http://code.google.com/p/omaha/. We use this.

    0 讨论(0)
  • 2020-12-22 19:38

    I have found WebUpdate to be quite useful, though it's written with the wxWidgets. But don't worry, it's a separate app which handles your updates. The steps to integrate it are pretty simple - just write two XML files and run the updater. And yes, it's cross-platform.

    The advantage of it is it will automatically download and unzip/install all you required and not just provide a popup with a notification about a new version and a link to download it. Another thing you can do with it is customizable actions.

    Project's main page is here, you can read the docs or take a look at the official tutorial.

    0 讨论(0)
  • 2020-12-22 19:39

    OK, so I guess I take it as a "no (cross-platform) way". It's too bad!

    0 讨论(0)
  • 2020-12-22 19:41

    I've developed an auto-updater library which works beautifully on Mac OS X, Linux and pretty much every Unix that allows you to unlink a file while the file is still open. The reason being that I simply extracted the downloaded package on top of the existing application. Unfortunately, because I relied on this functionality, I ran into problems on Windows as Windows does not let you unlink an open file.

    The only alternative I could find is to use MoveFileEx with the replace on reboot flag, but that is awful.

    However, renaming the working directory of the application works on Windows 7 and Windows XP. I haven't tried Windows Vista yet.

    0 讨论(0)
  • 2020-12-22 19:41

    Thibault Cuvelier is writing a tutorial (in French) to develop an updater. I know the explanations are in French (and everyone is not understanding French), but I think this can be readable with a web translator like Google Translate. With this you will have a cross-platform updater, but you need to write it by yourself.

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

    I hope that helps.

    0 讨论(0)
提交回复
热议问题