Afternoon All
Hopefully someone has seen this before.
I have recently patched VLC media player the install media is DMG so used Repackage https://bitbucket.org/twocanoes/repackage/src/master/?ref=steemhunt application to create a PKG for deployment.
I have noticed that some devices don't unmout the sparsebundle within pkg package. I though this might have been some issues with creation of the pkg. So I delete the current version and recreated it.
Testing the new package created in same way this doesnt seem to happen.
I though removing the orginal pkg from DP would stop it being mounted seems not. So I have created a policy forcely remove it on login.
/usr/sbin/diskutil unmount force /Volumes/1010139C-84D6-4178-A17F-D3DD4F424C8C.
This seems to be working fine if the machine is rebooted, I think this should sort itself out overtime as the machines are powered off daily. On restarting a device which has just run the above command it doesnt get mounted on login.
I have two questions?
Why is happening as there a post install script which should unmount it see below. It was being unmounted in my testing. It also seems to be random if it gets mounted or not on a new login.
Is there a better way to remove it for All user who login in.
#!/bin/sh
#Copyright 2018-2019 Twocanoes Software, Inc
shopt -s nullglob
install_dir="$2"
target="$3"
diskimage_name="10650355-FEC4-41D9-A563-2AA4133FDCCF.sparsebundle"
echo "mounting sparse image"
mounted_sparse=$(hdiutil attach -plist "${install_dir}/${diskimage_name}" |grep -A 1 mount-point|grep -v mount-point|sed 's|.*<string>\\(.*\\)</string>.*|\\1|')
echo "mounting dmg"
vol=$(hdiutil attach -plist "${mounted_sparse}"/*.dmg |grep -A 1 mount-point|grep -v mount-point|sed 's|.*<string>\\(.*\\)</string>.*|\\1|')
for pkg in "${vol}"/*.pkg; do
echo "installing ${pkg}"
/usr/sbin/installer -package "${pkg}" -target "${target}"
done
for app in "${vol}"/*.app; do
app_name=$(basename "${app}")
echo "copying ${app_name}"
/bin/cp -R "${app}" "$3"/Applications/
echo "changing ownership"
chown -R root:wheel "$3"/Applications/"${app_name}"
done
diskutil unmount force "${vol}"
diskutil unmount force "${mounted_sparse}"
exit 0
Thanks