Browse Source

Update docs. Todo: whatsnew.

Martijn Laan 3 months ago
parent
commit
054990836c
2 changed files with 49 additions and 24 deletions
  1. 41 1
      ISHelp/isetup.xml
  2. 8 23
      ISHelp/isxfunc.xml

+ 41 - 1
ISHelp/isetup.xml

@@ -134,7 +134,7 @@ Inno Setup is a <i>free</i> installer for Windows programs by Jordan Russell and
 <li>Complete <link topic="setup_uninstallable">uninstall</link> capabilities.</li>
 
 <li>Installation of <link topic="filessection">files</link>:<br/>
-Includes integrated support for "deflate", bzip2, and 7-Zip LZMA/LZMA2 file <link topic="setup_compression">compression</link>. The installer has the ability to compare file version info, replace in-use files, use shared file counting, register DLL/OCX's and type libraries, and install fonts.</li>
+Includes integrated support for "deflate", bzip2, and 7-Zip LZMA/LZMA2 file <link topic="setup_compression">compression</link>. The installer has the ability to compare file version info, replace in-use files, use shared file counting, register DLL/OCX's and type libraries, install fonts, download files, and extract archives.</li>
 
 <li>Creation of <link topic="iconssection">shortcuts</link> anywhere, including in the Start Menu and on the desktop.</li>
 
@@ -1066,6 +1066,7 @@ DefaultGroupName=My Program
 <li><link topic="setup_appversion"><b>AppVersion</b></link></li>
 <li><link topic="setup_architecturesallowed">ArchitecturesAllowed</link></li>
 <li><link topic="setup_architecturesinstallin64bitmode">ArchitecturesInstallIn64BitMode</link></li>
+<li><link topic="setup_archiveextraction">ArchiveExtraction</link></li>
 <li><link topic="setup_changesassociations">ChangesAssociations</link></li>
 <li><link topic="setup_changesenvironment">ChangesEnvironment</link></li>
 <li><link topic="setup_closeapplications">CloseApplications</link></li>
@@ -4717,6 +4718,45 @@ Name: portablemode; Description: "Portable Mode"</pre></example>
 </body>
 </setuptopic>
 
