问题
I want to import two dlls in my .iss when uninstalled the app. I cannot find a way to do this.
procedure Installed();
external 'Installed@files:StatisticInstallInfo.dll,adcore.dll cdecl setuponly ';
procedure Uninstalled();
external 'Uninstalled@{app}\StatisticInstallInfo.dll cdecl uninstallonly';
I want import adcore.dll
in procedure Uninstalled
too. And it's failed as below shows;
[Files]
Source: {#MyDefaultPackDir}\adcore.dll; DestDir: "{app}"
Source: {#MyDefaultPackDir}\StatisticInstallInfo.dll; DestDir: "{app}"
[Code]
procedure Uninstalled();
external 'Uninstalled@files:StatisticInstallInfo.dll,adcore.dll cdecl uninstallonly';
It does not work.
Installed()
and Uninstalled()
are in the StatisticInstallInfo.dll
, which depends on adcore.dll
.
回答1:
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.
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';
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.
来源:https://stackoverflow.com/questions/12582153/how-to-use-dlls-with-dependencies-at-install-and-uninstall-time-in-inno-setup