Setup-Manager icon indicating copy to clipboard operation
Setup-Manager copied to clipboard

If JSM fails to complete, it will continue to launch and the uninstall script fails

Open mattdjerome opened this issue 4 months ago • 1 comments

If JSM fails to complete and place the /private/var/db/.JamfSetupEnrollmentDone file. it continues to launch until the process completes. THe problem with the uninstall script, is it shows a failure if the remove /private/var/db/.JamfSetupEnrollmentDone is uncommented.

Here's a version of the uninstall script with logic to detect the setup complete file.

`#!/bin/sh

export PATH=/usr/bin:/bin:/usr/sbin:/sbin

appName="Setup Manager" bundleID="com.jamf.setupmanager" setupComplete="/private/var/db/.JamfSetupEnrollmentDone" appPath="/Applications/Utilities/${appName}.app"

if [ "$(whoami)" != "root" ]; then echo "needs to run as root!" exit 1 fi

if launchctl list | grep -q "$bundleID" ; then echo "unloading launch daemon" launchctl unload /Library/LaunchDaemons/"$bundleID".plist fi if [ -e "$appPath" ]; then rm $appPath echo "removing files" rm -rfv "$appPath" rm -v /Library/LaunchDaemons/"$bundleID".plist rm -v /Library/LaunchAgents/"$bundleID".loginwindow.plist fi echo "forgetting $bundleID pkg receipt" pkgutil --forget "$bundleID"

if [ -e $setupComplete ]; then rm -v /private/var/db/.JamfSetupEnrollmentDone fi `

mattdjerome avatar Sep 29 '25 16:09 mattdjerome

uninstall sample script was updated in 1.4beta

scriptingosx avatar Oct 29 '25 07:10 scriptingosx