App-V 5 and Killing Child Processes

I recently packaged an application that, upon launch, started a background service called EntDistributorService.exe.

EntDistributorService.exe spawned a child process called hvced.exe (I knew hvced.exe was a child process by running the wmic command found here.), which remained running when the launched application was closed.

When a process contained within the App-V package remains open, it presents issues when we need to unpublish it – the App-V package can’t be unpublished if it is still deemed as being in a ‘running’ state!

I tried a couple of ways to kill hvced.exe via some scripting (I tried taskkill.exe and Powershell’s Stop-Process) via both the ExitProcess and TerminateVirtualEnvironment execution times (in the UserConfig.xml).  Unfortunately the context that these scripts run in didn’t have enough permissions to kill the process, since EntDistributorService.exe was launched in a SYSTEM context and as a result hvced.exe was also running in a SYSTEM context.

After all this fiddling around, it turned out that the solution was quite simple really.  In the DeploymentConfig.xml file we can simply add the file who’s child processes we want to terminate like so:

And it worked like a charm.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.