How do I use the 7-zip LZMA SDK 9.x to self-extract?

Posted by Christopher on Stack Overflow See other posts from Stack Overflow or by Christopher
Published on 2010-04-24T16:32:37Z Indexed on 2010/04/24 16:33 UTC
Read the original article Hit count: 324

Filed under:
|
|

I am writing a SFX for an installer. I have a number of good reasons for doing this, primarily:

  • The installer is actually a large Python program which uses plugins. Using py2exe or pyinstaller makes doing plugins annoyingly complicated.
  • I want to be able to pass command-line options directly to the Python installer script, as if it were getting run directly.
  • Using the existing 7-zip SFX modules is clunky because I cannot pass command-line options directly into the processes I want to start.
  • I need more flexibility than any of the existing SFX modules I have seen provide.

I have already tried using the SDK to open the file, seek to the 7z archive signature, and run the decompression from there. That fails because the SzArEx_Open() call appears to assume that you are starting at a 0 offset in the file.

I am using the File_Seek() call to perform the seeking. It seems like there must be a way to do this, since the 7z archive format itself supports multiple embedded streams.

Any pointers to examples would be awesome, but narrative explanation is also quite welcome!

© Stack Overflow or respective owner

Related posts about c

    Related posts about lzma