Giter Club home page Giter Club logo

Comments (11)

gregneagle avatar gregneagle commented on August 24, 2024

It's an interesting idea. I'd like to see someone build a POC using admin-provided conditions (maybe using munki-facts) to test out the concept and get a feel for performance, overhead, etc.

from munki.

miawri avatar miawri commented on August 24, 2024

I've been using a munki-fact based on the inbuilt app_data function to retrieve the installed bundle IDs to use in conditional_items and installable_conditions. It does take a few seconds longer at the beginning of a managedsoftwareupate run, but I'm currently willing to live with that for the extra functionality.

I imagine the overhead would be less if this were a built-in conditional item and the data was written into ConditionalItems.plist at the point the app_data / saveappdata functions are called during a managedsoftwareupdate run.

from munki.

gregneagle avatar gregneagle commented on August 24, 2024

Decided to play with this today. It would be pretty easy to extend the "built-in" facts with a single "applications" array of dictionaries that contains the same info currently written to ApplicationInventory.plist. This would allow for predicates like
ANY applications.name == "Microsoft Word" which would return True if Microsoft Word was installed, or
ANY applications.bundleid BEGINSWITH "com.adobe" which would return True if any Adobe apps were installed.
You could even do
ANY applications.path == "/Applications/Firefox.app" if you only wanted to test for apps installed in /Applications, and not return True for apps that might be in a user's home dir or in /Users/Shared.
I don't see any easy way to test for a specific version of an app, or specify a predicate that matches an app if it's lower than a specific version.

from munki.

gregneagle avatar gregneagle commented on August 24, 2024

After reading up on the underdocumented SUBQUERY keyword for NSPredicate, I have a predicate that returns True if Microsoft Word, version "16.82" is installed:
SUBQUERY(applications, $a, $a.bundleid == "com.microsoft.Word" AND $a.version == "16.82").@count > 0

from munki.

gregneagle avatar gregneagle commented on August 24, 2024

One could also do something like:
SUBQUERY(applications, $a, $a.bundleid == "com.microsoft.Word" AND $a.version BEGINSWITH "16.").@count > 0
to determine if Microsoft Word with a "major version" of "16" was installed.

from munki.

gregneagle avatar gregneagle commented on August 24, 2024

See https://funwithobjc.tumblr.com/post/2726166818/what-the-heck-is-subquery

from munki.

gregneagle avatar gregneagle commented on August 24, 2024

See also https://github.com/munki/munki/wiki/_Preview-of-Conditional-Application-Data

from munki.

miawri avatar miawri commented on August 24, 2024

from munki.

gregneagle avatar gregneagle commented on August 24, 2024

There's really nothing here that couldn't have been done with a custom "fact" script, but having it built in is a little more efficient and makes if far more likely Munki admins will actually use it.

from munki.

miawri avatar miawri commented on August 24, 2024

from munki.

gregneagle avatar gregneagle commented on August 24, 2024

Munki 6.5 has been released and contains an implementation of the requested feature here.

from munki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.