Description
Patch definitions can only have 1 package per version per site, which means a separate M1 and Intel package cannot both be uploaded. If you still need packages for Intel computers, we can use the steps below to create a package with both the M1 and Intel packages using Composer.
Creating a package with both the M1 and Intel packages using Composer
Open up Finder and navigate to /tmp.
Create a folder here.
For example, zoominstaller if we're installing Zoom.
Open that folder and create 2 additional folders. Name one Intel and one M1.
Place the Intel installer in the Intel folder and the M1 installer in the M1 folder.
In Composer, click on the Composer menu and select Preferences. Make sure that Executable Types in PKGs is set to All Executables are Universal and hit Save.
Drag the /tmp folder into Composer under the packages section on the left side.
Click on the arrow to the left of the newly created source.
Right-click on Scripts and under Add shell script choose Postinstall.
Add the script below to the Postinstall script in Composer between "targetVolume=$3" and "exit 0"
# THIS SOFTWARE IS PROVIDED BY JAMF SOFTWARE, LLC "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL JAMF SOFTWARE, LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# This script does the following:Installs zoom as needed on Apple Silicon or Intel macs.
exitcode=0
# Determine OS version
# Save current IFS state
OLDIFS=$IFS
IFS='.' read osvers_major osvers_minor osvers_dot_version <<< "$(/usr/bin/sw_vers -productVersion)"
# restore IFS to previous state
IFS=$OLDIFS
# Check the processor
processor=$(/usr/sbin/sysctl -n machdep.cpu.brand_string | grep -o "Intel")
if [[ -n "$processor" ]]; then
echo "Installing Intel Package"
installer -pkg /private/tmp/zoominstaller/Intel/ZoomIntel.pkg -target /
echo "done installing Intel package"
else
echo "Installing M1 package"
installer -pkg /private/tmp/zoominstaller/M1/ZoomM1.pkg -target /
echo "done installing m1 package"
fi
exit $exitcodeModify the Installer commands in the script to point to the correct file paths/names.
Click Build as PKG and upload to Jamf Pro.
Add to package to a patch definition and then create a patch policy.
When this runs, it will first place both the intel and M1 packages into /tmp. The post install script then runs to determine which package to use.