Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

166 lines
5.3 KiB

  1. 7-Zip for installers 9.38
  2. -------------------------
  3. 7-Zip is a file archiver for Windows NT/2000/2003/2008/XP/Vista/7/8/10.
  4. 7-Zip for installers is part of LZMA SDK.
  5. LZMA SDK is written and placed in the public domain by Igor Pavlov.
  6. It's allowed to join 7-Zip SFX module with another software.
  7. It's allowed to change resources of 7-Zip's SFX modules.
  8. HOW to use
  9. -----------
  10. 7zr.exe is reduced version of 7za.exe of 7-Zip.
  11. 7zr.exe supports only format with these codecs: LZMA, LZMA2, BCJ, BCJ2, ARM, Copy.
  12. Example of compressing command for installation packages:
  13. 7zr a archive.7z files
  14. 7zSD.sfx is SFX module for installers. 7zSD.sfx uses msvcrt.dll.
  15. SFX modules for installers allow to create installation program.
  16. Such module extracts archive to temp folder and then runs specified program and removes
  17. temp files after program finishing. Self-extract archive for installers must be created
  18. as joining 3 files: SFX_Module, Installer_Config, 7z_Archive.
  19. Installer_Config is optional file. You can use the following command to create installer
  20. self-extract archive:
  21. copy /b 7zSD.sfx + config.txt + archive.7z archive.exe
  22. The smallest installation package size can be achieved, if installation files was
  23. uncompressed before including to 7z archive.
  24. -y switch for installer module (at runtime) specifies quiet mode for extracting.
  25. Installer Config file format
  26. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  27. Config file contains commands for Installer. File begins from string
  28. ;!@Install@!UTF-8! and ends with ;!@InstallEnd@!. File must be written
  29. in UTF-8 encoding. File contains string pairs:
  30. ID_String="Value"
  31. ID_String Description
  32. Title Title for messages
  33. BeginPrompt Begin Prompt message
  34. Progress Value can be "yes" or "no". Default value is "yes".
  35. RunProgram Command for executing. Default value is "setup.exe".
  36. Substring %%T will be replaced with path to temporary
  37. folder, where files were extracted
  38. Directory Directory prefix for "RunProgram". Default value is ".\\"
  39. ExecuteFile Name of file for executing
  40. ExecuteParameters Parameters for "ExecuteFile"
  41. You can omit any string pair.
  42. There are two ways to run program: RunProgram and ExecuteFile.
  43. Use RunProgram, if you want to run some program from .7z archive.
  44. Use ExecuteFile, if you want to open some document from .7z archive or
  45. if you want to execute some command from Windows.
  46. If you use RunProgram and if you specify empty directory prefix: Directory="",
  47. the system searches for the executable file in the following sequence:
  48. 1. The directory from which the application (installer) loaded.
  49. 2. The temporary folder, where files were extracted.
  50. 3. The Windows system directory.
  51. Config file Examples
  52. ~~~~~~~~~~~~~~~~~~~~
  53. ;!@Install@!UTF-8!
  54. Title="7-Zip 4.00"
  55. BeginPrompt="Do you want to install the 7-Zip 4.00?"
  56. RunProgram="setup.exe"
  57. ;!@InstallEnd@!
  58. ;!@Install@!UTF-8!
  59. Title="7-Zip 4.00"
  60. BeginPrompt="Do you want to install the 7-Zip 4.00?"
  61. ExecuteFile="7zip.msi"
  62. ;!@InstallEnd@!
  63. ;!@Install@!UTF-8!
  64. Title="7-Zip 4.01 Update"
  65. BeginPrompt="Do you want to install the 7-Zip 4.01 Update?"
  66. ExecuteFile="msiexec.exe"
  67. ExecuteParameters="/i 7zip.msi REINSTALL=ALL REINSTALLMODE=vomus"
  68. ;!@InstallEnd@!
  69. Small SFX modules for installers
  70. --------------------------------
  71. 7zS2.sfx - small SFX module (GUI version)
  72. 7zS2con.sfx - small SFX module (Console version)
  73. Small SFX modules support this codecs: LZMA, LZMA2, BCJ, BCJ2, ARM, COPY
  74. Small SFX module is similar to common SFX module for installers.
  75. The difference (what's new in small version):
  76. - Smaller size (30 KB vs 100 KB)
  77. - C source code instead of �++
  78. - No installer Configuration file
  79. - No extracting progress window
  80. - It decompresses solid 7z blocks (it can be whole 7z archive) to RAM.
  81. So user that calls SFX installer must have free RAM of size of largest
  82. solid 7z block (size of 7z archive at simplest case).
  83. How to use
  84. ----------
  85. copy /b 7zS2.sfx + archive.7z sfx.exe
  86. When you run installer sfx module (sfx.exe)
  87. 1) It creates "7zNNNNNNNN" temp folder in system temp folder.
  88. 2) It extracts .7z archive to that folder
  89. 3) It executes one file from "7zNNNNNNNN" temp folder.
  90. 4) It removes "7zNNNNNNNN" temp folder
  91. You can send parameters to installer, and installer will transfer them to extracted .exe file.
  92. Small SFX uses 3 levels of priorities to select file to execute:
  93. 1) Files in root folder have higher priority than files in subfolders.
  94. 2) File extension priorities (from high to low priority order):
  95. bat, cmd, exe, inf, msi, cab (under Windows CE), html, htm
  96. 3) File name priorities (from high to low priority order):
  97. setup, install, run, start
  98. Windows CE (ARM) version of 7zS2.sfx is included to 7-Zip for Windows Mobile package.
  99. Examples
  100. --------
  101. 1) To create compressed console 7-Zip:
  102. 7zr a c.7z 7z.exe 7z.dll -mx
  103. copy /b 7zS2con.sfx + c.7z 7zCompr.exe
  104. 7zCompr.exe b -md22
  105. 2) To create compressed GUI 7-Zip:
  106. 7zr a g.7z 7zg.exe 7z.dll -mx
  107. copy /b 7zS2.sfx + g.7z 7zgCompr.exe
  108. 7zgCompr.exe b -md22
  109. 3) To open some file:
  110. 7zr a h.7z readme.txt -mx
  111. copy /b 7zS2.sfx + h.7z 7zTxt.exe
  112. 7zTxt.exe