Skip to content

Commit

Permalink
Remove auto-search for disk slices in "..\DISKx".
Browse files Browse the repository at this point in the history
Secretly searching for a missing file in another directory just doesn't align with modern best practices.
  • Loading branch information
jordanrussell authored Dec 31, 2024
1 parent c3cc40f commit 03b5a4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Projects/Src/Setup.FileExtractor.pas
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ procedure TFileExtractor.SetCryptKey(const Value: TSetupEncryptionKey);
class function TFileExtractor.FindSliceFilename(const ASlice: Integer): String;
var
Major, Minor: Integer;
Prefix, F1, F2, Path: String;
Prefix, F1, Path: String;
begin
Prefix := PathChangeExt(PathExtractName(SetupLdrOriginalFilename), '');
Major := ASlice div SetupHeader.SlicesPerDisk + 1;
Expand All @@ -123,21 +123,14 @@ class function TFileExtractor.FindSliceFilename(const ASlice: Integer): String;
F1 := Format('%s-%d.bin', [Prefix, Major])
else
F1 := Format('%s-%d%s.bin', [Prefix, Major, Chr(Ord('a') + Minor)]);
F2 := Format('..\DISK%d\', [Major]) + F1;
if LastSourceDir <> '' then begin
Result := AddBackslash(LastSourceDir) + F1;
if NewFileExists(Result) then Exit;
end;
Result := AddBackslash(SourceDir) + F1;
if NewFileExists(Result) then Exit;
if LastSourceDir <> '' then begin
Result := PathExpand(AddBackslash(LastSourceDir) + F2);
if NewFileExists(Result) then Exit;
end;
Result := PathExpand(AddBackslash(SourceDir) + F2);
if NewFileExists(Result) then Exit;
Path := SourceDir;
LogFmt('Asking user for new disk containing "%s".', [F1]);
LogFmt('Asking user for new disk containing "%s".', [F1]);
if SelectDisk(Major, F1, Path) then begin
LastSourceDir := Path;
Result := AddBackslash(Path) + F1;
Expand Down
1 change: 1 addition & 0 deletions whatsnew.htm
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
<li>Replaced all remaining use of MD5 and SHA-1 hashes with SHA-256 hashes, without removing the MD5 and SHA-1 Pascal Scripting and ISPP support functions.</li>
<li>At long last, Setup's wizard window now shows a thumbnail image on its taskbar button, and animates correctly when minimized and restored. As part of this work, support for the long-deprecated <tt>[Setup]</tt> section directive <tt>WindowVisible</tt>, which was used to enable a 1990s-style blue gradient background behind the wizard window, has been dropped.</li>
<li>The aspect ratio of Setup's large and small wizard images (as specified by <tt>WizardImageFile</tt> and <tt>WizardSmallImageFile</tt>) is now maintained when the window is scaled. Previously, depending on the font and font size used, they could have appeared horizontally stretched or squished.</li>
<li>When disk spanning is enabled and Setup cannot find the needed disk slice file (e.g., <tt>setup-2.bin</tt>) in the source directory, it no longer automatically searches for it in a directory named <tt>DISKx</tt> one level up, where <tt>x</tt> is the disk number. Though consistent with old installers from the 16-bit era, this behavior wasn't documented.</li>
<li>The New Script Wizard now sets <tt>UninstallDisplayIcon</tt> when an .exe is chosen as the main executable file.</li>
<li>Merged the Inno Setup Preprocessor documentation into the main documentation instead of being separate.</li>
<li>Added a dark mode version of the documentation, automatically used by the Compiler IDE if a dark theme is chosen.</li>
Expand Down

0 comments on commit 03b5a4c

Please sign in to comment.