Tutorial :Cross platform patching


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".


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

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


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.


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.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »