views:

680

answers:

4

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 this in a Qt app, without having to worry about the OS details? At least for Windows/Mac/user-owned-linux-binaries.

I could integrate Sparkle on the Mac version, code something for the linux case (only for a standalone, user-owned binary; I won't mess with distros packaging, if my program is ever packaged), and find someone to help me on the Windows side, but that's horribly painful. Surely I'm not the only one who wants to provide this to users?

A: 

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.

Ankur Gupta
Omaha is not cross-platform, it only works for Windows.
FX
+1  A: 

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

For 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, I let you the link to the tutorial: http://tcuvelier.developpez.com/qt/updater/01-introduction/.

Hope that helps.

Patrice Bernassola
I do speak french, so that won't be a problem. However, this tutorial was started 7 months ago, and it still only has part one available, so I doubt it's soon gonna be ready to use "as is".
FX
+5  A: 

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

FX
It really, really is. I end up googling for a "proper" WinSparkle about once a month. One of these days I'm going to just write my own.
kurige
+1  A: 

I've developed an auto-updater library which works beautifully on OSX, Linux and pretty much every Unix that allows you to unlink a file while the file is still open. Reason being that I simply extracted the downloaded package on top of the existing app. 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.

Windows, why do you hate me so?

Edit: I just discovered that you can RENAME open files. This may actually work? Will let you know.

Edit: Renaming the working directory of the application works on Windows 7 and XP. Haven't tried Vista yet. YAY!

cheez
A link to your library? How do you deal with updating more than one exe file? (shared libraries, resources, etc.)
FX
It's not online yet. If there is interest, I might remove my application dependencies from it and put it on github.On Windows, the way it works at the moment is that it downloads a zip file, moves the current installation out of the way (which I think will probably only work on NTFS, not FAT, but I don't care) and unzips on top of the current install directory. So this way, multiple resources are updated without a problem.On Unix, it is much simpler: just unzip on top of the application because Unix allows you to unlink files while they are still open.
cheez