[VB6] Using Microsoft's Delta Compression API-VBForums
Results 1 to 4 of 4

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

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    17,486

    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

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    17,486

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

    Important:

    The mspatchc.dll is not redistributable as far as I can determine. It seems to be intended strictly as a developer's tool for those who have downloaded the Windows SDK and agreed to its licensing terms.

    This doesn't mean Delta Compression APIs don't have uses (such as creating patches, or compressing data during development) but your applications cannot use mspatchc.dll if you provide them to users.


    Also see the useful short blog post Binary Patching tools (mspatcha, mspatchc), which also covers the mpatch and apatch command line utilities briefly.

  3. #3
    New Member
    Join Date
    Jul 2011
    Posts
    1

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

    sir can you please teach me how to use this one..
    i really need to know beacause its a really big help to my thesis thank you sir!

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    17,486

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

    Based on the few writeups and examples this has not been used very much outside of Microsoft yet. I believe the links I provided above have the most information about these APIs published so far.

    My example of use above was a little specialized, just making use of the compression feature of the API. But it should be useful as a starting point for your own development.

    What more information were you hoping to find? Something related to self-updating? If so, the APIs do not handle this themselves. You still need to write logic to check for new versions, download the compressed patch, then use the APIs to apply the patch.

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
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.