views:

50

answers:

2

I have a program that I intend to install on Linux and Windows machines. I have it cross-compiling fine (with autotools), but at some point I would like the program to be able to update its binaries. The only ways I can think of doing this are:

  • Give users write access to "C:\Program Files\Foo Program" or "/usr/bin/foo_program".

or

  • Install the program to the user's profile/home directory.

Neither of these seems like a good idea. What would you do?

A: 

You need to give us more details on what you are trying to do - I don't understsand the link between cross platform, patching and your question.

If you need to be able to auto update the program, on linux at least, the best solution is to provide a binary package (rpm, deb, whatever, depending on your target), which is updated regularly - so that new versions will be picked up by the package manager. On windows and mac os x, things are usually more decentralized, each program has its own update manager. The best technical solution depends on the technology (C/C++/python/whatever). One exception I can think of on Linux is vmplayer, which tells you when there is a new version - but you still have to install the new version.

David Cournapeau
I want the program to be able to patch itself. The program runs on Windows and Linux. Thus cross-platform patching.
Tim
Ah ok - I was confused by cross-platform and cross compilation. You want a (cross platform) framework for update management. I think msi has something for this, if you use install shield:http://community.installshield.com/showthread.php?p=296750(I have never used it)
David Cournapeau
And I don't think you will find cross platform solutions which work very well on every platform. Auto-update are frowned upon in linux in general, whereas it is desired in Linux.
David Cournapeau
InstallBuilder provides a crossplatform update tool http://installbuilder.bitrock.com
Daniel Lopez
A: 

If the program binary is writeable, you could download the patch or the new bits to %TEMP% or /tmp then apply them to the binary. I don't think you need to be able to create new files in the directory. But you're going to run into problems on Windows with the file being in use while you try and patch it.

kbyrd