Skip to main content
GameDev.net gamedev.net
🔒 Locked

Implementing "auto-update" feature - advice?

Started by spiralmonkey Dec 15, 2005 at 3:34 AM 17 replies 1.5k views
Original Post
spiralmonkey
spiralmonkey
hey all, i'm about to venture into adding "auto-update" into my application. The app itself will decide when to auto-update. i don't want an update 'service' running. My plan was this: every so often ftp to my site, download an update list, check the list to see if an update is necessary, and if so download the appropriate .msi file, uninstall my app and run the .msi. I guess the problem is the user will have to go through the full install (lots of clicks) again unless i make a separate .msi that doesn't have an interface. is this the right way to go about doing this or can you think of a better way? also, how would one start an explorer-type download window (the one with the progress bar) so i don't need to use ftp to get the file to my site? any advice would be much appreciated. thanks, alan
SirLuthor
SirLuthor
Hrm. With all due respect, that idea seems foolish. With anything but the most trivial games, a full install takes a long time, much longer then it would take simply to patch all the updated files. That's not to mention the time it takes to uninstall as well. There is a whole lot of waste going on there. I suggest you rethink that a bit, even if it requires a bit more work put into a solution. I for one would not ever use or update something that would require a full re-install, nor would I want to download the full install file every time I had to update.

Cheers!
Free speech for the living, dead men tell no tales,Your laughing finger will never point again...Omerta!Sing for me now!
dave
dave
If you're program is separated into a set of libraries you can simply download these and replace the old ones.
paulecoyote
paulecoyote
Only of any use if you are using a .Net language, visual studio 2005 has a new thing where you just right click on the project, click "publish" then finish if you want to keep the defaults, and it will publish it to a webserver.

This mechanism can detect when versions need to be updated, or if the program should only be run when they are online.

It's kind of like Java Webstart, but more integrated and windows-y

I've tried it out inhouse myself for a regular expression dev tool I wrote and it works great. One right click and two left clicks.
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.
ajones
ajones
The following is just an idea - I don't know how suitable it would be...

Divide your application into a number of modules, each of which is represented by an (optionally abstract) interface and concrete implementation (which resides in a DLL file). Write the interfaces so that you can 'shut down' a module and start it back up again at run time.

You can then implement your ftp idea, but download module implementations (i.e. DLLs) instead of .msi files. Upon downloading an update for a given module, simply shut down and unbind that module, then rebind and start up the replacement.

Cheers,
Jones.
spiralmonkey
spiralmonkey
thanks for your responses!

i guess i should have mentioned that my app is a screensaver, so it's not HUGE about 4 meg, but the actual executable itself is about 700k. i suppose i should go the .dll route. i tried a simple auto-update before, downloading an .exe to replace the existing app, but then microsoft required an 'ok' from the user before it would open it. is there some way around that? does that happen with .dlls too? sorry if those are basic questions, i'm fairly new to windows programming, and haven't gotten into .dlls yet.
Anon Mike
Anon Mike
4 meg is not huge for a screensaver?

(walks away muttering some claptrap about "back in MY day"...)
-Mike
CrazyCdn
CrazyCdn
There is also free code out there that does auto-updates Doom3/HL2/most other games style for you.
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." --Benjamin Franklin
spiralmonkey
spiralmonkey
Quote:
Original post by Anon Mike
4 meg is not huge for a screensaver?

(walks away muttering some claptrap about "back in MY day"...)


hey man, i almost went on a rant myself about how much easier it was back in the days of programming my C<64.

most of the memory is image maps. And it's more elaborate than flying toasters (or space taxi).



give it a try at www.dreamaquarium.com/download.html

i need beta testers. that's WHY i need an auto-updater, so my beta testers will actually know that there are new versions available with bug fixes!

Extrarius
Extrarius
Quote:
Original post by spiralmonkey
thanks for your responses!

i guess i should have mentioned that my app is a screensaver, so it's not HUGE about 4 meg, but the actual executable itself is about 700k. i suppose i should go the .dll route. i tried a simple auto-update before, downloading an .exe to replace the existing app, but then microsoft required an 'ok' from the user before it would open it. is there some way around that? does that happen with .dlls too? sorry if those are basic questions, i'm fairly new to windows programming, and haven't gotten into .dlls yet.
You're using some kind of internet explorer interface ('control') to download the files? If so, that is your problem - IE by default tags all files it downloads and windows will prompt you when you run something not downloaded from a site on the trusted domain.
You need to download the files another way.

Also, the idea in your original post is horrible - an update should NOT include anything it doesn't change (except for cumulative updates). You don't need to do extra work to separate your program into multiple modules (though 700kb is a _HUGE_ executable for a screensaver) - just don't include all the art assets in the update if they're not actually part of the update.

As far as 4MB of images, are you storing them in a decent format such as png or jpeg, and are you taking full advantage of the compression your format offers?
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
spiralmonkey
spiralmonkey
okay, so my original idea is not getting a lot of support (to say the least!)

i just tried ftping myself an executable and this time it seemed to work without any security hassles. Not sure what's changed since the last time i tried this (it was many months ago). Does that sound right? should i be able to ftp myself an executable without the system marking it as suspicious? That DOES seem like a security risk.

