From d229889c65e6ce2e7ea879c0b7bd5a14fcb026ce Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Wed, 24 Jun 2009 04:41:28 +0000 Subject: [PATCH] Managed Software Update now defaults to using /Library/Managed Installs/InstallInfo.plist if /Library/Preferences/ManagedInstalls.plist is missing or the ManagedInstallDir key is missing. git-svn-id: http://munki.googlecode.com/svn/trunk@102 a4e17f2e-e282-11dd-95e1-755cbddbdd66 --- .../ManagedSoftwareUpdate.applescript | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/code/ManagedSoftwareUpdate/ManagedSoftwareUpdate.applescript b/code/ManagedSoftwareUpdate/ManagedSoftwareUpdate.applescript index 76abb009..95cd97bb 100755 --- a/code/ManagedSoftwareUpdate/ManagedSoftwareUpdate.applescript +++ b/code/ManagedSoftwareUpdate/ManagedSoftwareUpdate.applescript @@ -22,9 +22,14 @@ property managedInstallDir : "" on itemstoinstall() set installlist to {} set ManagedInstallPrefs to "/Library/Preferences/ManagedInstalls.plist" + set managedInstallDir to "/Library/Managed Installs" try tell application "System Events" set managedInstallDir to value of property list item "ManagedInstallDir" of property list file ManagedInstallPrefs + end tell + end try + try + tell application "System Events" set InstallInfo to managedInstallDir & "/InstallInfo.plist" set managedinstalllist to value of property list item "managed_installs" of property list file InstallInfo repeat with installitem in managedinstalllist @@ -93,7 +98,17 @@ on awake from nib theObject if contents of data cell "name" of theDataRow is "" then set contents of data cell "name" of theDataRow to |name| of installitem end if - set contents of data cell "version" of theDataRow to version_to_install of installitem + + set oldDelims to AppleScript's text item delimiters + set AppleScript's text item delimiters to "." + if (count of text items of version_to_install of installitem) > 3 then + set shortVersion to text items 1 through 3 of version_to_install of installitem as text + else + set shortVersion to version_to_install of installitem + end if + set AppleScript's text item delimiters to oldDelims + + set contents of data cell "version" of theDataRow to shortVersion set contents of data cell "description" of theDataRow to |description| of installitem try set contents of data cell "restartaction" of theDataRow to |RestartAction| of installitem