05/07/2018
Topic:
Closing all programs started with SyMenu
olpanse
|
Hi,
I wonder if there is a way to close automatically all programs when they were started via a SyMenu session for safety reasons.
Especially when running SyMenu on a thumb drive it can be helpful having an option to "Close all running applications" before removing the drive to avoid data loss when still active programs might writing back information to the unmounted thumb drive.
Any ideas?
Thanks. |
09/07/2018
Topic:
Closing all programs started with SyMenu
olpanse
|
Thanks for letting me know. I'm coming from "Portable Start Menu" where the feature was almost there from the beginning including a True Crypt container support for the whole process. Due to the events around True Crypt the support of it was removed in some release later. So no offense, but I assumed this should be a standard feature for such software like SyMenu.
Since I want definitely move to SyMenu I'll try to code a shell-based script myself solving this issue for me in the meanwhile. Since I want to include a Vera Crypt container it's not that simple. :|
Thanks. |
18/07/2018
Topic:
Closing all programs started with SyMenu
olpanse
|
Hi there,
many thanks for taking care of it. I really appreciate it. Also thank you for the historical insights of SyMenu development.
I did a shell script solution working quite well for me at the moment. The script will look for certain processes on specific drives and will kill these automatically when SyMenu is closing. I preferred this over looking for child processes of SyMenu because it might be possible that some processes are started from these drives but not directly via SyMenu.
Nevertheless I'm looking forward seeing your implementation in action. Since my scripts are working so far, there is no need for hurry. I'm also curious about the UI improvements you are currently working on.
Thanks again! |
18/07/2018
Topic:
Closing all programs started with SyMenu
olpanse
|
I'm using the "taskkill" command with the option /t. This should perform some kind of tree killing and minimize the risks your are describing: https://ss64.com/nt/taskkill.html
But I agree, my handling isn't perfect at the moment: Sometimes some processes are hanging and are not killable by default. For this I'm forcing them to kill (/f). This is actually a bit risky and might lead to side effects you are describing, because some data might not be written back to disk. I think the best way of handling it some kind of loop asking the user what to do when processes are not killable. PorableStartMenu was more or less behaving like this. |
19/07/2018
Topic:
Closing all programs started with SyMenu
olpanse
|
Gianluca wrote:
From the Taskkill documentation:
/T - Tree kill: terminates the specified process and any child processes which were started by it.
It would be nice to know if the killing process starts from the child or from the parent because the portable programs prefer the first approach.
I assume that this would kill the childs first, but I'm not absolutely sure of it. I didn't find any detailed information yet, so I've to test it out myself to be sure.
Gianluca wrote:
Anyway I think my solution will be softer than yours.
I totally agree. For me it's just a workaround solution having this script. It's working for me quite good, because I usually close all portable tools like Firefox manually before unmounting the drive. Only few (background) processes from non-critical processes might still be opened at this time.
Gianluca wrote:
I can't embrace your approach to close all the programs from the unit where SyMenu is located to avoid unwanted killing.
I think should be okay in the very most scenarios. I'm a bit cautious, so a implemented the way I described. I tend to have experimental and non-standard-portable setups, so there is a risk that processes aren't spawned from SyMenu directly. But I would see how your approach is working for my, though. I'm looking forward to test it out.
Gianluca wrote:
Unfortunately when I develop a new feature my approach must be prudential to avoid problems with the thousand of configurations the users have with their SyMenu.
Sure, I fully understand and it's good development practice. So take your time. |