mirror of
https://github.com/munki/munki.git
synced 2026-04-26 06:48:57 -05:00
89 lines
4.8 KiB
Plaintext
89 lines
4.8 KiB
Plaintext
Optional items
|
|
|
|
item: installed?
|
|
installed version less than offered version?
|
|
uninstallable?
|
|
in SelfServeManifest managed_installs?
|
|
in SelfServeManifest managed_uninstalls?
|
|
licensed_seats_available?
|
|
enough available disk space? (this check should be done when the user clicks "Install")
|
|
|
|
|
|
Initial state:
|
|
installed?
|
|
yes:
|
|
in managed_uninstalls?
|
|
yes:
|
|
status: will-be-removed
|
|
no:
|
|
installed version >= offered version?
|
|
yes:
|
|
uninstallable?
|
|
yes:
|
|
status: installed-not-removable
|
|
no:
|
|
status: installed
|
|
no:
|
|
in managed_installs?
|
|
yes:
|
|
item in managed_updates?
|
|
yes:
|
|
status: update-must-be-installed (this one is new!)
|
|
no:
|
|
status: update-will-be-installed
|
|
no:
|
|
status: update-available
|
|
no:
|
|
in managed_installs?
|
|
yes:
|
|
status: will-be-installed
|
|
no:
|
|
licensed_seats_available?
|
|
yes:
|
|
status: not-installed
|
|
no:
|
|
status: no-licenses-available
|
|
|
|
|
|
Action, new status for state:
|
|
|
|
will-be-removed: action: cancel-removal; new state: installed (remove from managed_uninstalls. Add to managed_installs?)
|
|
installed-not-removable: N/A
|
|
installed: action: remove; new state: will-be-removed (add to managed_uninstalls)
|
|
update-must-be-installed: N/A
|
|
update-will-be-installed: action: cancel-update; new state: update-available (remove from managed_installs) [is it clear this cancels all future updates?]
|
|
update-available: action: install-update; new state: update-will-be-installed (add to managed_installs)
|
|
will-be-installed: action: cancel-install; new state: not-installed (remove from managed_installs)
|
|
not-installed: action: install; new state: will-be-installed (add to managed_installs)
|
|
no-licenses-available: N/A
|
|
|
|
The only ambiguous one is canceling a scheduled removal. Do we or do we not add the item to managed_installs?
|
|
It seems the "correct" answer depends on the initial state -- was the item in managed_installs as initial state?
|
|
If so, we should re-add it; otherwise, no.
|
|
|
|
There's a slight issue there, though:
|
|
Consider: Item is in managed_installs. user chooses to remove it, but for some reason does not proceed with the actual removal, but just quits MSU.app.
|
|
On the next launch, initial state is that the item is in managed_uninstalls.
|
|
So now when we cancel the removal, we just remove it from managed_uninstalls without re-adding it to managed_installs.
|
|
This argues for a consistent behavior: simply remove it from managed_uninstalls in all cases, and never (re-)add it to managed_installs.
|
|
(or possibly, one could argue, always remove from managed_uninstalls and add to managed_installs)
|
|
|
|
This means that if you have a managed optional_install, decide to remove it, then cancel that removal, you are left with an unmanaged app;
|
|
which means no more automatic updates for that app unless it's in managed_updates or the user re-adds it to managed_installs.
|
|
|
|
Alternately, you have something not managed, decide to remove it, then cancel that removal -- the item is now managed.
|
|
|
|
Not sure which is worse.
|
|
|
|
More data: MSU.app writes its updated/changed Self-Service Manifest to /Users/Shared/.SelfServeManifest (note: that has been a problem in the past when some admin has removed /Users/Shared or removed write rights -- we need to test for this and issue appropriate warning, or use /tmp as a backup location?)
|
|
managedsoftwareupdate copies this to (/Library/Managed Installs/)manifests/SelfServeManifest when it runs. So we might be able to recover the "original" state for the item even between runs, as long as managedsoftwareupdate hasn't run in the meantime.
|
|
|
|
This seems too complicated and hard to understand later when things don't always behave the same way.
|
|
Still think we should settle on a single, consistent behavior.
|
|
|
|
Also, should not write out the changed /Users/Shared/.SelfServeManifest on each change -- only at quit or when the user clicks "update now" for the pending updates. (And maybe only if it has changed?)
|
|
|
|
Otherwise managedsoftwareupdate could do unexpected things underneath us.
|
|
|
|
If /Users/Shared/.SelfServeManifest != /Library/Managed Installs/manifests/SelfServeManifest, then we need to run an updatecheck before proceeding to install
|