+<setuptopic directive="ArchiveExtraction">
+<keyword value=".7z" />
+<keyword value=".zip" />
+<setupvalid><tt>basic</tt><br/>
+<tt>enhanced/nopassword</tt><br/>
+<tt>enhanced</tt><br/>
+<tt>full</tt></setupvalid>
+<setupdefault><tt>basic</tt></setupdefault>
+<body>
+<p>This specifies the method of archive extraction.</p>
+<p><tt>basic</tt> uses an embedded version of the "7z ANSI-C Decoder" from the LZMA SDK by Igor Pavlov, as-is, except that Unicode support and error messages were improved and that it outputs memory requirements. It only supports .7z archives that are not password-protected.</p>
+<p><tt>enhanced/nopassword</tt> uses 7zxr.dll from the 7-Zip source code by Igor Pavlov, as-is, except that it was recompiled and code-signed. Compared to basic, it has lower memory requirements for archives that contain large files but increases the size of the Setup file(s). It still only supports .7z archives that are not password-protected.</p>
+<p><tt>enhanced</tt> uses 7zxa.dll instead of 7zxr.dll, recompiled and code-signed. It still only supports .7z archives, but they may be password-protected.</p>
+<p><tt>full</tt> uses 7z.dll instead of 7zxa.dll, recompiled and code-signed. It supports many archive formats.</p>
+<p>The following table summarizes the differences between these methods</p>
+<indent>
+<table>
+<tr><td></td><td><u>Memory Requirements</u></td><td><u>Password-protected Archives</u></td><td><u>Setup Size Increase</u></td><td><u>Archive Formats</u></td></tr>
+<tr><td><tt>basic</tt> (default)</td><td>High for large files*</td><td>No</td><td>0 KB</td><td>.7z</td></tr>
+<tr><td><tt>enhanced/nopassword</tt></td><td>Normal</td><td>No</td><td>101 KB</td><td>.7z</td></tr>
+<tr><td><tt>enhanced</tt></td><td>Normal</td><td>Yes</td><td>124 KB</td><td>.7z</td></tr>
+<tr><td><tt>full</tt></td><td>Normal</td><td>Yes</td><td>614 KB</td><td>.7z, .zip, .bzip2, .rar, .cab, .lzma, .xz, .wim, .iso, .rpm, .deb, .tar, .gzip</td></tr>
+</table>
+<p>* = When extracting a file, at least enough memory will always be allocated to hold the <b>entire</b> file, regardless of the block size. For example, extracting a 1 GB file using the <tt>basic</tt> method requires at least 1 GB of RAM. Consider using a different method for archives that contain large files: their memory requirements depend on the dictionary size only.</p>
+</indent>
+<p>The <tt>basic</tt> method has the following additional limitations, as written by Igor Pavlov in the LZMA SDK:</p>
+<ul>
+<li>It reads only &quot;FileName&quot;, &quot;Size&quot;, &quot;LastWriteTime&quot; and &quot;CRC&quot; information for each file in archive.</li>
+<li>It does not support PPMd and BZip2 methods.</li>
+<li>It converts original UTF-16 Unicode file names to UTF-8 Unicode file names.</li>
+<li>It decodes whole solid block from 7z archive to RAM. The RAM consumption can be high.</li>
+</ul>
+<p><b>See also:</b><br/>
+<link topic="isxfunc_ExtractArchive">ExtractArchive</link><br/>
+<link topic="isxfunc_CreateExtractionPage">CreateExtractionPage</link>
+</p>
+</body>
+</setuptopic>
+
 <setuptopic directive="Compression">
 <keyword value="zip" />
 <keyword value="bzip" />

+ 8 - 23
ISHelp/isxfunc.xml

@@ -1830,7 +1830,7 @@ end;</pre></example>
 <link topic="isxfunc_DownloadTemporaryFileDate">DownloadTemporaryFileDate</link><br />
 <link topic="isxfunc_CreateDownloadPage">CreateDownloadPage</link><br />
 <link topic="isxfunc_ExtractTemporaryFile">ExtractTemporaryFile</link><br />
-<link topic="isxfunc_Extract7ZipArchive">Extract7ZipArchive</link></p></seealso>
+<link topic="isxfunc_ExtractArchive">ExtractArchive</link></p></seealso>
         <example><pre>
 [Code]
 function OnDownloadProgress(const Url, Filename: String; const Progress, ProgressMax: Int64): Boolean;
@@ -1876,30 +1876,15 @@ end;</pre>
 <p>See <link topic="isxfunc_DownloadTemporaryFile">DownloadTemporaryFile</link> for other considerations.</p></description>
       </function>
       <function>
-        <name>Extract7ZipArchive</name>
-        <prototype>procedure Extract7ZipArchive(const ArchiveFileName, DestDir: String; const FullPaths: Boolean; const OnExtractionProgress: TOnExtractionProgress);</prototype>
-        <description><p>Extracts the specified 7-Zip archive to the specified directory, with or without using path names.</p>
+        <name>ExtractArchive</name>
+        <prototype>procedure ExtractArchive(const ArchiveFileName, DestDir, Password: String; const FullPaths: Boolean; const OnExtractionProgress: TOnExtractionProgress);</prototype>
+        <description><p>Extracts the specified archive to the specified directory, with or without using path names.</p>
 <p>An exception will be raised if there was an error.</p>
