Build munkitools package for deployment with Microsoft Intune MDM
First you need to build a signed munkitools package, that's suitable for MDM deployment (-m flag in build script). The app doesn't need to be signed, just the installer package.
And if building earlier than the Universal2 Munki 5.3 release, you'll also want to have the package install Rosetta2 on Apple silicon Macs (-R flag); although you may want to include this regardless if you're deploying other software that requires Rosetta.
Also look at the option to include the Munki configuration preferences in the munkitools distribution package (-c flag), since ideally you want everything related to Munki in a single package.
Once the package is built, manually install it to test.
You'll process this package with the Microsoft wrapping tool, and this needs post-editing to work correctly.
On a Mac that has your package manually installed, get the version of the Managed Software Center (MSC) app:
defaults read /Applications/Managed\ Software\ Center.app/Contents/Info.plist CFBundleShortVersionString
You'll use this to tell the wrapper tool the MSC app version, which the Intune detection logic will use to check if the app is installed on clients.
This is done by specifying the MSC app bundle ID (-i flag) in the wrapping tool, and the version (-n flag), 5.3.0.4289 in this example:
IntuneAppUtil -v -c munkitools-5.2.3.4295.pkg -i com.googlecode.munki.ManagedSoftwareCenter -n 5.3.0.4289 -o ./
Next, edit the the resulting .intunemac file to work around an Intune detection issue, so it's only looking for the Managed Software Center app, and not all the component packages.
unzip munkitools-5.2.3.4295.pkg.intunemac
Edit /Metadata/Detection.xml to remove all MacOSLobChildApp BundleId= lines, except for com.googlecode.munki.ManagedSoftwareCenter
Should look something like this:
<?xml version="1.0" encoding="UTF-8"?>
<MacOSLobApp PackageType="pkg" PackageName="munkitools-5.2.3.4295.pkg" BundleId="com.googlecode.munki.ManagedSoftwareCenter" BuildNumber="5.3.0.4290">
<MD5HashChunkSize Size="10485760"/>
<MD5Hash>
f69b89b7f4763462f2b284f5a19eb8b6,dad7dfd13ed30f08b8f5ee6627dc7571,b69e20d4d18211fce884ebc7f53d5ac2,869618ba95cd648f2b73678110b85074
</MD5Hash>
<MacOSLobChildApp BundleId="com.googlecode.munki.ManagedSoftwareCenter" BuildNumber="4289" VersionNumber="5.3.0.4289"/>
</MacOSLobApp>
<InstallerParams VolumeInfo="/" RestartAction="None"/>
</PackageMetadata>
After editing, zip the IntuneMacPackage folder (first remove original)
rm munkitools-5.2.3.4295.pkg.intunemac
zip -q --symlinks -0 -r munkitools-5.2.3.4295.pkg.intunemac IntuneMacPackage
rm -rf IntuneMacPackage/
Check the re-zipped LOB package to make sure the tool can read it:
IntuneAppUtil -v -r munkitools-5.2.3.4295.pkg.intunemac
Upload the .intunemac file to Intune as a Line-of-Business app.
It will automatically set the description as follows, and I like to change it Managed Software Center rather than munkitools, but that's not required
- Description: munkitools-5.2.3.4295.pkg (5.3.0.4289) -> change to: Managed Software Center (5.3.0.4289)
Also you'll want to set these options:
- Ignore app version: YES (set to yes for apps that are automatically updated by app developer), assuming you use Munki to update Munki
- Install as managed: NO (only applies to Big Sur and simple apps bundles)