Search code examples
macosfinderinfo.plistmach-ospotlight

MacOS: Version info for not bundled/unix executables


It's a puzzle for me:

  • for Bundles/Frameworks version lays in Info.plist
  • for old applications it lays in resource fork

But today I found an executable (LaunchDaemon) which is new, has no resource fork, has no Info.plist and has version 1.0.0.1110 according to right pane in Finder. The question is where is the version is sourced from ?


Solution

  • I don't know about the specific LaunchDaemon program you're referring to, but for the general case it's possible to embed an Info.plist into an executable at link time.

    Pass -sectcreate __TEXT __info_plist path/to/Info.plist to ld or, equivalently, pass -Wl,-sectcreate,__TEXT,__info_plist,path/to/Info.plist to the compiler.

    This is documented by Apple in Code Signing Guide: Code Signing Tasks – Adding an Info.plist to Single-File Tools.

    You can check if that's what's going on with the LaunchDaemon program you're referring to by looking at the output of otool -lV path/to/whatever.