Can not kill process InnoSetup

99封情书 提交于 2021-02-04 21:42:08

问题


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

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