PDA

View Full Version : Alert user when an update is available of my program



castors33
16th March 2012, 15:05
Hi,

I would like to know if it's possible with Qt to manage updates for my program. I mean : when an update is available, a window pop to advice the user, if he chooses to do it, the update is downloading. When it is done, the update is installing with or without an installation window.

Well, I guess there is nothing to manage this, but just knowing the classes or tool doing that would be really helpful!

Thanks off any clue!

wysota
16th March 2012, 15:16
I would like to know if it's possible with Qt to manage updates for my program.
Yes, it's possible.

castors33
16th March 2012, 15:22
can you help me by telling me where i should begin? I mean which classes I would use for that or anything else useful to be able to update my own made program

wysota
16th March 2012, 15:25
can you help me by telling me where i should begin?
You should begin with developing an algorithm of the update. Then you can start searching for classes that will implement that algorithm. There is no single solution to "how do I update my program" problem. Everything depends on the program itself.

castors33
16th March 2012, 15:44
But, to modify an executable, there must be more specific things to use

wysota
16th March 2012, 15:49
You won't be able to modify an executable while it is being executed. You need some kind of solution to replace the executable before the application is relaunched or after it quits. Of course all that provided the main executable indeed needs updating. Otherwise you can just update the libraries/plugins. As I said, it all depends on the program itself.

castors33
16th March 2012, 15:54
Ok, and one more thing, the executable is in a binary form, right?! So is it possible and raisonnable to modify it by the binary form or it would be better to recompile all the program at every update to get an new executable

wysota
16th March 2012, 15:59
You can do it any way you prefer.

castors33
16th March 2012, 16:09
to modify the executable, is there anything in Qt to help me or I have to code it all by myself? If yes, what more precisely

wysota
16th March 2012, 16:49
Apart from QFile? No. You don't have to code it by yourself, there are ready tools available such as diff and patch.

By the way, I think you are approaching the problem from the wrong end. Instead of thinking "how do I modify my binary" you should start by "how do I detect there is update available".

castors33
16th March 2012, 18:37
ok I'll try it...thanks!

Added after 1 45 minutes:

Finally, I found somewhere else that it seems easier to have a second program that simply downloads the new executable and replace the old one, that's what I'll try to do