I need to call custom dll function in CurStepChanged
where CurStep
= ssInstall
.
[Files]
Source: "publish\InnoSetupHelper.dll"; Flags: dontcopy
[Code]
function StopService(ServiceName: String; TimeOut: Integer): Integer;
external 'StopService@InnoSetupHelper.dll cdecl delayload loadwithalteredsearchpath';
procedure CurStepChanged(CurStep: TSetupStep);
var
ErrorCode: Integer;
begin
case CurStep of
ssInstall: begin
ErrorCode := StopService('XxxService', 10000); // line 179
if ErrorCode <> 0 then
MsgBox(FmtMessage('Stop service failed: %1', [ErrorCode]), mbCriticalError, MB_OK);
end;
end;
end;
EXTERN_C_START
__declspec(dllexport) DWORD StopService(PCWSTR serviceName, DWORD waitStopTimeoutMilliseconds);
EXTERN_C_END
I tried delayload
only, loadwithalteredsearchpath
only, no delayload
and loadwithalteredsearchpath
, all not work, either:
or:
files:
prefix in your external
declaration.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.