OsxAdminPassword
Title: Check administartor authentication on Mac OS-X
Description: Gets path of the AppleScript file at install time and a different path to the AppleScript at uninstall time. OsxAdminPassword Activates an AppleScript, in a Shell, that triggers the first sudo command with prompt for authentication. If the right password was entered the installation gets 5 minutes of enabling sudo commands hassle-free (without asking for authentication again). This action enables three fail tries before canceling the installation. In case of three mistakes or a cancel button pressed, this action cancels the installation.
A hidden parameter - authentication holds the result:
Success: authentication = 0.
Fail (wrong or error): authentication = 1.
Canceled by the user: authentication = -1.
This value can be checked for appropriate ‘Finish’ dialog.
In case of fail OsxAdminPassword sends message to the installation log. OsxAdminPassword checks the input-stream for a return value by the AppleScript file and according to this return-value decides if to cancel the installation and what value to set the authentication property to. Usually the AppleScript is installed to $D(temp) in installation before the OsxAdminPassword in the sequence. This file needs to be installed to a permanent folder if the installation continues, so it can be used during uninstall. At the end of the uninstall it has to be deleted explicitly.
@author Ofer Rivlin