by L Schmidt
This flow, when running, monitors installation, removal, upgrades of apps, and writes the audit to a log file.
Especially useful when automatic upgrades are enabled, and some app suddenly stopped functioning, or manifests problems which it didn't have before. Also useful in combination with a launcher which makes accidental removal of apps too easy, or with apps which add "accessories" after installation.
Mutations are depicted by + (installation), - (removal) and ^ (upgrade), as shown in the example log excerpt at http://snap.scarydevilmonastery.net/appmutationhistory.jpg
Configurable blocks are on the left, below the flow start block. Argument passing to log subroutine is done in this way because on my system logging is done by a separate flow, common to other flows, which gives me a single point for adjusting log entries format. By default, logging is done to log/apps.log, unless changed in the configuration blocks on the left. The directory will be created if necessary upon launching the flow.
The database directory holds package name to app name associations, as app names aren't available during removal, but used for logging. If database directory doesn't exist at flow start, it will be created and populated with package to app name associations of all installed packages. This initialization will take a few moments.
Should you want to rebuild the database, just stop the flow, delete the directory and restart the flow. Preset is directory "Automate/apps/", specified in the variable "database"
Version 17 introduces an additional flow start header for generating/updating the database.
Future versions of this flow might stick this lookup into an SQL database.