|
| Use Cabinet.dll to create your own cabinet Files Updated(4) |  
|
|---|
Product: Delphi all versions | Category: Files Operation | Skill Level:
 | Scoring:  | Last Update: 06/25/2001 | Search Keys: delphi delphi3000 article borland vcl code-snippet Cabinet.dll FCI FCICreate FCIFlushFolder FCIAddFile | Times Scored: 11 | Visits: 9694 | Uploader: Vimil Saju Company: Nil | Reference: N/A | | Component Download: ../article/1820/Attachements.zip | | | Question/Problem/Abstract:
How to use cabinet.dll to create cabinets? | Answer:
I have created a component that enables one to compress files to a cabinet file. This component requires the cabinet.dll which usually resides in your system folder. This component consists of two units. The first unit contains all the structures required by the component.
I have updated the Cabinet unit. now you can add file by using wild cards.
The Compression now takes place in a separate thread,so that you program won't freeze. I have fixed the bug in Onstatusevent. It shows the progress correctly now. I have added an abort function which can be called during the compression process so to cancel compression.You can now specify th directory in which you
want to decompresss the file using the 'addfile function'
I have added the decompress facility, though it is not yet perfected. The Decompressor and compressor run in separate threads so that the application does not freeze. You can also get the list of files present in a cabinet without extracting them. Many bugs were removed. Now there are two components
TCabCompressor and TCabDecompressor.
To select an individual file to decompress you have to first select it by calling the funtion cabdecompressor1.Files[0].Select. To select all files you can call the function cabdecompressor1.SelectAllFiles and to select files using wildcards use the function cabdecompressor1.SelctFilesByWildCard.
The BeforeCopyFile event in TCabDecompressor Class has been updated to include a parameter called overwrite which indicates wetther the file being decompressed
will overwrite an existing file or not.
The two units along with a demo program are available for download from the download option above.
|
|