Results 1 to 4 of 4

Thread: [VB6] Using Microsoft's Delta Compression API

Threaded View

  1. #1

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Lightbulb [VB6] Using Microsoft's Delta Compression API

    Sometimes you need a simple and convenient way to compress and decompress files. I'm not talking about archiving, where multiple files and a directory are stored in one file (with optional compression) like ZIP, CAB, LHA, and so many others. Just compressing files singly.


    Few people seem to be aware of one of the Microsoft APIs for file compression. This is meant for creating and compressing (and re-applying) patches for software updating, but it also works on non-code files and will even work without "differencing."

    See the main writeup at Delta Compression Application Programming Interfaces. There are actually two of these (PatchAPI and MSDelta) but I'll cover PatchAPI since it works before Vista as well as after.

    There are two DLLs to PatchAPI. One comes in Windows and is named mspatcha.dll and the other comes in the Windows SDK and is called mspatchc.dll. The "A" DLL applies or expands a compressed delta patch while the "C" DLL creates or compresses files to make a "patch." if you need to do both compression and decompression in your applications you'll need to deploy mspatchc.dll but it requires no registration.


    The attached demo uses both parts of PatchAPI, so to run it you will need to put mspatchc.dll into the Project (and EXE's) folder. DeltaAPI.bas has all of the API constant and entrypoint definitions you'll need for most purposes.

    While some of this may seem awkward, the ease of use is impressive. And those making "self updaters" may find this a great way to create update patch files. Read the MSDN article for more details.
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width