InnoSetup v6 ARC Extraction, Minimize Broken

339 Views Asked by At

InnoSetup v6 Extracting from a FreeArc 0.67 (March 15 2014) Archive using temporary file unarc.exe, during the extraction process the minimize window button is broken.

Using FreeARC because it's the best compression software I can find to date.

During the archive decompression, the GUI window with the status message can't be minimized. Clicking the window makes windows respond with a deny sound. How do I resolve this?

Something to do with "ProgressPage" or executing the arc command line? Even with this page disabled, it does the same thing, so probably the setup waiting for the process to finish?

I am constantly working on improving and getting this fix because I got files that are in the 100 GB range that need to be compressed to save on disk space. Making a setup program for the extraction process makes it easier to install those files vs relying on the application that I must install first in order to do an extraction.

EDIT: I switch the extraction program from arc.exe to unarc.exe because arc.exe was crashing due to RAM issues.

#define ArcArchive "Test.arc"

[Setup]
AppName=Test App
DefaultDirName=Test App
AppVerName=Test App
WizardStyle=modern
Compression=lzma2
SolidCompression=yes
Uninstallable=no
DisableProgramGroupPage=yes

[Files]
Source: unarc.exe; Flags: dontcopy

[Code]
var
  ProgressPage: TOutputProgressWizardPage;
  ProgressFileName: string;

procedure ExtractArc;
var
  ArcExtracterPath: string;
  ArcArchivePath: string;
  TempPath: string;
  CommandLine: string;
  ResultCode: Integer;
  S: AnsiString;
  Message: string;
begin
  ExtractTemporaryFile('unarc.exe');
  ProgressPage := CreateOutputProgressPage('Decompression', 'Decompressing archive...please wait');
  ProgressPage.Show;
  try
    TempPath := ExpandConstant('{tmp}');
    ArcExtracterPath := TempPath + '\unarc.exe';
    ArcArchivePath := ExpandConstant('{src}\{#ArcArchive}');
    ProgressFileName := ExpandConstant('{tmp}\progress.txt');
    Log(Format('Expecting progress in %s', [ProgressFileName]));
    CommandLine :=
      Format('"%s" x -o+ -dp"%s" "%s" > "%s"', [
        ArcExtracterPath, ExpandConstant('{app}'), ArcArchivePath, ProgressFileName]);
    Log(Format('Executing: %s', [CommandLine]));
    CommandLine := Format('/C "%s"', [CommandLine]);
    if not Exec(ExpandConstant('{cmd}'), CommandLine, '', SW_HIDE,
                ewWaitUntilTerminated, ResultCode) then
    begin
      RaiseException('Cannot start extracter');
    end
      else
    if ResultCode <> 0 then
    begin
      LoadStringFromFile(ProgressFileName, S);
      Message := Format('Arc extraction failed failed with code %d', [ResultCode]);
      Log(Message);
      Log('Output: ' + S);
      RaiseException(Message);
    end
      else
    begin
      Log('Arc extraction done');
    end;
  finally
    { Clean up }
    Log('Arc extraction cleanup');
    ProgressPage.Hide;
    DeleteFile(ProgressFileName);
  end;
  Log('Arc extraction end');
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssPostInstall then
  begin
    ExtractArc;
  end;
end;

0

There are 0 best solutions below