Why can't I import the dll that has a dependency and call a function from it on Uninstall in Inno Setup?

我与影子孤独终老i 提交于 2020-08-19 10:54:07

问题


Here's the code:

[Files]
Source: "IsStartServer.dll"; DestDir: "{app}"
Source: "sqlite3x86.dll"; DestDir: "{app}"

[Code]
function O4TaskMngrSvcStopAndUninstall: LongBool;
external 'CheckO4TaskMngrSvcStopAndUninstall@{app}\IsStartServer.dll,{app}\sqlite3x86.dll stdcall loadwithalteredsearchpath uninstallonly';

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then
    begin
      O4TaskMngrSvcStopAndUninstall();
      UnloadDLL(ExpandConstant('{app}\IsStartServer.dll'));
      UnloadDLL(ExpandConstant('{app}\sqlite3x86.dll'));
    end;
end;

I wasn't really sure about the syntax here: {app}\IsStartServer.dll,{app}\sqlite3x86.dll in the external, so I tried {app}\IsStartServer.dll,sqlite3x86.dll as well but it didn't work.

When I run the uninstall I get this error:

This happens only for uninstall. For install it runs completely fine.

What may cause the aforementioned problem?

来源:https://stackoverflow.com/questions/63372534/why-cant-i-import-the-dll-that-has-a-dependency-and-call-a-function-from-it-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!