Вопрос

I using Inno Setup for making game installer but I found some problem.

when I run 'Setup_1.0.121.exe' and it will take around 6 minute before first screen appear. My setup total size is 4.76GB and this is file list

  • Setup_1.0.121.exe : 623,863 bytes
  • Setup_1.0.121-1a.bin : 1,707,575,872 bytes
  • Setup_1.0.121-1b.bin : 1,708,200,000 bytes
  • Setup_1.0.121-1c.bin : 1,697,243,193 bytes

I try to look in deep for find out, what's going on initial process with procexp and found this

  • Setup_1.0.121.tmp : I/O Read Bytes 5,085,307,002 : I/O Write Bytes 1,061,076

my Setup_1.0.121.exe read every byte in initial stage. that's why it take so long.

My suspect is addon 'Isskin' I just add for decorate.

function InitializeSetup(): Boolean;
    begin
      ExtractTemporaryFile('Office2007.cjstyles');
      LoadSkin(ExpandConstant('{tmp}\Office2007.cjstyles'), '');
      Result := True;
    end; 

how can I solve this problem?

Это было полезно?

Решение

If you are using SolidCompression (which I assume you do), and you listed any of the temporary files (ISSkin.dll and/or Office2007.cjstyles) after those big files in the [Files] section, then the initialization takes so long, because the installer is extracting all the files listed prior those temporary files.

That might be caused by the ISSkin.dll library, which is extracted for loading by the scripting engine (if you didn't use delayload flag), or by manual extracting of the Office2007.cjstyles skin file by the ExtractTemporaryFile function. There's even warning in the reference for this function:

When solid compression is enabled, be sure to list your temporary files at (or near) the top of the [Files] section. In order to extract an arbitrary file in a solid-compressed installation, Setup must first decompress all prior files (to a temporary buffer in memory). This can result in a substantial delay if a number of other files are listed above the specified file in the [Files] section.

If I was right with my assumptions and you have enabled SolidCompression and temporary files listed below those huge data files, then we can reconstruct your script to something like this:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
SolidCompression=yes

[Files]
; first are listed huge files
Source: "Setup_1.0.121.exe"; DestDir: "{app}"
Source: "Setup_1.0.121-1a.bin"; DestDir: "{app}"
Source: "Setup_1.0.121-1b.bin"; DestDir: "{app}"
Source: "Setup_1.0.121-1c.bin"; DestDir: "{app}"
; if SolidCompression is enabled, all the prior files are extracted
; when any of the the following files is extracted
Source: "ISSkin.dll"; DestDir: "{tmp}"; Flags: dontcopy
Source: "Office2007.cjstyles"; DestDir: "{tmp}"; Flags: dontcopy
...

If you read this post carefully, you already know that the answer was in the quote from the reference. All you need to do is list all the temporary files on top of the [Files] section to avoid decompressing the huge ones. So the above script would become:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
SolidCompression=yes

[Files]
; first are listed temporary files
Source: "ISSkin.dll"; DestDir: "{tmp}"; Flags: dontcopy
Source: "Office2007.cjstyles"; DestDir: "{tmp}"; Flags: dontcopy
; the huge files are now extracted just when they are needed
Source: "Setup_1.0.121.exe"; DestDir: "{app}"
Source: "Setup_1.0.121-1a.bin"; DestDir: "{app}"
Source: "Setup_1.0.121-1b.bin"; DestDir: "{app}"
Source: "Setup_1.0.121-1c.bin"; DestDir: "{app}"
...
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top