Right now lifecycle actions are specialized blocks of code, that do not save the state of the system before executing and isn't able to restore that state. We need to make them more like the settingsHandlers - with a special option for when starting and stopping and application, etc.
From our notes:
- We need to be confident that the thing in "start" can actually start the application and that
the thing in "stop" can actually stop the application. Because there is the possibility that we
might need to positively stop the application when eg. doing an update.
- This requires a new kind of settingsHandler - a launch settings handler, that will allow a special
option called "starting" that given a value true will make the application run, and given the value false
will make the application stop
- When a user logs in to a machine and "isRunning" for application X is true, we will run the "update"
block instead of the "start" block, to ensure that settings are properly applied to the running application
- When running "start" and "stop" from an update block, we would ignore any output from "isRunning" and send
false to the "starting" option for launch settings handlers inside "stop" and true to that option inside "start"