-<p>The archive must not be encrypted.</p>
+<p>The supported archive formats, beyond .7z, and the support for password-protected archives, depend on the <link topic="setup_archiveextraction">ArchiveExtraction</link> [Setup] section directive.</p>
 <p>Set OnExtractionProgress to a function to be informed of progress, or <tt>nil</tt> otherwise.</p></description>
         <remarks><p>TOnExtractionProgress is defined as:</p>
 <p><tt>TOnExtractionProgress = function(const ArchiveName, FileName: String; const Progress, ProgressMax: Int64): Boolean;</tt></p>
-<p>Return True to allow the extraction to continue, False otherwise.</p>
-<p><tt>Extract7ZipArchive</tt> uses an embedded version of the &quot;7z ANSI-C Decoder&quot; from the LZMA SDK by Igor Pavlov, as-is, except that Unicode support and error messages were improved and that it outputs memory requirements.</p>
-<p>All output of the decoder is logged if logging is enabled, including error messages but excluding empty lines.</p></remarks>
-        <limitations><p>The decoder has the following limitations, as written by Igor Pavlov in the LZMA SDK:</p>
-<ul>
-<li>It reads only &quot;FileName&quot;, &quot;Size&quot;, &quot;LastWriteTime&quot; and &quot;CRC&quot; information for each file in archive.</li>
-<li>It does not support PPMd and BZip2 methods.</li>
-<li>It converts original UTF-16 Unicode file names to UTF-8 Unicode file names.</li>
-<li>It decodes whole solid block from 7z archive to RAM. The RAM consumption can be high.</li>
-</ul>
-<p>To expand on his comments about RAM consumption: When extracting a file, at least enough memory will always be allocated to hold the <b>entire</b> file, regardless of the block size. For example, extracting a 1 GB file using <tt>Extract7ZipArchive</tt> requires at least 1 GB of RAM. Consider using a different solution for extracting large files, such as embedding 7-Zip itself, which does not use as much RAM, into your installation.</p>
-<p>Additionally he wrote:</p>
-<ul>
-<li>You can create .7z archive with 7z.exe, 7za.exe or 7zr.exe:<br />
-<tt>7z.exe a archive.7z *.htm -r -mx -m0fb=255</tt></li>
-</ul></limitations>
+<p>Return True to allow the extraction to continue, False otherwise.</p></remarks>
         <seealso><p><link topic="isxfunc_CreateExtractionPage">CreateExtractionPage</link><br />
 <link topic="isxfunc_CreateDownloadPage">CreateDownloadPage</link><br />
 <link topic="isxfunc_DownloadTemporaryFile">DownloadTemporaryFile</link><br />
@@ -2711,10 +2696,10 @@ Page := CreateOutputMsgMemoPage(wpWelcome,
 <p>To add a new archive to extract, call the <tt>Add</tt> method. Always call the <tt>Clear</tt> method before adding the first file.</p>
 <p>To start the extraction, call the <tt>Extract</tt> method. An exception will be raised if there was an error. Otherwise, <tt>Extract</tt> returns the number of archives extracted.</p>
 <p>Set the <tt>ShowArchiveInsteadFile</tt> property to <tt>True</tt> to show the name of the archive which is being extracted to the user instead of the names of the files inside the archive.</p>
-<p>See <link topic="isxfunc_Extract7ZipArchive">Extract7ZipArchive</link> for other considerations and the definition of <tt>TOnExtractionProgress</tt>.</p></remarks>
+<p>See <link topic="isxfunc_ExtractArchive">ExtractArchive</link> for other considerations and the definition of <tt>TOnExtractionProgress</tt>.</p></remarks>
         <example><p>See <i>CodeDownloadFiles2.iss</i> for an example.</p></example>
         <seealso><p><link topic="scriptclasses" anchor="TExtractionWizardPage">TExtractionWizardPage</link><br />
-<link topic="isxfunc_Extract7ZipArchive">Extract7ZipArchive</link><br />
+<link topic="isxfunc_ExtractArchive">ExtractArchive</link><br />
 <link topic="isxfunc_CreateOutputProgressPage">CreateOutputProgressPage</link></p></seealso>
       </function>
       <function>