Keeping your application current?

Started by
7 comments, last by Nitage 17 years, 7 months ago
This is a question not directly related to games, but to all applications which may need the occasional patch or update. Is there a neat way to parcel some files into an executable which will then extract those files onto a target machine? In essence, how do I create my own version of the Winzip self-extractor, and a parent application which creates the self-extracting executable? Any help would be much appreciated.
Advertisement
simple approach is to add files as resources. Extract the files and spawn setup file

FindResource()
LoadResource()

Kuphryn
Another way is to realize that you don't need to do this. If you're on Windows, just use the Windows Installer. Visual Studio comes with "deployment" project templates that build installer packages for you. There's a Windows Installer API that allows you to install and update components based on packages, in the background, if you want.

Don't re-invent the wheel.
enum Bool { True, False, FileNotFound };
First off, thank you both for your answers.

Kuphryn, could you please elaborate slightly? I really need to produce an application which creates the distributable from a simple UI - and compress the files - is this possible using your method?

Hplus, yes I use windows installer for the application itself, but I need to be able to have more control over the updates, including checking little version numbers and searching a target machine for an install directory automagically.
Try this then: PatchMaker

There is both a freeware and a comercial version avaliable and it'll do pretty much exactly what your after. Its pretty simple to use and can create patches from multiple version to the current one. Just setup your directories with each version, tell it which versions are old and which is current, click go ... it'll diff them, figure out which files have changed and what todo with them. Way simpler than writing it yourself, and it also can check regitery keys or ini files for install dirs or whatever.
Thanks for the link, Kuphryn - it is exactly the kind of thing I need.

The problem is that I really want to learn how to code this kind of thing myself - even if it is reinventing the wheel a little.
I'm not "Kuphryn" :P

As for doing it yourself I've never tried but you'd probably want to create some kind of diff app that outputs the difference between directories and saves all the changed files into a .zip. Then put that into the resources of your patcher app and have it unzip then overwrite the originals into the target dir. But it'd be a decent amount of work to make it look good and take care of all the possible special cases (ie. you don't want your updater patching someone's saved preferences or data).
Sorry about that :)

Its going to be much simpler than that - all I need is a UI which lets me add files from a browser, then packages the whole thing neatly into an executable with the files in some kind of compression.

The part I cannot currently do is the combining of files into an application.
Have a look at the Windows executable format (search here for .exe).

This topic is closed to new replies.

Advertisement