Simple auto-updater (cross-platform)?

BlitzMax Forums/BlitzMax Programming/Simple auto-updater (cross-platform)?

Grisu(Posted 2010) [#1]
Hello!

A.
For my little radio player project more and more people demand an auto-updater for the station files. Has someone here written a thing like that? - It needs to be cross-platform.

B.
My idea for this function was:
1. Download a complete filelist from a static url.
2. Then check every file on the users HDD:
- File is older or not present => File from the server is downloaded
- File is not in list (i.e. broken station) => File will be deleted from HDD
3. CRC check for errors?

^Are there more efficient ways to handle this?

C.
Is it better to buy a commercial / external app for this? Which one?

I don't want to reinvent the wheel if possible.

Thanks!
Grisu


GfK(Posted 2010) [#2]
Trouble with using file date/timestamps is that they can be changed.

I would give every file a version number, and store it on the client PC in an index file. Keep an updated index file on the server, compare the two, download anything that needs updating.

Reinventing wheels is good sometimes. You finish up with exactly the wheel to suit your needs rather than making do with somebody else's wheel. You might get a better wheel than anything that existed before.


Grisu(Posted 2010) [#3]
Thanks for the fast reply.

I also could zip all the stations files into one. So I only need to check one file. I could then download the zip and extract it to the users dir.


Gabriel(Posted 2010) [#4]
I don't know of any cross platform apps of this type. Since the vast majority of features would need platform-specific code, I'm thinking that a cross-platform autoupdater would be hideously expensive. I use this Windows-only one, which has source available, but does not yet have any ports that I know of.

http://wyday.com/wyupdate/


N(Posted 2010) [#5]
http://sparkle.andymatuschak.org/

Sparkle appears to be the dominant update framework for Mac OS software. I personally think it works very well, based on how many programs I've seen using it.


Grisu(Posted 2010) [#6]
Thanks for the input.

So far I'm making good progress, the only issue I have is the download function.



The following function crashes when downloading a lot of small files in a row.



Why does saving banks no longer work? I remember it did in old days.
bank:TBank = LoadBank("http://www.google.com/intl/en_ALL/images/srpr/logo1w.png)
SaveBank(bank, "c:/logo.png")


kfprimm(Posted 2010) [#7]

Strict

Import BRL.HTTPStream

Local bank:TBank=LoadBank("http::www.google.com/intl/en_ALL/images/srpr/logo1w.png")
SaveBank bank,"C:/logo.png"


Untested, but I believe that should do it. Note the "::".


Grisu(Posted 2010) [#8]
Thanks, User error... ;)