Home » App-V » App-V 5.0 » App-V 5 and Killing Child Processes

App-V 5 and Killing Child Processes

Posted on by

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:

<TerminateChildProcesses>      
    <Application Path="[{AppVPackageRoot}]\VFS\ProgramFilesCommonX86\HealthVISION\EntDistributorService.exe" />         
</TerminateChildProcesses>

And it worked like a charm.

Comments have now been disabled. If you have a question to ask about this post please ask the community!