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