Commit Graph

4763 Commits

Author SHA1 Message Date
Paul Cossey 547e297c53 Update pkginfolib.py (#1258)
# Pull Request: Fix incomplete metadata extraction for audio plugins and other bundles

## Problem Summary

The `getiteminfo()` function in `pkginfolib.py` currently provides inconsistent metadata extraction between applications (.app files) and other bundle types (audio plugins like .vst, .component, .aaxplugin, .vst3).

**Current behavior:**
-  **Applications (.app)**: Extract comprehensive metadata including `CFBundleName`, `CFBundleIdentifier`, `CFBundleShortVersionString`, `CFBundleVersion`, and `LSMinimumSystemVersion`
-  **Other bundles**: Only extract `CFBundleShortVersionString` and `CFBundleVersion`

This results in incomplete installs arrays for audio plugins and other bundle types, missing critical metadata for proper tracking and identification.

## Impact

Audio plugin packages (and other non-application bundles) generate installs array entries like this:

**Before (incomplete):**
```xml
<dict>
    <key>CFBundleVersion</key>
    <string>4.5</string>
    <key>path</key>
    <string>/Library/Audio/Plug-Ins/VST/BC Chorus 4 VST(Mono).vst</string>
    <key>type</key>
    <string>bundle</string>
    <key>version_comparison_key</key>
    <string>CFBundleVersion</string>
</dict>
```

**After (complete):**
```xml
<dict>
    <key>CFBundleIdentifier</key>
    <string>com.bluecataudio.bc-chorus-4-vst-mono-</string>
    <key>CFBundleVersion</key>
    <string>4.5</string>
    <key>minosversion</key>
    <string>10.9</string>
    <key>path</key>
    <string>/Library/Audio/Plug-Ins/VST/BC Chorus 4 VST(Mono).vst</string>
    <key>type</key>
    <string>bundle</string>
    <key>version_comparison_key</key>
    <string>CFBundleVersion</string>
</dict>
```

## Root Cause

In the `getiteminfo()` function, the bundle handling section only extracts version-related keys:

```python
# Current problematic code
for key in ['CFBundleShortVersionString', 'CFBundleVersion']:
    if key in plist:
        infodict[key] = plist[key]
```

While the application handling section extracts comprehensive metadata:

```python
# Application code (working correctly)
for key in ['CFBundleName', 'CFBundleIdentifier',
            'CFBundleShortVersionString', 'CFBundleVersion']:
    if key in plist:
        infodict[key] = plist[key]
# Plus LSMinimumSystemVersion handling
```

## Solution

Align bundle metadata extraction with application metadata extraction by expanding the bundle handling section to extract the same keys and minimum OS version information.

## Files Changed

- `code/client/munkilib/pkginfolib.py` - Modified `getiteminfo()` function

## Changes Made

**Modified bundle handling section in `getiteminfo()` function:**

```python
elif (os.path.exists(os.path.join(itempath, 'Contents', 'Info.plist')) or
      os.path.exists(os.path.join(itempath, 'Resources', 'Info.plist'))):
    infodict['type'] = 'bundle'
    infodict['path'] = itempath
    plist = pkgutils.getBundleInfo(itempath)
    # Extract the same keys as applications
    for key in ['CFBundleName', 'CFBundleIdentifier',
                'CFBundleShortVersionString', 'CFBundleVersion']:
        if key in plist:
            infodict[key] = plist[key]
    # Also extract minimum OS version info like applications
    if 'LSMinimumSystemVersion' in plist:
        infodict['minosversion'] = plist['LSMinimumSystemVersion']
    elif 'LSMinimumSystemVersionByArchitecture' in plist:
        # just grab the highest version if more than one is listed
        versions = [item[1] for item in
                    plist['LSMinimumSystemVersionByArchitecture'].items()]
        highest_version = str(max([pkgutils.MunkiLooseVersion(version)
                                   for version in versions]))
        infodict['minosversion'] = highest_version
    elif 'SystemVersionCheck:MinimumSystemVersion' in plist:
        infodict['minosversion'] = \
            plist['SystemVersionCheck:MinimumSystemVersion']
```

## Benefits

1. **Consistent metadata extraction**: All bundle types now get the same comprehensive metadata as applications
2. **Better plugin tracking**: Audio plugins (.vst, .component, .aaxplugin, .vst3) now have unique identifiers
3. **Improved OS compatibility**: Minimum OS version detection for all bundle types
4. **Enhanced debugging**: More metadata available for troubleshooting installs array issues
5. **Future-proof**: Any bundle type with standard Info.plist structure will benefit

## Affected Bundle Types

This fix applies to all bundle types that aren't applications, including:
- Audio Unit Components (`.component`)
- VST Plugins (`.vst`)
- VST3 Plugins (`.vst3`)
- AAX Plugins (`.aaxplugin`)
- Other macOS bundles with Info.plist files

## Testing

Verified with Blue Cat Audio plugins that all plugin formats now extract:
- `CFBundleIdentifier` (when present)
- `CFBundleName` (when present, particularly in AAX plugins)
- `LSMinimumSystemVersion` converted to `minosversion`
- Existing version extraction continues to work
- Some AutoPkg Recipe's that can be used for testing
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20Chorus
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20Flanger
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20Free%20Amp
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20Freeceiver
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20FreqAnalyst
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20Gain%20Suite
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20Phaser
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20Triple%20EQ
2025-08-15 10:34:29 -07:00
Greg Neagle 02d43cce85 Remove background extension view that provided illusion of content under the sidebar on macOS 26 2025-08-14 09:38:19 -07:00
Greg Neagle 3aa7745409 Keep track of inode of log file so we can continue to follow the log after the file has been rotated 2025-08-13 16:24:35 -07:00
Greg Neagle b429567f5d Add comment about loading error.html 2025-08-13 13:17:45 -07:00
Hunter Stanton b04d50271e Fix path traversal in load_page (#1257) 2025-08-13 13:17:45 -07:00
Greg Neagle 2f4c1c3c39 Simplify the posix_spawn wrapper 2025-07-28 07:43:52 -05:00
Greg Neagle f112ce8b7c Fix for running CLI editor during interactive munkiimport 2025-07-27 22:47:15 -05:00
Greg Neagle ddded786b3 Fix for installer_choices_xml for pkg installs 2025-07-26 09:58:29 -07:00
Greg Neagle 8fd09d9369 Use a different method to determine if a script is executable; previous method did not work well with sudo 2025-07-11 17:23:28 -07:00
Greg Neagle 9d6ad57d0d Improve error messages when custom admin scripts fail to run 2025-07-11 17:22:00 -07:00
Greg Neagle 6fe6bf9425 More useful error message when an admin-provided conditions script fails 2025-07-11 09:48:06 -07:00
Greg Neagle 26562eb764 Don't prompt to open pkginfo in an editor if the editor preference is an empty string. Matches Munki 6 behavior 2025-07-10 14:17:54 -07:00
Greg Neagle 69f4e741c0 Address an issue when package_path is defined in a pkginfo where an incomplete path to the package was passwd to /usr/sbin/installer 2025-07-08 16:45:43 -07:00
Greg Neagle 8ae093973f Fix some typos in some comments 2025-07-08 16:44:13 -07:00
Greg Neagle f51a7677a6 Remove previously commented-out code for NSUserNotifications API 2025-07-08 10:56:58 -07:00
Greg Neagle 2ccf2be85f Change long options for drag-n-drop items to match those in Munki 6 and earlier 2025-07-07 10:04:02 -07:00
Greg Neagle 7a876a6686 Update app icon for MunkiStatus and munki-notifier 2025-07-02 16:04:21 -07:00
Greg Neagle 6f123551a0 Yet another attempt at icons that look good on both macOS 26 and earlier versions of macOS 2025-07-02 09:33:35 -07:00
Greg Neagle f1035b8c14 Keep tweaking AutoLayout contraints in table row view 2025-07-01 11:30:34 -07:00
Greg Neagle 394cbe3a4a MSC: Fix naming of some Asset Catalog items 2025-07-01 11:09:11 -07:00
Greg Neagle 2b0d409352 Add janky conditional compilation directives so MSC.app can build under Xcode 16 (but lacking Tahoe behaviors) 2025-06-30 17:35:38 -07:00
Greg Neagle 3e8838e057 Update Tahoe AppIcon.icon 2025-06-30 16:00:25 -07:00
Greg Neagle eb78c1171b Another round of icon updates 2025-06-30 15:55:45 -07:00
Greg Neagle 0c0084aabb munki-notifier: update AppIcon.appiconset 2025-06-30 15:32:06 -07:00
Greg Neagle 06ba96ba19 MunkiStatus: update AppIcon.appiconset 2025-06-30 15:31:32 -07:00
Greg Neagle 72ad8b235c MSC: update AppIcon.appiconset 2025-06-30 15:30:59 -07:00
Greg Neagle 2eb9504f06 Update AppIcon.icon for MSC.app 2025-06-30 15:30:08 -07:00
Greg Neagle c6332f41bd Change deployment target of Managed Software Center.app to macOS 10.15 2025-06-30 08:23:54 -07:00
Greg Neagle 50c695492e Change deployment target for MunkiStatus.app to 10.15 2025-06-30 08:22:44 -07:00
Greg Neagle cd3f18897e Removing munkishim 2025-06-30 08:21:40 -07:00
Greg Neagle e727aa6aa2 Switch to jpg for default showcase images to save some space 2025-06-29 18:04:46 -07:00
Greg Neagle 9e45230d8d Update default showcase images 2025-06-29 15:18:21 -07:00
Greg Neagle fae7b43bbb Remove no-longer-needed instance varaible that tracks desired sidebar width 2025-06-29 11:31:28 -07:00
Greg Neagle 70965dbf6c Simpler code to prevent manual sidebar resizing 2025-06-29 11:28:26 -07:00
Greg Neagle 4404bcfd1a Explictly remove border from toolbar progress indicator so it looks right even when sidebar is collapsed 2025-06-29 10:59:13 -07:00
Greg Neagle 8bc831feba Prevent resize cursor from appearing near sidebar edge (since sidebar is not resizable) 2025-06-29 10:57:28 -07:00
Greg Neagle 929fb41f06 More monkeying around with autolayout contraints for sidebar items 2025-06-29 08:10:44 -07:00
Greg Neagle 34212fa990 Replace missing } in CSS file 2025-06-29 07:10:00 -07:00
Greg Neagle 37d971b192 CSS change so showcase images are edge-to-edge 2025-06-28 18:41:41 -07:00
Greg Neagle 76421c361b Update constraints for sidebar list view 2025-06-28 17:00:40 -07:00
Greg Neagle da1c96f254 Remove the 1px left border from displayed webview 2025-06-28 16:14:10 -07:00
Greg Neagle 1751957210 Move setting webViee nagigation delegate to the insertWebView function 2025-06-28 16:11:09 -07:00
Greg Neagle e22f1f487e Remove some trailing blank lines 2025-06-28 10:53:44 -07:00
Greg Neagle a6ac86608f Resort controller source files in sidebar 2025-06-28 10:53:06 -07:00
Greg Neagle 600a892068 Adjust CSS so Updates page looks better when sidebar is collapsed (there are no optional installs) 2025-06-28 10:51:40 -07:00
Greg Neagle 508153f62b div item rename 2025-06-28 10:01:11 -07:00
Greg Neagle 5d1089f0ad More macOS 26 updates; begin splitting of MainWindowController.swift into multiple files 2025-06-28 09:51:47 -07:00
Greg Neagle cb7de7a702 Complete transition to UNUserNotification APIs 2025-06-27 14:49:20 -07:00
Greg Neagle c6695aa55b supervisor: fix for build issues on macOS 26/Xcode 26 2025-06-27 10:03:28 -07:00
Greg Neagle 877e8b070a munki-notifier: use UNUserNotification APIs 2025-06-27 10:01:27 -07:00