macadmins / installapplications

A tool for dynamically using installapplication
Apache License 2.0
285 stars 62 forks source link

fix big sur b3 paths #73

Closed erikng closed 4 years ago

erikng commented 4 years ago

When installing a package via MDM on Big Sur, the behavior of arguments are different:

A manual install will show something like this for $0/$1/$2/$3

/tmp/PKInstallSandbox.l3yeSQ/Scripts/com.uber.pkg.mdm.OffRLT/postinstall
/Users/erikg/Desktop/mdmtest-1.0.pkg
/
/

whereas a MDM installation will show something like this:

/Library/InstallerSandboxes/.PKInstallSandboxManager/16D65155-E119-4290-913D-9C772D60D921.activeSandbox/Scripts/com.uber.pkg.mdm.Wp0Zrx/postinstall
/var/folders/zz/zyxvpxvq6csfxvn_n0000044000011/C/com.apple.appstore/9ABF6C5F-1FA8-41FE-B73D-1435E3B7A4A0/b58ebfa3-3f2c-48db-97a7-6994164585d7.pkg
/System/Volumes/Data
/System/Volumes/Data

This means that for the launch agents and daemons, the path could be:

/Library/LaunchAgents and /Library/LaunchDaemons pre beta 3

post beta 3 /System/Volumes/Data/Library/LaunchAgents and /System/Volumes/Data/Library/LaunchDaemons

erikng commented 4 years ago

I've confirmed this fixes the issue for big sur.