我使用Inno设置来制作游戏安装程序,但我发现了一些问题。
当我运行'Setup_1.0.121.exe‘,它将需要大约6分钟前,第一个屏幕出现。我的设置总容量为4.76GB,这是文件列表
我试着深入找出procexp的初始过程,然后发现
我的Setup_1.0.121.exe在初始阶段读取每个字节。所以花了这么长时间。
我的嫌疑犯是我加的装饰品。
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('Office2007.cjstyles');
LoadSkin(ExpandConstant('{tmp}\Office2007.cjstyles'), '');
Result := True;
end; 我该如何解决这个问题?
发布于 2014-04-18 05:40:49
如果您使用的是SolidCompression (我假设您使用了),并且在[Files]部分中的大文件之后列出了任何临时文件(ISSkin.dll和/或Office2007.cjstyles),那么初始化需要很长时间,因为安装程序正在提取这些临时文件之前列出的所有文件。
这可能是由ISSkin.dll库引起的,该库由脚本引擎(如果没有使用delayload标志)提取以供加载,或者由ExtractTemporaryFile函数手动提取Office2007.cjstyles皮肤文件。这个函数的引用中甚至有警告:
启用固态压缩时,请确保在“文件”部分顶部(或附近)列出临时文件。为了在实体压缩安装中提取任意文件,安装程序必须首先解压缩所有以前的文件(到内存中的临时缓冲区)。如果在“文件”部分的指定文件前面列出了许多其他文件,则这可能导致大量延迟。
如果我的假设是正确的,并且您启用了这些大型数据文件下面列出的SolidCompression和临时文件,那么我们可以将您的脚本重构为如下所示:
[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
...如果你仔细阅读这篇文章,你已经知道答案在引用的引用中。您所需要做的就是列出[Files]部分顶部的所有临时文件,以避免解压缩大型文件。因此,上面的脚本将变成:
[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}"
...https://stackoverflow.com/questions/23147268
复制相似问题