I am writing a post-installation script to set up the various TF configurations for our company. I am attempting to run “defaults write” commands to set up about 30+ configurations for existing users and to the User Template to configure new users as well; however, for some reason, in my tests, even though the script works successfully, the TF settings are not being changed. I would appreciate a sanity check.
My workflow: After the package copies the TotalFinder package to /private/tmp, the package’s post-installation script uses a helper function to run the defaults commands against a defined path that can vary, depending if I am applying the commands against existing users or the User Template. The variable for this path is $defaultsPATH. The basic steps of the script:
- Use “installer” command to install the package to hard drive
- In User Templates, check if com.apple.finder.plist exists. If not, use defaults command to create file.
- Run defaults commands against defaultsPATH="/System/Library/User Template/English.lproj/Library/Preferences/com.apple.finder"
- Checking against existing users, the commands are run against defaultsPATH="/Users/$user/Library/Preferences/com.apple.finder"(where $user is an existing user)
For the helper function that runs the defaults commands to configure TF, a sample command is like this:
echo "TotalFinderShowStatusItem -bool NO..."
/usr/bin/defaults write "$defaultsPATH" TotalFinderShowStatusItem -bool NO
TotalFinderShowStatusItem=`/usr/bin/defaults read "$defaultsPATH" TotalFinderShowStatusItem`
echo "Verifying configuration..."
if [ "$TotalFinderShowStatusItem" = "0" ]; then
echo "SUCCESS: Configuration passed."
else
echo "WARNING: There was a problem with the configuration. Exit Code: $?"
fi
The script runs fine and verifies each configuration as correct, but the settings are not changed. I am figuring I am missing something really simple here, but I am not catching it.
I appreciate any help in advance.