7ZIP manual & documentation
On this site:|
-sfx (Create SFX archive) switch
Creates self extracting archive.
All SFX modules are uncompressed. You can use UPX program (http://upx.sourceforge.net) to compresss such modules. After compressing by the UPX program, the size of the sfx module will be reduced to 40-50% of its original size.
SFX modules for installers
SFX modules for installers are included in an external package (7z_extra). You can download these modules from www.7-zip.org. SFX modules for installers (7zS.sfx and 7zSD.sfx) allow you to create your own installation program. Such a module extracts the archive to the user's temp folder, and runs a specified program, and removes the temp files after the program finishes. A self-extracting archive for installers must be created as joining 3 files: SFX_Module, Installer_Config, 7z_Archive. In addition, an optional file, Installer_Config, is allowed. You can use the following command to create an installer self-extracting archive:
copy /b 7zS.sfx + config.txt + archive.7z archive.exe
An optimally small installation package size can be achieved, if the installation files are uncompressed before including them in the 7z archive.
-y switch for installer module specifies quiet mode extraction.
Installer Config file format
This config file contains commands for the Installer. The file begins with the string ;!@Install@!UTF-8! and ends with ;!@InstallEnd@!. The file must be written in UTF-8 encoding. The file contains any or all these string pairs:
You may omit any pair.
There are two ways to run a installation program: RunProgram and ExecuteFile. Use RunProgram, if you want to run a program from the .7z archive. Use ExecuteFile, if you want to open a document from the .7z archive, or if you want to execute a command from Windows.
If you use RunProgram, and if you specify empty directory prefix: Directory="", the system searches for the executable file in the following sequence:
Config file Examples
;!@Install@!UTF-8! Title="7-Zip 4.00" BeginPrompt="Do you want to install the 7-Zip 4.00?" RunProgram="setup.exe" ;!@InstallEnd@!
;!@Install@!UTF-8! Title="7-Zip 4.00" BeginPrompt="Do you want to install the 7-Zip 4.00?" ExecuteFile="7zip.msi" ;!@InstallEnd@!
;!@Install@!UTF-8! Title="7-Zip 4.01 Update" BeginPrompt="Do you want to install the 7-Zip 4.01 Update?" ExecuteFile="msiexec.exe" ExecuteParameters="/i 7zip.msi REINSTALL=ALL REINSTALLMODE=vomus" ;!@InstallEnd@!
7z a -sfx a.exe *.txt
adds *.txt files to self extracting archive a.exe using the default console SFX module.
7z a -sfx7z.sfx a.exe *
adds all files to self extracting archive a.exe with module 7z.sfx using windows version of SFX mudule.
Commands that can be used with this switch
|Hosted by bugaco.com|