【发布时间】:2011-03-30 10:27:09
【问题描述】:
是否可以在设置开始之前使用 Inno Setup 运行文件? Documentation
【问题讨论】:
是否可以在设置开始之前使用 Inno Setup 运行文件? Documentation
【问题讨论】:
是的。在[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;
【讨论】: