none
TerminateChildProcess and the Deployment Configuration File RRS feed

  • Question

  • Hi,

    We have many virtualized Excel Add-ins in our estate.  Excel is not virtualized but gets brought into the bubble using the RunVirual Key.  When Excel terminates it leaves orphaned Add-ins.  If Excel is not virtualized is there,  how can I get it to invoke a TerminateChildProcess?

    Kind Regards,

    Nigel

    Monday, February 25, 2019 2:13 PM

All replies

  • One solution would be to create a scheduled task on your computers that you publish with one of your excel addin packages as a script.
     - One option may be to have it run on an interval, perhaps every 15 minutes, and on the Settings tab, configure "If the task is already running" for "Do not start a new instance". That way you can ensure it would be no longer than 15 minutes if it stops running. 

    - Next make a simple script that terminate the plugin since you know excel is not running, something like the example batch script.

    ::Change the name of notepad.exe to the process .exe that you're trying to track
    ::Process names are CASE SENSITIVE, so notepad.exe works but Notepad.exe does NOT
    ::Do not change IMAGENAME
    ::You can Copy and Paste this into an empty batch file and change the name of
    ::notepad.exe to the process you'd like to track
    ::Also, some large programs take a while to no longer show as not running, so
    ::give this batch a few seconds timer to avoid a false result!!
    
    @echo off
    SETLOCAL EnableExtensions
    
    set EXE=EXCEL.EXE
    
    FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto ProcessFound
    
    goto ProcessNotFound
    
    :ProcessFound
    
    echo %EXE% is running
    goto END
    :ProcessNotFound
    echo %EXE% is not running
    goto END
    :END
    echo Finished!

     - Then trigger the TerminateChildProcess from the "ProcessNotFound" part and terminate "Excel addin" from addin appv package.
    - Import your scheduled.task.yourApp.xml into scriptdir of package and run it on package publish.

     - Make a cleanup script in your package that sees to it that your Scheduled task is deleted during remove phase of package.

    Tuesday, September 10, 2019 7:57 AM