问题
Trying to kill process via InnoSetup installer. But it still shows an error that the processes are running.
I use this.
[Files]
Source: Files\CefSharp.BrowserSubprocess.exe; DestDir: {app}; Flags: overwritereadonly ignoreversion uninsremovereadonly; BeforeInstall: TaskKill('CefSharp.BrowserSubprocess.exe')
[Code]
procedure TaskKill(fileName: String);
var
ResultCode: Integer;
begin
Exec(ExpandConstant('{sys}/taskkill.exe'), '/f /im ' + '"' + fileName + '"', ExpandConstant('{sys}'), SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
or
[Code]
procedure TaskKill(fileName: String);
var
ResultCode: Integer;
begin
Exec(ExpandConstant('taskkill.exe'), '/f /im ' + '"' + fileName + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
Please help
来源:https://stackoverflow.com/questions/62143026/can-not-kill-process-innosetup