Inno Setup. showing 7z file size and then extraction with progress and files showing

20 views
Skip to first unread message

Ghost G1973

unread,
Aug 1, 2026, 2:38:43 PM (6 days ago) Aug 1
to innosetup
Hi all.
So i've got a setup that works with arc files but cannot get it to show the correct progress, so trying to get it to work with the built in 7zip functions.. 

but just cannot get it to work.. keep getting errors.. 

heres the script:-

[Setup]
AppName={#Game}
AppVerName={#Game}
DefaultDirName={sd}\Games\{#Game}
UsePreviousAppDir=false
DirExistsWarning=auto
ShowLanguageDialog=auto
OutputBaseFilename={#Game}_v{#AppVersion}
OutputDir=.
VersionInfoCopyright=Bitsbb01
SetupIconFile=installer_icon.ico
DisableProgramGroupPage=yes
WizardStyle=modern zircon includetitlebar
ArchiveExtraction=full
SolidCompression=yes


#define GameArchive "*.dat"

[Files]
Source: "{#GameArchive}"; DestDir: "{app}"; Flags: external ignoreversion extractarchive

[Code]
function ExtractionProgressCallback(const ArchiveName, FileName: String; const Progress, ProgressMax: Int64): Boolean;
begin
  // FileName and Progress/ProgressMax provide details for each internal file
  if FileName <> '' then
    WizardForm.StatusLabel.Caption := 'Extracting: ' + FileName;
 
  Result := True; // Return True to continue
end;

function InitializeSetup: Boolean;
begin
  // Map your custom extension (.dat) to act as a .7z archive
  MapArchiveExtensions('.dat', '.7z');
  Result := True;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
  ExtractPage: TExtractionWizardPage;
begin
  if CurStep = ssInstall then
  begin
    // Create custom progress UI page
    ExtractPage := CreateExtractionPage('Extracting Files', 'Please wait while files are extracted.', @ExtractionProgressCallback);
    ExtractPage.Show;
    try
      // Perform the extraction call
      ExtractArchive(ExpandConstant('{app}\{#GameArchive}'), ExpandConstant('{app}'), '', True, @ExtractionProgressCallback);
    finally
      ExtractPage.Hide;
    end;
  end;
end;


and when i do this for installing mods to the userdocs, it works fine... 

#if Defined(modinstall) && (modinstall != "")
Source: "{src}\RA3mods.7z"; DestDir: "{userdocs}\"; Flags: external extractarchive ignoreversion
#endif


i've included the error screen as well..
Any help will be really gratefull.

Bitsy

Screenshot 2026-08-01 131539.png

Martijn Laan - Inno Setup

unread,
Aug 2, 2026, 9:04:00 AM (5 days ago) Aug 2
to innosetup
Hey,

You're confusing different approaches.

ExtractArchive is the lowest level approach. It doesn't show progress automatically.

CreateExtractionPage is the level above that. It shows progress automatically, and to add and extract you should use ExtractPage.Add and ExtractPage.Extract, not ExtractArchive.

The extractarchive flag is the highest level, and usually the recommended level, unless your archive uses solid compression, see the help file.

ArchiveExtraction=full is not necessary to extract a .7z at any level. Use ArchiveExtraction=enhanced/nopassword

SolidCompression=yes in your script does nothing because you're not including any non-external files.

Using DirExistsWarning=auto does not combine with UsePreviousAppDir=false, see the help file.

Greetings,
Martijn

Op 1-8-2026 om 20:17 schreef Ghost G1973:
--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/ae821b2d-972c-4fc4-bce9-52d32e2ee024n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages