安装所有文件后运行的代码 [英] Code to run after all files are installed
问题描述
复制了[Files]
部分的所有文件后,我需要调用以下小功能
I got the following little function which I need to call after all files of the [Files]
section have been copied
procedure DllAfterInstall(platform: Integer);
begin
if not installDriver(platform) then
MsgBox(ExpandConstant('{cm:installDriverFail}'), mbError, MB_OK);
end;
其中installDriver(platform)
是我的dll之一的外部函数.
where installDriver(platform)
is an external function to one of my dll's.
当我尝试像
Filename: "{code:DllAfterInstall}"; Parameters: 0; Check: not IsWin64
我得到了错误
"DllAfterInstall"的原型无效
Invalid prototype for 'DllAfterInstall'
那么有人可以告诉我我做错了什么吗?也许在复制完所有文件后还有另一种方法调用*.dll
吗? *.dll
函数仅应调用一次,因此AfterInstall
是不可选项.
So can anyone tell me what I'm doing wrong? Or maybe is there another way to call a *.dll
after all files have been copied? The *.dll
function should only be called once so AfterInstall
is no option.
推荐答案
从 CurStepChanged
事件功能(当CurStep
是ssPostInstall
时):
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
Log('Post install');
DllAfterInstall(platform);
end;
end;
您还需要为函数的platform
参数提供实际值.
You also need to provide an actual value to the platform
parameter of the function.
这篇关于安装所有文件后运行的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!