Deploying AutoCAD 2020 Using Script

raghdasi
New Contributor III

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.

c765d023c57a4e24bba26f2e829e05cb

appreciate any help I get. thank you in advance.

4 REPLIES 4

Lincolnep
New Contributor III

Hi @raghdasi I have the install and the licencing working for AutoCAD 2020 but have been unable to get the hotfix to install.

Here is the postinstall script that I am using to get it to install and licence without the popup on first run you are having:

#!/bin/bash

# Install AutoCAD 2020
installer -pkg "Install Autodesk AutoCAD 2020 for Mac.pkg" -target /

# Licence AutoCAD 2020
/Library/Application Support/Autodesk/AdskLicensing/Current/helper/AdskLicensingInstHelper change --prod_key 777L1 --prod_ver 2020.0.0.F --lic_method "NETWORK" --lic_server_type "SINGLE" --lic_servers "serverURL"

if you run:

/Library/Application Support/Autodesk/AdskLicensing/Current/helper/AdskLicensingInstHelper h

you will be able to see the options you have for getting Autodesk products to licences on mac's

I will be giving your way of installing the hotfix a go as i have tried using JamF and by script but not with the -allowUntrusted option in my script.

So far this has also worked for Autodesk Mudbox 2020 as well.

raghdasi
New Contributor III

Thanks @Lincolnep. Will try this.

Lincolnep
New Contributor III

@raghdasi after a bit of work I managed to get the hotfix to install as well here is my working script:

#!/bin/bash

# Install AutoCAD 2020
installer -pkg "Install Autodesk AutoCAD 2020 for Mac.pkg" -target /

# Setup for installing Hotfix Combo
# Open Hotfix Combo up in Suspicious Package https://www.mothersruin.com/software/SuspiciousPackage/
# Look for VerTarget.plist in pkg locate the UpdateVersion and copy that to the bellow var
UpdateVersion="23.1.46.205"
# Make sure it is clean.
if [ -d /private/tmp/_adsk_${UpdateVersion} ]; then
    rm -R /private/tmp/_adsk_${UpdateVersion}
fi
mkdir -p /private/tmp/_adsk_${UpdateVersion}
ln -s /Applications/Autodesk/AutoCAD 2020/AutoCAD 2020.app /private/tmp/_adsk_${UpdateVersion}/acupdt_rone

# Install Hotfix Combo
/usr/sbin/installer -allowUntrusted -verboseR -pkg "AutoCAD_Mac_2020.1.2_Hotfix_Combo.pkg" -target /

# Licence AutoCAD 2020
/Library/Application Support/Autodesk/AdskLicensing/Current/helper/AdskLicensingInstHelper change --prod_key 777L1 --prod_ver 2020.0.0.F --lic_method "NETWORK" --lic_server_type "SINGLE" --lic_servers "serverURL"

kacey3
Contributor II

Thanks for this! I was looking for this exact answer.