Hi There,
I am using script in the policy to install AutoCAD 2020 to our labs. We are using multiuser license so I am using script to enter the server name on the application.
!/bin/sh
postinstall
pathToScript=$0
pathToPackage=$1
targetLocation=$2
targetVolume=$3
Silently install Autodesk AutoCAD 2018
SETUP_DIR="/private/etc/Uni/pkg"
INSTALLER_PKG_1="Install Autodesk AutoCAD 2020 for Mac.pkg"
INSTALLER_PKG_2="AutoCAD_Mac_2020.1.2_Hotfix_Combo.pkg"
TEMPLATE_DIR="/System/Library/User Template/English.lproj"
PROD_ID="0000"
SERIAL_ID="00000999"
REG_FILE=
LIC_SERVER="ServerName"
LIC_DIR="/Library/Application Support/Autodesk/AdskLicensingService/777L1_2020.0.0.F"
if [ -f "$SETUP_DIR/$INSTALLER_PKG_1" ]; then cd "$SETUP_DIR" /usr/sbin/installer -allowUntrusted -pkg "$INSTALLER_PKG_1" -target / /usr/sbin/installer -allowUntrusted -pkg "$INSTALLER_PKG_2" -target /
if [ ! -d "$LIC_DIR" ]; then mkdir -p "$LIC_DIR" if [ $? -ne 0 ]; then echo "ERROR: Create directory failed ... "$LIC_DIR exit 254 fi fi cd "$LIC_DIR" echo "_NETWORK" > LGS.data chmod 777 LGS.data echo "done" > nw.cfg # # Write the license file printf "SERVER $LIC_SERVER 0 USE_SERVER " > licpath.lic
# Copy preference files into system user template directory
cd "$SETUP_DIR"
cp com.autodesk.admigrator2020.plist "$TEMPLATE_DIR/Library/Preferences"
cp com.autodesk.adsklicensingagent.plist "$TEMPLATE_DIR/Library/Preferences"
cp com.autodesk.adsso-v2.AdSSO-v2.plist "$TEMPLATE_DIR/Library/Preferences"
cp com.autodesk.AutoCAD2020.plist "$TEMPLATE_DIR/Library/Preferences"
else
echo "ERROR: Installer not found ... $SETUP_DIR/$INSTALLER_PKG_1"
fi
exit 0 ## Success
exit 1 ## Failure
Also I have plist in /Library/LaunchAgent that copies preferences files to users :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>user.script.AutoCADrunatload</string>
<key>Program</key>
<string>/private/etc/Uni/pkg/AutoCADPlist2020.sh</string>
<key>RunAtLoad</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/AutoCAD.out</string>
</dict>
</plist>
My problem is AutoCAD installs fine and when the first user login to the computer, following window appears and as soon as user clicks on Muti-User window closes and AutoCAD launches. But when next user logs in to the same computer that window doesn't appears any more and application launches no problems.
appreciate any help I get. thank you in advance.