Discuss this help topic in SecureBlackbox Forum

Create a self-extracting archive

ZIPBlackbox supports creation of self-extracting protected archives, which are basically Windows PE executable files with all the data embedded in them. The self-extracting option is useful where you need to send a file to a system which has no ZIP software installed. SFX files contain all the ZIP functionality needed to process the data, and are capable of unpacking data themselves without using any third-party software.

Creating self-extracted archives is virtually no different to creation of generic files and is performed with the same TElZIPWriter class. In addition to settings you normally tune-up (algorithms, file name, timestamp), you will also need to adjust the following properties:

  1. Provide the unpacking part ('the stub') via StubSource and StubName properties. The stub is essentially the compiled OpenPGP decryption code. Normally you provide a stub residing in a file (choose TSBZIPStubSource.ssFile as StubSource) or in a stream (TSBZIPStubSource.ssStream).
    ZipWriter.StubSource = SBArcZIP.TSBZIPStubSource.ssFile;
    ZipWriter.StubName = @"C:\zip\sbconstb.exe"; // the default console stub provided with SecureBlackbox
    
    If you set StubSource to ssStream, you need to handle TElZIPWriter.OnGetStubStream event.
  2. Set SFXEnabled property to true:
    ZipWriter.SFXEnabled = true;
    
  3. Additionally, you can finish the appearance of your executable by providing title and copyright strings:
    ZipWriter.SFXCopyright = "(C) Doors and Witches, Inc.";
    ZipWriter.SFXTitle = "Doors and Witches";
    

    How To articles about Zip file operations

    Discuss this help topic in SecureBlackbox Forum