Posted on 09-06-2018 04:44 PM
In case this is helpful to anyone deploying "AutoCAD 2018" and/or "SketchBook for Enterprise 2018" using an internal Autodesk license server.
Their PKGs are very well made, flat/signed and silent...the below are AFTER scripts in Jamf Pro policies.
(1) Autodesk_licenseFile.sh (creates file with port@fqdn for primary:secondary internal Autodesk license server)
(2) Autodesk_disableAutoCAD2018welcomeScreen.sh (disables welcome screen...not really necessary, client might ask me to remove)
(3) Autodesk_setupAutoCAD2018.sh (creates two files that are created after app contacts server)
(4) Autodesk_setupSketchBookForEnterprise2018.sh (creates two files that are created after app contacts server)
#1/2/3 are used for AutoCAD 2018.
#1/4 are used for SketchBook for Enterprise 2018.
Autodesk_licenseFile.sh
#!/bin/sh
# Set Autodesk license file. 20180906 DM
licenseFilePath="/Library/Application Support/Autodesk/CLM/LGS"
licenseFile="$licenseFilePath"/"ADSKFLEX_LICENSE_FILE.data"
licenseString='27004@server1.domain.com:27004@server2.domain.com'
# Confirm path exists
mkdir -p "$licenseFilePath"
if [[ -e "${licenseFile}" ]]; then
if [[ $( cat "${licenseFile}" ) == "${licenseString}" ]]; then
echo "License OK."
else
echo "License not OK, fixing..."
echo "$licenseString" > "$licenseFile"
echo "License fixed."
fi
else
echo "License does not exist, creating..."
echo "$licenseString" > "$licenseFile"
echo "License created."
fi
exit 0
Autodesk_disableAutoCAD2018welcomeScreen.sh
#!/bin/sh
# Autodesk AutoCAD 2018 disable welcome screen. 20180906 DM
over500=$( dscl . list /Users UniqueID | awk '$2 > 500 { print $1 }' )
# Set pref User Template
defaults write /System/Library/User Template/English.lproj/Library/Preferences/com.autodesk.AutoCAD2018 AutoMigrated -bool TRUE
chown root:wheel /System/Library/User Template/English.lproj/Library/Preferences/com.autodesk.AutoCAD2018.plist
# Set prefs Users
for u in $over500 ;
do
defaults write /Users/"$u"/Library/Preferences/com.autodesk.AutoCAD2018 AutoMigrated -bool TRUE
chown "$u" /Users/"$u"/Library/Preferences/com.autodesk.AutoCAD2018.plist
done
exit 0
Autodesk_setupAutoCAD2018.sh
#!/bin/sh
# Set up Autodesk AutoCAD 2018. 20180906 DM
setupFilesPath="/Library/Application Support/Autodesk/CLM/LGS/777J1_2018.0.0.F"
lgsFile="$setupFilesPath"/"LGS.data"
lgsFileString="_NETWORK"
nwFile="$setupFilesPath"/"nw.cfg"
nwFileString="done"
# Confirm LGS.data file exists
mkdir -p "$setupFilesPath"
# Confirm LGS.data file
if [[ -e "${lgsFile}" ]]; then
if [[ $( cat "${lgsFile}" ) == "${lgsFileString}" ]]; then
echo "Setup LGS.data file is OK."
else
echo "Setup LGS.data file is not OK, fixing..."
echo "$lgsFileString" > "$lgsFile"
echo "Setup LGS.data file fixed."
fi
else
echo "Setup LGS.data does not exist, creating..."
echo "$lgsFileString" > "$lgsFile"
echo "Setup LGS.data file created."
fi
# Confirm nw.cfg file
if [[ -e "${nwFile}" ]]; then
if [[ $( cat "${nwFile}" ) == "${nwFileString}" ]]; then
echo "Setup nw.cfg file is OK."
else
echo "Setup nw.cfg file is not OK, fixing..."
echo "$nwFileString" > "$nwFile"
echo "Setup nw.cfg file fixed."
fi
else
echo "Setup nw.cfg does not exist, creating..."
echo "$nwFileString" > "$nwFile"
echo "Setup nw.cfg file created."
fi
exit 0
Autodesk_setupSketchBookForEnterprise2018.sh
#!/bin/sh
# Set up Autodesk SketchBook for Enterprise 2018. 20180906 DM
setupFilesPath="/Library/Application Support/Autodesk/CLM/LGS/871J1_2018.0.0.F"
lgsFile="$setupFilesPath"/"LGS.data"
lgsFileString="_NETWORK"
nwFile="$setupFilesPath"/"nw.cfg"
nwFileString="done"
# Confirm LGS.data file exists
mkdir -p "$setupFilesPath"
# Confirm LGS.data file
if [[ -e "${lgsFile}" ]]; then
if [[ $( cat "${lgsFile}" ) == "${lgsFileString}" ]]; then
echo "Setup LGS.data file is OK."
else
echo "Setup LGS.data file is not OK, fixing..."
echo "$lgsFileString" > "$lgsFile"
echo "Setup LGS.data file fixed."
fi
else
echo "Setup LGS.data does not exist, creating..."
echo "$lgsFileString" > "$lgsFile"
echo "Setup LGS.data file created."
fi
# Confirm nw.cfg file
if [[ -e "${nwFile}" ]]; then
if [[ $( cat "${nwFile}" ) == "${nwFileString}" ]]; then
echo "Setup nw.cfg file is OK."
else
echo "Setup nw.cfg file is not OK, fixing..."
echo "$nwFileString" > "$nwFile"
echo "Setup nw.cfg file fixed."
fi
else
echo "Setup nw.cfg does not exist, creating..."
echo "$nwFileString" > "$nwFile"
echo "Setup nw.cfg file created."
fi
exit 0
Hope this is helpful to anyone tasked with deploying these items...sure wish this info was available here, would have saved a good amount of time. :)
PS, Autodesk support shout out to DrewP for his help, sending him a link to this post.
Don
Posted on 12-10-2018 12:07 PM
Are you using a license server or standalone licenses? On Windows we use the latter, but I don't understand where you get the information for those 3 variables.
Nevermind, it was in your title. :|
Posted on 03-14-2019 07:44 AM
Any ideas of how I should modify this to deploy with a standalone license?
Great work, by the way.
Posted on 04-04-2019 07:50 AM
@leegalan If you want to use this for a standalone version, change _NETWORK to _STANDALONE and add a serial number to the script.
Posted on 04-04-2019 12:58 PM
Some additional changes I had to make for the NETWORK install, for some reason our instance required me to populate a LICPATH.lic file at the $setupFilesPath. So I ended up doing this with it; without the 12x0's and the daemon port it failed.
#!/bin/sh
# Confirm path exists
mkdir -p "$licenseFilePath"
if [[ -e "${licenseFile}" ]]; then
echo "SERVER $licenseString 000000000000 2080" > "$licenseFile"
echo "USE_SERVER" >> "$licenseFile"
echo "License updated."
else
echo "License does not exist, creating..."
echo "SERVER $licenseString 000000000000 2080" > "$licenseFile"
echo "USE_SERVER" >> "$licenseFile"
echo "License created."
fi
I am currently in the process of writing it up as a JAMF policy to accept a serial number and prod key as parameters, so once I get that together, I'll post it.