i'm in the process of packaging a specific application which by design has some its application processes still running after (main) application close. while this is maybe fine if installed regularly, this is an issue when running from a portable device as it prevents device execution among other things. therefore, i'd like to get the left-over processes killed when the end user closes the virtualized application. i've implemented a solution in thinapp virtualization packages through batch or vb script before. looking at the cameyo manual i figured this might be doable with the custom events (on stop) functionality.
in general, is this possible with cameyo at all? if so, how can it be done? are custom events the way to go?
In the documentation you'll find the following. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Custom events: allows you to define custom events that run when the virtual application starts or stops. You can define whether you want the events to trigger before or after the virtualized environment is started / ended. For example, if you need to run a script when a virtual application starts, but you need it to run outside of the virtual environment, then you can specify it in the "On start (unvirtualized)" event. If on the other hand you would like to execute a certain command when the virtual application ends, but you want it to still run inside the virtual environment, then you can specify it in the "On stop (virtualized)" event. The option "Wait until program ends" delays the virtual application's start or stop until your command has finished executing. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Using TaskKill will sove your issue and as for a batch file you should be fine. http://technet.microsoft.com/en-us/library/bb491009.aspx
Heck in my batch file I've also have a command to clean up the ram after the job is done... This way I'm sure all the process are finished and cleared.
the piece of documentation you referred to is the one that initially lead to opening this thread. unfortunately, it doesn't state how to exactly configure a custom event:
- what commands can be used directly in the 'command' field?
- what syntax has to be used, esp. in regards to calling external programs?
batch and vbs scripts for my purpose are available and only wait to be integrated. i've experimented some with the custom event configuration but just haven't been able to figure it out on my own.
-- Edited by moc on Tuesday 22nd of January 2013 11:17:20 AM
i'm trying to virtualize the current version of evernote (download URL: https://evernote.com/download/get.php?file=Win). the following command should be executed on app stop - either directly or via batch script: TASKKILL /F /IM "evernoteclipper.exe"
don't bother with virtualizing the app on your own if you don't have the time to right now. i'd be absolutely fine with some examples of working custom events.
p.s. vamps at the doctor's office? well, that's major news ...
thanks for the hint - not ideal in my mind since it requires a non-intuitive way to close the app. but definitely a nice option if other alternatives fail.
A future version of Cameyo will have the capability to terminate specific processes that remain after the application is closed.
For now, Cameyo's -stop parameter or the command taskkill are workarounds. The lazy part of me would simply create a shortcut that uses either -Stop if I have no Custom events that I wanted executed after closing the application or taskkill if I had Custom events to perform after the application is closed. I might be tempted to use a three-line batch file to launch the package, pause so that the third line doesn't execute until a key is pressed, and use taskkill to terminate EvernoteClipper.exe when any key is pressed. Of course, it's a bit ugly, leaving the cmd.exe window open during Evernote's operation.
If you're a perfectionist who doesn't want to wait for the version of Cameyo that will allow the termination of leftover processes, you can write a script that launches the package, checks intermittently to see if Evernote.exe is running, and terminates EvernoteClipper.exe when the script finds that Evernote.exe is no longer running. This script can be part of the package itself, in which case, you can use the scripting language of your choice and make it part of the package, too (if the scripting language needs to be installed).
Oh, I almost forgot: if you're really lazy and don't ever use EvernoteClipper.exe, you can remove it from part of the package and have no need to terminate it after the package is closed.
Thank you very much, moc, for bringing this topic to our attention. Cameyo will become better as a result of being able to close leftover processes, and that wouldn't have happened without your question.
thanks, my pleasure to contribute to cameyo development. i'm looking forward to this capability in a future version. i'll use one of the mentioned workarounds for the time being - unless shawn or another community member can make it even work with the current cameyo release.
-- Edited by moc on Sunday 27th of January 2013 05:17:30 AM