18
在安装程序开始之前,是否可以使用Inno Setup运行文件? Documentation如何在使用Inno Setup进行设置之前运行文件
在安装程序开始之前,是否可以使用Inno Setup运行文件? Documentation如何在使用Inno Setup进行设置之前运行文件
是的。在[code]
部分运行InitializeSetup()
函数中的文件。此示例在安装程序运行之前启动记事本。
function InitializeSetup(): boolean;
var
ResultCode: integer;
begin
// Launch Notepad and wait for it to terminate
if Exec(ExpandConstant('{win}\notepad.exe'), '', '', SW_SHOW,
ewWaitUntilTerminated, ResultCode) then
begin
// handle success if necessary; ResultCode contains the exit code
end
else begin
// handle failure if necessary; ResultCode contains the error code
end;
// Proceed Setup
Result := True;
end;
这就是我需要的!谢谢。 – 2010-08-16 13:42:17
如果它改变用户计算机上的任何内容,则不应在InitializeSetup中完成。这应该在用户按下“安装”后完成,即PrepareToInstall()或CurStepChanged(ssInstall)。 – Deanna 2011-07-25 15:44:13