安装所有文件后代码 运行
Code to run after all files are installed
我得到了下面的小函数,在 [Files]
部分的所有文件都被复制后我需要调用它
procedure DllAfterInstall(platform: Integer);
begin
if not installDriver(platform) then
MsgBox(ExpandConstant('{cm:installDriverFail}'), mbError, MB_OK);
end;
其中 installDriver(platform)
是我的一个 dll 的外部函数。
一旦我尝试调用 [Run]
部分中的 DllAfterInstall
函数,例如
Filename: "{code:DllAfterInstall}"; Parameters: 0; Check: not IsWin64
我收到错误消息
Invalid prototype for 'DllAfterInstall'
所以谁能告诉我我做错了什么?或者在所有文件都被复制后,还有另一种调用 *.dll
的方法吗? *.dll
函数只应调用一次,因此 AfterInstall
不是选项。
当 CurStep
为 ssPostInstall
时,从 CurStepChanged
event function 调用您的代码:
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
Log('Post install');
DllAfterInstall(platform);
end;
end;
您还需要为函数的 platform
参数提供实际值。
我得到了下面的小函数,在 [Files]
部分的所有文件都被复制后我需要调用它
procedure DllAfterInstall(platform: Integer);
begin
if not installDriver(platform) then
MsgBox(ExpandConstant('{cm:installDriverFail}'), mbError, MB_OK);
end;
其中 installDriver(platform)
是我的一个 dll 的外部函数。
一旦我尝试调用 [Run]
部分中的 DllAfterInstall
函数,例如
Filename: "{code:DllAfterInstall}"; Parameters: 0; Check: not IsWin64
我收到错误消息
Invalid prototype for 'DllAfterInstall'
所以谁能告诉我我做错了什么?或者在所有文件都被复制后,还有另一种调用 *.dll
的方法吗? *.dll
函数只应调用一次,因此 AfterInstall
不是选项。
当 CurStep
为 ssPostInstall
时,从 CurStepChanged
event function 调用您的代码:
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
Log('Post install');
DllAfterInstall(platform);
end;
end;
您还需要为函数的 platform
参数提供实际值。