Working on a Swift / ObjC tool that needs to interact with the files and directories created and used by Server.app, as well as some other system components.
I've looked around here in the developer forums, have run various DDG searches, rummaged the developer documentation, and don't see a documented way of detecting the presence of macOS Server.app in the local system configuration.
The approaches available involve NSTask or analogous of the serverinfo command (and catch the error when that's not present, or read and process the command output or XML data when it is), or the use of Spotlight to rummage for the presence of the Server.app bundle, or to simply go look for the /Applications/Server.app bundle.
All seemingly somewhat hackish as, for instance, the Server.app bundle might "just" be being used as a client to access a remote server and not running locally.
Or just assume that Server.app is present and configured, and which I'd really rather not do if there's a better way.
Is there a preferred or better way to detect whether Server.app is present and configured?
Also not subject to MAS rules, given what the tool will be doing, too.