I am developing an installer using Wix and need to kill a process (not application) silently during installation so the user doesn't get a pop up asking to kill the process or wait and restart. I have seen solutions for killing an application but not a process.
After some digging around I found this solution which uses the WixUtilExtension Quiet Execution Custom Action http://wix.sourceforge.net/manual-wix3/qtexec.htm:
<InstallExecuteSequence>
<Custom Action='MyProcess.TaskKill' Before='InstallValidate'/>
</InstallExecuteSequence>
<Property Id="QtExecCmdLine"
Value='"[WindowsFolder]\System32\taskkill.exe" /F /IM MyProcess.exe'/>
<CustomAction Id="MyProcess.TaskKill"
BinaryKey="WixCA"
DllEntry="CAQuietExec"
Execute="immediate"
Return="ignore"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="WindowsFolder" Name="WINDOWS"/>
...
I have used the CloseApplication
element to do this, if I understand your needs. The processes I killed don't show as applications in Task Manager. Depends on what process class you're talking about, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With