views:

194

answers:

4

How do patches or service packs work? I don't know how to explain my question but I will give a try

Take Windows for example. It has files which altogether consume 100s of MB. Now a single service pack (may be 300 MB file) updates the whole windows OS.

Similarly I have seen updates happening for softwares like adobe reader etc. In all these cases the main exe is much larger compared to the update. How does the process work? If the main file refers any dependancy files and if the update change the version or size. Will it not affect the exe?

+3  A: 

Patches and service packs usually only need to update core shared libraries of the system. These libraries are replaced or patched from a compressed archive, hence their size. Once the libraries are updated the rest of the software of the OS can continue using the new versions.

Applications nowadays are designed to be modular and to use external libraries which can be updated easily. Sometimes the main application or any media used does not need to be replaced, only the library that's changed.

Gary Willoughby
+1  A: 

Following URL may be of interest to you in knowing architecture.

http://msdn.microsoft.com/en-us/library/aa387291(VS.85).aspx

lakshmanaraj
+4  A: 

To complement earlier answers, back in the day, when file size really mattered, some patches were delivered as binary diffs, meaning, the patch itself was an executable that knew what files needed to be changed, and how, and it actually changed only a certain part of the files' zeroes and ones, locally, instead of replacing the files entirely.

Henrik Paul
+1  A: 

Patches (also called deltas) are only the differences between two files. If only few bytes of 1GB file change, patch will have only few bytes of size. For text files diff is used, for binary files xdelta or similar. Service packs are collections of patches.

vartec