Search code examples
wixwindows-installeruninstallationcustom-action

Wix - How to kill any process forcefully through custom action?


I have a created msi and installed it but i am facing an issue during uninstall. I want to close the application forcefully before uninstall through custom action - wix I've searched a lot but didn't find any solution. I want a solution something like that.

<Property Id="QtExecCmdLine" Value='"[SystemFolder]taskkill.exe" /F /IM ConfigurationManager.exe     /t'/> 
<CustomAction Id="StopUserExe" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate"     Return="ignore"/>

<InstallExecuteSequence>
  <Custom Action='StopUserExe' Before='RemoveFiles'></Custom>
</InstallExecuteSequence>

Solution

  • Have you tried Taskkill?

    Example:

    <CustomAction Id="TaskKill" Execute="deferred" ExeCommand="taskkill /f /im notepad.exe" />