my images are all jpeg's (though high quality) with .sgi (rle) alpha channels. its just a lot of maps because the plants use many layers of transparency, plus the maps need to be higher resolution than the displayed res due to softening while sampling. The floor of the aquarium image is 2k wide.

btw, is there a jpg format that supports alpha channels???

thanks for the advice, i'm gonna look into .dlls as well, but i'm trying to keep the program as portable as possible, which to my mind means as straightforward, barebones, run-this-run-that c++ as possible so i can port to mac, linux, C<64 as easily as possible.

...just kidding about C<64

POKE 53280,0
POKE 53281,0
!

[EDIT]
oh yeah, and some of those large maps, especially the ground map and log map actually use 2 images: a 'fill' pass and a 'key' pass. that is, a map that looks like the scene on a cloudy day (fill pass) and one pass that looks like the scene on a sunny day (key pass) and i use the fill pass (constant) with a modulated (rippling) version of the key pass added on top to create the caustics.
M2tM
M2tM
I've got dual monitors set up and it's neat that it displays on both... But one of my monitors is turned on it's side so that it displays more code when i'm programming. I haven't tried turning it horizontal, it might work then. I run windows xp.

Monitor setup in asci:_________ ______|MONITOR| |MON-||   1   | |ITOR||_______| | 2  |          |____|

So now that you know my setup, here is the issue. It displays very well on my primary monitor, however my second monitor (the one on it's side) shows some really weird textures going on. It's clear the animations are working, but the textures are freaky.

Free Image Hosting at www.ImageShack.us

I realize I have an atypical monitor setup and that this is a non critical bug. I just thought I'd let you know about it.
_____"You're using a screwdriver to nail some glue to a ming vase. " -ToohrVyk
spiralmonkey
spiralmonkey
yeah, that's something i've seen before - it only happens on the odd computer though. If anyone has any problem PLEASE send me an error report.

also, your post shows up really weird on my computer too - the html is jacked.

[EDIT] your post is now fixed, unlike my 2nd monitor bug.
spiralmonkey
spiralmonkey
the link i gave everyone was just to the download page, since i already showed what the screensaver looks like in the above post. Or did you mean that pic isn't big enough?

the actual screensaver homepage is www.dreamaquarium.com
Alan Kapler, Developer of Dream Aquarium www.dreamaquarium.comhref=http://www.spiralmonkey.com>www.spiralmonkey.com
graveyard filla
graveyard filla
just use zip files as "patches". put anything new in the zip file... if there are new files, they will be added - updates to current files will be overwritten. sure, it doesnt remove old stuff, but how often will that happen? you can look at it as keeping it around in case you need it one day.

if you need to be perfect, there are patching programs out there. just google, i have used them in the past and found that zip files were easier to work with and just less hassle.

also, the flow is simple ; your app starts, downloads a small text file from a web server containing a version number. if the version matches the one sitting on the clients machine, then you are good. if they don't match, then you initiate a download for a file called "XtoY.zip". X is the version on the client; Y is the most recent version.

then, putting in a new release is fairly easy. you simply change the version file, and then add a new zip for each version upgrade... say if you are putting in version "1.4", you would add 3 zip files (1.1TO1.4, 1.2TO1.4, 1.3TO1.4). You can consider anything beyond 1.1 as "too old", and from that point to a complete reinstall.

so just have your code attempt to download "XtoY.zip", and if it doesn't find that file, have it resort to downloading the full install of the latest version.

i have used this in my game and i am pretty sure that hplus's MMORPG ("there") uses a similar technique; credit goes to him for showing it to me long ago [grin].
FTA, my 2D futuristic action MMORPG
caledh
caledh
We have an auto-updating application at my company that works out well. Basically, we can build patches using MSI. You just need to get familiar with Wix which will give you ultimate flexibility in building the MSI. This will allow you to create patches. It works out well.
iMalc
iMalc
Quote:
Original post by spiralmonkey
Quote:
Original post by Anon Mike
4 meg is not huge for a screensaver?

(walks away muttering some claptrap about "back in MY day"...)


hey man, i almost went on a rant myself about how much easier it was back in the days of programming my C<64.

most of the memory is image maps. And it's more elaborate than flying toasters (or space taxi).



give it a try at www.dreamaquarium.com/download.html

i need beta testers. that's WHY i need an auto-updater, so my beta testers will actually know that there are new versions available with bug fixes!
Ah, the flying toasters of After Dark. Those were the days. I remember doing a total replacement of the resources of the flying toasters SS, and made it flying trombones instead - with appropriate sound too!
Space taxi was so cool too. My cousin had it on the C<64, whilst I only had a VIC20 :-(

Your SS looks really nice. 4MB is reasonably big, but not overly big for what you're doing with it. However it could be a little smaller too. Sure the graphics might make people go wow, but you'll make other developers go wow as well, if you can do the same in only 512K. Don't be afraid to throw in a little procedurally generated content perhaps.

I suggest just notifying the user of updates and letting them sort out the download and reinstall.
Extrarius
Extrarius
I think TGA might be better compression if you're using JPEG at high quality. TGA is lossless and also supports an alpha channel. There is a nice program called "pngout" that compresses a tga by trying out many of the possible options and keeping the best ones (though you still have to specify some options). You should try it on a non-jpeg version of your images (if you have such a version - the jpeg will introduce artifacts that don't compress well so only use those if they're all you have) to see if it improves the size of your images.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.