如何在Inno Setup中的安装和卸载时使用具有依赖关系的DLL?

时间:2012-09-25 11:37:52

标签: dll inno-setup

我想在卸载应用程序时在我的.iss中导入两个dll。我找不到办法做到这一点。 帮助〜

procedure Installed();
external 'Installed@files:StatisticInstallInfo.dll,adcore.dll cdecl  setuponly ';

procedure Uninstalled();
external 'Uninstalled@{app}\StatisticInstallInfo.dll cdecl  uninstallonly';

我想在程序中导入adcore.dll也卸载了。它失败了,如下所示;

[Files]
Source: {#MyDefaultPackDir}\adcore.dll; DestDir: "{app}"; Flags: ignoreversion
Source: {#MyDefaultPackDir}\StatisticInstallInfo.dll; DestDir: "{app}"; Flags: ignoreversion

[Code]
procedure Uninstalled();
external 'Uninstalled@files:StatisticInstallInfo.dll,adcore.dll cdecl  uninstallonly';

它不起作用。

1 个答案:

答案 0 :(得分:4)

当安装程序运行时,Inno可以访问设置的内容,因此可以使用files:file1.dll,file2.dll语法提取所需的任何文件。

在卸载时,Inno不再能够访问设置的内容,因此它需要依赖您在安装时使用普通[Files]条目提取的任何内容。因此,它不再关心依赖关系,而是由你决定。

[Files]
Source: "StatisticInstallInfo.dll"; DestDir: "{app}"
Source: "adcore.dll"; DestDir: "{app}"

[Code]
procedure Installed();
external 'Installed@files:StatisticInstallInfo.dll,adcore.dll cdecl setuponly';

procedure Uninstalled();
external 'Uninstalled@{app}\StatisticInstallInfo.dll cdecl uninstallonly';

根据您调用该功能的时间(如果在安装后),您可以废弃files:...语法,并在两种情况下都使用{app}\StatisticInstallInfo.dll

相关问题