在Inno Setup中,如何在安装和卸载时使用具有依赖性的DLL? [英] How to use DLLs with dependencies at install AND uninstall time in Inno Setup?
问题描述
我想在卸载应用程序时在我的.iss文件中导入两个dll.我找不到解决办法. 帮忙〜
I want to import two dlls in my .iss when uninstalled the app. I cannot find a way to do this. help~
procedure Installed();
external 'Installed@files:StatisticInstallInfo.dll,adcore.dll cdecl setuponly ';
procedure Uninstalled();
external 'Uninstalled@{app}\StatisticInstallInfo.dll cdecl uninstallonly';
我也想在过程Uninstalled中导入adcore.dll,但失败,如下所示;
I want import adcore.dll in procedure Uninstalled too.and it's failed as below shows;
[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';
它不起作用.
推荐答案
运行安装程序时,Inno可以访问安装程序的内容,因此可以使用files:file1.dll,file2.dll
语法提取所需的任何文件.
When the installer is running, Inno has access to the contents of the setup, and so can extract any files needed using the files:file1.dll,file2.dll
syntax.
在卸载时,Inno不再具有访问安装程序内容的权限,因此它需要依赖您在安装时使用常规[Files]
条目提取的任何内容.因此,它不再关心依赖项,而是由您自己决定.
At uninstall time, Inno no longer as access to the contents of the setup so it needs to rely on anything you extracted at install time using a normal [Files]
entry. Because of this, it no longer cares about the dependencies and leaves that up to you.
[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
.
Depending on when you call that function (if after the install itself) you can scrap the files:...
syntax and just use {app}\StatisticInstallInfo.dll
in both cases.
这篇关于在Inno Setup中,如何在安装和卸载时使用具有依赖性的DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!