浏览代码

Fix MapArchiveExtensions crashing if ArchiveExtraction is set to basic.

Martijn Laan 6 天之前
父节点
当前提交
53d4ac45fe
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 1 0
      ISHelp/isxfunc.xml
  2. 2 1
      Projects/Src/Setup.ScriptFunc.pas

+ 1 - 0
ISHelp/isxfunc.xml

@@ -1931,6 +1931,7 @@ end;</pre></example>
         <prototype>procedure MapArchiveExtensions(const DestExt, SourceExt: String);</prototype>
         <description><p>Allows files with a specified destination extension, such as .exe, to be treated as if they have a different source extension, such as .7z, for extraction purposes.</p>
 <p>An exception will be raised if there was an error.</p></description>
+        <remarks><p>Calls to this function are ignored if the <link topic="setup_archiveextraction">ArchiveExtraction</link> [Setup] section directive is set to <tt>basic</tt>.</p></remarks>
         <seealso><p><link topic="isxfunc_ExtractArchive">ExtractArchive</link><br/>
 <link topic="isxfunc_CreateExtractionPage">CreateExtractionPage</link></p></seealso>
         <example><pre>

+ 2 - 1
Projects/Src/Setup.ScriptFunc.pas

@@ -1852,7 +1852,8 @@ var
     end);
     RegisterScriptFunc('MapArchiveExtensions', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
-      MapArchiveExtensions(Stack.GetString(PStart), Stack.GetString(PStart-1));
+      if SetupHeader.SevenZipLibraryName <> '' then
+        MapArchiveExtensions(Stack.GetString(PStart), Stack.GetString(PStart-1));
     end);
     RegisterScriptFunc('DEBUGGING', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin