在使用Inno Setup进行安装之前如何运行文件 [英] How to run a file before setup with Inno Setup
本文介绍了在使用Inno Setup进行安装之前如何运行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在开始安装之前,是否可以使用Inno Setup运行文件? 文档
Is it possible to run a file with Inno Setup, before the setup beginns? Documentation
推荐答案
是的.在[code]
部分中,运行InitializeSetup()
函数中的文件.此示例在安装程序运行之前启动记事本.
Yes it is. In the [code]
section run the file in the InitializeSetup()
function. This example launches notepad before the setup runs.
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;
这篇关于在使用Inno Setup进行安装之前如何运行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文