安装所有文件后运行的代码 [英] Code to run after all files are installed

查看:67
本文介绍了安装所有文件后运行的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

复制了[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事件功能(当CurStepssPostInstall时):

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