Jump to content

Chris Keavey

Member
  • Posts

    1
  • Joined

  • Last visited

Reputation

0 Neutral

Personal Information

  • Location
    United Kingdom

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. This is the script I currently use with Jamf Pro. This makes the install available via the Jamf Self Service App. It requires some prep work (as others have mentioned) to create a package with Jamf Composer, upload the package to your Jamf instance and create the required policies. The script then performs checks and fires the policies and commands required. It sets permissions on the App folder for the current user It sets our login settings (license server address) via a here doc It adds the App icon to the dock using DockUtil I have been frustrated with the lack of official documentation on this (please do point me in the direction of it if I'm missing it!). I would greatly like to set various preferences using Jamf (default backup location settings, for example) but have been unable to find an easy way of doing this. So far I'm exploring a hacky scripted xml edit using xmlstarlet, but this is a horrible way of doing it 😬 I'm curious as to what the --optionfile argument is used for, but can't find any documentation on this either. Maybe I'm not looking hard enough 🤔 #!/bin/bash #################################################################################################### # # Install Vectorworks 2023 using Jamf Pro # #################################################################################################### # # Required preparation # # Download the Vectorworks 2023 Installer from your Vectorworks customer portal: https://customers.vectorworks.net/downloads # Mount the Vectorworks2023-SP5-702742-SeriesBEG-installer2-osx.dmg # Locate "Vectorworks 2023 Installer.app" and copy it to the Jamf Waiting Room: /Library/Application Support/JAMF/Waiting Room/ # Use Jamf Composer to build a "Vectorworks 2023 Installer.pkg" using "Vectorworks 2023 Installer.app" im Waiting Room # Upload the Vectorworks 2023 Installer.pkg to Jamf # Create a Jamf Pro Policy that will install "Vectorworks 2023 Installer.pkg" to the client machine # Upload this script to Jamf Pro # Create another Policy (prefereably one that uses swiftDialog) to add this script to Jamf Self Service # #################################################################################################### #################################################################################################### # # Global Variables # #################################################################################################### # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Script Version and Jamf Pro Script Parameters # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Set the environment paths # Sets the path so that we can directly call Jamf binaries and DockUtil without specifying the full path every time. export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/jamf/bin:/usr/local/bin # Define a Jamf Binary variable for reuse jamfBinary="/usr/local/bin/jamf" # Sets the current username variable currentUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }') # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Variable required by DockUtil # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # homedir=$( dscl . read /Users/$currentUser NFSHomeDirectory | awk -F ': ' '{print $2}' ) dockplist="$homedir/Library/Preferences/com.apple.dock.plist" dockutil="/usr/local/bin/dockutil" #################################################################################################### # # Main Functions # #################################################################################################### # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Adds the Vectorworks App Icon to the Dock # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # addToDock() { if [ -e '/Applications/Vectorworks 2023/Vectorworks 2023.app' ]; then echo "Adding Vectorworks 2023 App Icon to Dock" sudo -u ${currentUser} $dockutil --add "/Applications/Vectorworks 2023/Vectorworks 2023.app" --position end $dockplist else echo "Vectorworks 2023 App does not appear to be installed - Aborting Add To Dock." fi } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Runs the Jamf Pro Policy that will fetch our Vectorworks Installer Package from Jamf and place it in the Applications Folder # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # downloadInstaller() { if [ ! -e '/Applications/Vectorworks 2023/Vectorworks 2023.app' ] && [ ! -e '/Library/Application Support/JAMF/Waiting Room/Vectorworks 2023 Installer.app' ]; then $jamfBinary policy -trigger fetch-vw2023-installer else echo "Vectorworks 2023 is already installed or the Installer app is already present in Waiting Room" fi } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Runs the silent install command # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # runSilentInstall() { if [ -e '/Library/Application Support/JAMF/Waiting Room/Vectorworks 2023 Installer.app' ] && [ ! -e '/Applications/Vectorworks 2023/Vectorworks 2023.app' ]; then /Library/Application\ Support/JAMF/Waiting\ Room/Vectorworks\ 2023\ Installer.app/Contents/Resources/installer/Install\ Vectorworks2023.app/Contents/MacOS/installbuilder.sh --mode unattended --unattendedmodeui minimal --installdir "/Applications/Vectorworks 2023" --Serial 123456-123456-123456-123456 --sysUsername "$currentUser" --LDFChoice licenseID else echo "Vectorworks 2023 may already be installed or the Installer app does not appear to be present in Waiting Room." fi } #################################################################################################### # # Post Install Configurations # #################################################################################################### # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Sets our organisation's required configurations # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # setConfiguration() { if [ ! -e "/Applications/Vectorworks 2023/Settings/SeriesG" ]; then mkdir -p "/Applications/Vectorworks 2023/Settings/SeriesG" chown -R "$currentUser":staff "/Applications/Vectorworks 2023" fi echo "Setting the LoginDialog.xml file" # Name and path of the file to generate. OUTFILE="/Applications/Vectorworks 2023/Settings/SeriesG/LoginDialog.xml" # ----------------------------------------------------------- # 'Here document containing the body of the generated script. ( cat <<'EOF' <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <LoginDialog> <Days>1</Days> <AutoFindServer>0</AutoFindServer> <AutoFindMaxTime>1</AutoFindMaxTime> <DontShowAtStartup>0</DontShowAtStartup> <Servers> <Server>licenseserver.com:5053</Server> </Servers> <Modules> <MainModule>architect</MainModule> </Modules> </LoginDialog> EOF ) > "$OUTFILE" # ----------------------------------------------------------- } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Sets user permissions for the current user on the Vectorworks application folder. # This is required so that the user can download libraries without any permissions warnings # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # setFolderPermissions() { if [ -e '/Applications/Vectorworks 2023' ]; then # sets read & write permission for current user chmod -R +a "$currentUser allow list,search,add_file,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity" "/Applications/Vectorworks 2023" fi } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Removes the installer app from Waiting Room now that we're done with it # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # cleanup() { if [ -e '/Library/Application Support/JAMF/Waiting Room/Vectorworks 2023.app' ]; then echo "Cleaning up installer app" rm -rf /Library/Application Support/JAMF/Waiting Room/Vectorworks\ 2023\ Installer.app else echo "Vectorworks 2023 Installer App does not appear to be present in Waiting Room." fi } #################################################################################################### # # Run It All # #################################################################################################### downloadInstaller runSilentInstall setConfiguration setFolderPermissions addToDock #cleanup exit 0
×
×
  • Create New...