Commit Graph

2556 Commits

Author SHA1 Message Date
Greg Neagle
d8fe8e55e7 Remove Python command-line tools 2025-10-06 14:45:18 -07:00
Elliot Jordan
41e6d38cc5 Spelling fixes for Munki 7 branch (#1263)
* Fix SidebarViewController.swift file name

* Fix spelling in comments

* Fix spelling in strings and output

* Fix spelling in variables and key names

* One more pass at spelling fixes
2025-08-27 12:27:12 -07:00
Greg Neagle
d100d682e4 Bump python libraries version to match 6.7.0 release 2025-08-25 16:39:11 -07:00
Greg Neagle
1c109d384d Add sucatalog URL for macOS 26 2025-08-25 10:51:18 -07:00
Greg Neagle
6ce2321a4a Reduce code duplication in pkginfolib.getiteminfo 2025-08-15 10:34:29 -07:00
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
a4e19992b4 Remove debugging print() statement 2025-06-10 15:20:13 -07:00
Greg Neagle
6d33d5b33d More reliable identification of flat pkg PackageInfo and Distribution files 2025-04-02 09:18:19 -07:00
Greg Neagle
6ee386247d Merge branch 'PythonPowerManager' into Munki6dev 2025-02-11 09:26:14 -08:00
Greg Neagle
46b81f061c Bump version for future release 2025-02-10 13:04:44 -08:00
Greg Neagle
e31330a64c String interpolation fix 2025-02-07 08:07:55 -08:00
Greg Neagle
0a2cb3f524 Don't skip user notification for display sleep assertions if force is true (so notifications will happen if a force install deadline is soon) 2025-02-06 17:33:52 -08:00
Greg Neagle
f88d10eaef Skip user notification if a process has made a display sleep assertion, which may mean the user is 'presenting' or in a meeting 2025-02-06 17:17:18 -08:00
Liam Nicholson
189a9054e2 Add Chain Support in Client Certificate Authentication (#1236)
* add chain support in the Client Certificate mechanism

* update comment
2025-02-06 09:35:10 -08:00
Greg Neagle
41e4a5cf89 Wait longer for a reponse from fdesetup so the client doesn't timeout too fast 2025-01-29 13:38:15 -08:00
Greg Neagle
b720ed5e59 Bump version for future release 2025-01-29 08:20:10 -08:00
Greg Neagle
6b4ad647c4 Update copyright dates 2025-01-25 15:35:09 -08:00
Greg Neagle
40b44aef2a Test that /usr/bin/aa exists before attempting to call it, avoiding a crash on older macOSes 2025-01-17 10:53:19 -08:00
Greg Neagle
aa41b00217 Bump version for future release 2024-10-07 09:28:31 -07:00
Greg Neagle
85e82c68c7 iconutils: if pax can't expand files from a package Payload archive, try aa 2024-09-20 11:28:38 -07:00
Greg Neagle
93b26403d1 When processing optional_installs, correctly record installed_size if available instead of just duplicating installer_item_size 2024-09-05 11:56:47 -07:00
Greg Neagle
f0b2f9756e Bump version.plist for future release 2024-09-05 10:06:15 -07:00
Greg Neagle
ee5d52442b Add softwareupdate catalog for macOS 15 2024-08-29 15:01:06 -07:00
Greg Neagle
7756827e40 Update selfservice.py
Fix an error message that would have provided wrong info
2024-08-20 10:07:01 -07:00
Greg Neagle
eff2ebc2c9 Bump version.plist for future release 2024-08-14 08:45:58 -07:00
Graham Gilbert
752376875c Add --show-config-plist option (#1224) 2024-08-14 08:24:21 -07:00
Greg Neagle
85f39b76d0 Merge branch 'Munki6dev' into macmule-installhelper 2024-07-01 09:47:26 -07:00
Greg Neagle
dd80a61875 Merge branch 'main' into Munki6dev 2024-07-01 09:46:11 -07:00
aysiu
cccfba0500 Display force_install_after_date in managedsoftwareupdate summary (if applicable) (#1220)
* Show force_install_after_date in summary after managedsoftwareupdate run
---------

Authored-by: Alan Siu <alanysiu@gmail.com>
2024-07-01 09:44:47 -07:00
Greg Neagle
d7a27ea4fd Bump version for future release 2024-06-24 10:51:29 -07:00
Greg Neagle
251c1ce3b8 Merge branch 'Munki6dev' into macmule-installhelper 2024-06-24 10:50:16 -07:00
Greg Neagle
34b9e28e2a Merge branch 'main' into Munki6dev 2024-06-24 10:47:46 -07:00
Greg Neagle
40cc0ef8f9 Add version info to welcome message (#1219) 2024-06-24 10:46:35 -07:00
Greg Neagle
793e468b87 Bump version.plist for future release 2024-06-04 13:41:34 -07:00
Greg Neagle
23a6344c95 Merge branch 'Munki6dev' into macmule-installhelper 2024-06-04 13:40:47 -07:00
Greg Neagle
6c4a8bc29f Restore 'catalogs' as an item included in ManagedInstallReport.plist under 'Conditions'. Addresses #1218 2024-06-04 13:39:24 -07:00
Greg Neagle
bb2d1e0ca2 When running an embedded pkginfo script, ignore errors when converting script output to UTF-8 2024-06-03 09:03:01 -07:00
Greg Neagle
3c4368c208 Merge branch 'Munki6dev' into macmule-installhelper 2024-05-21 15:20:43 -07:00
Greg Neagle
fbe22d2ce1 Fix so new conditional/predicate comparisons based on installed applications actually work.
Bump version to 6.5.1 for future release.
2024-05-21 15:17:07 -07:00
Greg Neagle
14256fc454 Bumping version for future release 2024-05-02 08:06:18 -07:00
macmule
d746c046cb Changes made to installhelper and make_munki_pkg.sh (#1216)
* Update installhelper

• Amended the user bootout and bootstrap commands to not be ran via `launchctl asuser`

* Update MainMenu.xib

• Centered the MunkiStatus.app window icon
• Changed the icon from AppIcon to NSApplicationIcon (which then allows for changing the icon via NSWorkspace's setIcon)

* Corrections to installhelper

* Update installhelper

---------

Co-authored-by: Greg Neagle <Gregneagle@mac.com>
2024-05-02 08:04:22 -07:00
Greg Neagle
ab341ea99b Merge branch 'Munki6dev' into macmule-installhelper 2024-04-18 15:27:12 -07:00
Greg Neagle
6bb572b148 Add more detail to warning message when failing to import a middleware file 2024-04-17 08:56:01 -07:00
Greg Neagle
16320e56ae Merge branch 'Munki6dev' into macmule-installhelper 2024-04-15 08:40:17 -07:00
Greg Neagle
aeac6e96a9 Start consolidating functions that deal with date/times and rely less on undocumented pyObjc conversions 2024-04-12 13:56:11 -07:00
Greg Neagle
a222d0739d Merge branch 'Munki6dev' into macmule-installhelper 2024-04-10 09:44:39 -07:00
Greg Neagle
2edea029eb Fix string format error for new package references messages 2024-04-10 09:31:06 -07:00
Greg Neagle
b4265aa7fc Merge branch 'Munki6dev' into macmule-installhelper 2024-04-01 10:58:12 -07:00
Greg Neagle
c9e3250859 Improved debug warnings when attempting to find a valid uninstall method for an item 2024-04-01 10:57:21 -07:00
Steve
af4296d50e manifest delete option added (#1212)
Co-authored-by: Steve Kueng <steve.kueng@umb.ch>
2024-04-01 10:53:46 -07:00