Explorar el Código

Allowing version comparison together with externalarchive doesn't make sense / doesn't work: Setup will always consider the existing file newer and either skip installation or do promptifolder handling, both unwanted. Also mini tweak to help.

Martijn Laan hace 3 meses
padre
commit
1b8ef36c6b

+ 2 - 2
ISHelp/isetup.xml

@@ -1708,9 +1708,9 @@ Instructs Setup to proceed to comparing time stamps (last write/modified time) i
 </flag>
 <flag name="extractarchive">
 <p>...</p>
-<p>Using a solid archive is not recommended; extraction performance may degrade depending on the solid block size.</p>
-<p>This flag must be combined with <tt>external</tt>.</p>
+<p>This flag must be combined with the <tt>external</tt> and <tt>ignoreversion</tt> flags, meaning it should only be used on files private to your application, <i>never</i> on shared system files.</p>
 <p>This flag is usually combined with the <tt>recursesubdirs</tt> and <tt>createallsubdirs</tt> flags.</p>
+<p>Using a solid archive is not recommended; extraction performance may degrade depending on the solid block size.</p>
 </flag>
 <flag name="fontisnttruetype">
 <p>Specify this flag if the entry is installing a <i>non-TrueType</i> font with the <tt>FontInstall</tt> parameter.</p>

+ 2 - 0
Projects/Src/Compiler.SetupCompiler.pas

@@ -5432,6 +5432,8 @@ begin
         if foExtractArchive in Options then begin
           if not ExternalFile then
             AbortCompileFmt(SCompilerParamFlagMissing, ['external', 'extractarchive'])
+          else if not(foIgnoreVersion in Options) then
+            AbortCompileFmt(SCompilerParamFlagMissing, ['ignoreversion', 'extractarchive'])
           else if SetupHeader.SevenZipLibraryName = '' then
             AbortCompileFmt(SCompilerEntryValueUnsupported, ['Setup', 'ArchiveExtraction', 'basic', 'extractarchive']);
         end;

+ 3 - 2
Projects/Src/Setup.Install.pas

@@ -1271,14 +1271,15 @@ var
           if not(foIgnoreVersion in CurFile^.Options) then begin
             AllowTimeStampComparison := False;
             { Read version info of file being installed }
+            if foExtractArchive in CurFile^.Options then
+              InternalError('Unexpected extractarchive flag');
             if Assigned(CurFileLocation) then begin
               CurFileVersionInfoValid := floVersionInfoValid in CurFileLocation^.Flags;
               CurFileVersionInfo.MS := CurFileLocation^.FileVersionMS;
               CurFileVersionInfo.LS := CurFileLocation^.FileVersionLS;
             end
             else
-              CurFileVersionInfoValid := not(foExtractArchive in CurFile^.Options) and
-                GetVersionNumbersRedir(DisableFsRedir,
+              CurFileVersionInfoValid := GetVersionNumbersRedir(DisableFsRedir,
                   PathExpand(AExternalSourceFile), CurFileVersionInfo);
             if CurFileVersionInfoValid then
               LogFmt('Version of our file: %u.%u.%u.%u',

+ 2 - 2
whatsnew.htm

@@ -127,7 +127,7 @@ issigtool --key-file="MyKey.ispublickey" verify "MyProg.dll"</pre>
     <li>Added new <tt>[Files]</tt> section flag <tt>extractarchive</tt> and parameter <tt>ExtractArchivePassword</tt>, intended to enable the seamless integration and extraction of downloaded archives.
       <ul>
         <li>The supported archive formats, beyond .7z, and the support for password-protected archives, depend on the aforementioned <tt>ArchiveExtraction</tt> directive, that must not be set to <tt>basic</tt>.</li>
-        <li>Flags <tt>extractarchive</tt> must be combined with flag <tt>external</tt> and is usually combined with the <tt>recursesubdirs</tt> and <tt>createallsubdirs</tt> flags.</li>
+        <li>Flag <tt>extractarchive</tt> must be combined with the <tt>external</tt> and <tt>ignoreversion</tt> flags. It is usually also combined with the <tt>recursesubdirs</tt> and <tt>createallsubdirs</tt> flags.</li>
         <li>Using a solid archive is not recommended; extraction performance may degrade depending on the solid block size.</li>
         <li>Archive extraction otherwise behaves the same as external file copying. For example, it supports automatic uninstallation of extracted files and can be combined with all other flags and parameters.</li>
         <li>Example script:
@@ -135,7 +135,7 @@ issigtool --key-file="MyKey.ispublickey" verify "MyProg.dll"</pre>
 ArchiveExtraction=enhanced/nopassword
 
 [Files]
-Source: "{tmp}\MyProg-ExtraReadmes.7z"; DestDir: "{app}"; Flags: external extractarchive recursesubdirs createallsubdirs</pre>
+Source: "{tmp}\MyProg-ExtraReadmes.7z"; DestDir: "{app}"; Flags: external extractarchive recursesubdirs createallsubdirs ignoreversion</pre>
         </li>
       </ul>
     </li>