Removing Power Manager

Before Power Manager can be used, it must be installed on your Mac. Installation is required because Power Manager works closely with macOS, and to achieve this we need to place files in various locations outside of your home folder.

Removing, or uninstalling, Power Manager is a little different from other application only products. Even though the process is slightly different, removing Power Manager remains simple.

You can choose to Remove the Scheduler or Remove Power Manager.

Power Manager can be left uninstalled in your Applications folder. Only if the scheduler is installed will any scheduling occur.

Having Power Manager available, but not performing scheduling duties, is designed where access to pmctl, documentation, or other aspects of Power Manager are needed.

Remove the Scheduler

  1. Launch Power Manager.

  2. Select the menu item: Scheduler > Remove Scheduler….

  3. Follow the steps to confirm and remove the Scheduler.

Remove Power Manager

    If you want to remove all of Power Manager, including the scheduler and application. The best approach is to remove the scheduler and then drag the application to the Trash in the Finder.

  1. Launch Power Manager.

  2. Select the menu item: Scheduler > Remove… (with Option key)

  3. Follow the steps to confirm and entirely remove Power Manager.

What is removed?

For the complete removal, Power Manager uses an installer package, .pkg, that completely removes both installed and runtime created files.

The removal package requires administrator rights to run. The package also deals with previous versions of Power Manager. The package can be found at Power Manager.app/Contents/Resources/remove-power-manager.pkg and online at https://www.dssw.co.uk/powermanager/remove.

The script embedded within the package is presented in full below. If you just want to remove Power Manager, see Remove Power Manager.

Removal Script

The aim is to keep the script approachable to administrators and advanced users comfortable with shell scripting. Expect the script to change between versions and releases of Power Manager.

Power Manager's removal script


#!/bin/bash
#
# Part of DssW Power Manager
# Copyright (c) 2019 Dragon Systems Software Limited
# Support: support@dssw.co.uk
#
# This script removes Power Manager from the target drive. A restart is required.

TARGET_DRIVE="$3"

# Ensure script has root authority
if ! [ "$(id -u)" = 0 ]; then
  echo "You must be root to run this script" 2>&1
  exit 1
fi

##
# Remove static files
REMOVE_FILES=(
  # ...PM5 only
  'Library/LaunchDaemons/uk.co.dssw.powermanager.pmd.plist'  # Launchd job ticket
  # ...PM3+PM4
  'Applications/Power Manager.app' # Application
  'etc/pam.d/uk.co.dssw.powermanager' # PAM policy
  'Library/Application Support/Power Manager' # Shared tools and core engine
  'Library/Automator/PMCancelEvents.action'
  'Library/Automator/PMDelayEvents.action'
  'Library/Automator/PMDeleteEvents.action'
  'Library/Automator/PMEvent.definition'
  'Library/Automator/PMEventsToStrings.caction'
  'Library/Automator/PMExportEvents.action'
  'Library/Automator/PMFilterEvents.action'
  'Library/Automator/PMImportEvents.action'
  'Library/Automator/PMListEvents.action'
  'Library/Automator/PMNewEvent.action'
  'Library/Automator/PMNextEvent.action'
  'Library/Automator/PMResetEvents.action'
  'Library/Automator/PMToggleScheduler.action'
  'Library/Frameworks/PowerManager.framework' # Shared framework
  'Library/LaunchAgents/uk.co.dssw.pmnotify.login.plist' # Launchd job ticket
  'Library/LaunchAgents/uk.co.dssw.pmnotify.plist' # Launchd job ticket
  'Library/LaunchAgents/uk.co.dssw.pmuser.plist' # Launchd job ticket
  'Library/LaunchDaemons/uk.co.dssw.pmd.plist' # Launchd job ticket
  'Library/LaunchDaemons/uk.co.dssw.powermanager.installer.plist' # Automated installer job ticket
  'Library/PrivilegedHelperTools/uk.co.dssw.powermanager.installer' # Automated installer
  'Library/Caches/uk.co.dssw.powermanager.certtool.cache.json' # certtool cache
  'var/tmp/uk.co.dssw.powermanager' # Unix socket directory
  # ...PM3 only
  'Library/Documentation/Help/Power Manager Help' # Help Book symlink
  'Library/PreferencePanes/Power Manager.prefPane' # Preference pane
  'Library/StartupItems/PowerManager' # StartupItem (Mac OS X 10.3.9)
  'Library/Widgets/Power Manager.wdgt' # Dashboard widget (Mac OS X 10.4+)
  'System/Library/CoreServices/SecurityAgentPlugins/pmauth.bundle' # loginwindow plugin
  'usr/local/powermanager' # Unix daemon
  );
for (( i = 0 ; i < "${#REMOVE_FILES[@]}" ; i++ ))
do
  FILEPATH="${TARGET_DRIVE}${REMOVE_FILES[$i]}"
  if [ -e "$FILEPATH" ]; then
    rm -r "${FILEPATH}"
  fi
done

##
# Remove the run time created files
find "${TARGET_DRIVE}Library/Receipts" -name 'Power Manager *.pkg' -type d -print0 | xargs -0 rm -r
find "${TARGET_DRIVE}Library/Preferences" -name 'uk.co.dssw.powermanager.*' -type f -delete
find "${TARGET_DRIVE}var/root/Library/Preferences" -name 'uk.co.dssw.powermanager.*' -type f -delete

exit 0



Back to User Guide.