1

InnoSetup v6 使用临时文件 unarc.exe 从 FreeArc 0.67(2014 年 3 月 15 日)存档中提取,在提取过程中,最小化窗口按钮损坏。

使用 FreeARC,因为它是迄今为止我能找到的最好的压缩软件。

在存档解压缩过程中,无法最小化带有状态消息的 GUI 窗口。单击窗口会使窗口以拒绝声音响应。我该如何解决这个问题?

与“ProgressPage”或执行 arc 命令行有关?即使禁用此页面,它也会做同样的事情,所以可能是设置等待进程完成?

我一直在努力改进和修复这个问题,因为我得到了需要压缩以节省磁盘空间的 100 GB 范围内的文件。为提取过程制作安装程序可以更轻松地安装这些文件,而不是依赖我必须首先安装的应用程序才能进行提取。

编辑:我将提取程序从 arc.exe 切换到 unarc.exe,因为 arc.exe 由于 RAM 问题而崩溃。

#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;

4

0 回答 0