This folder contains:


Custom Code Action: ExecuteAsRoot

Classname: com.zerog.ia.customcode.unix.ExecuteAsRoot

Description: This action will allow you to run a command on a unix system as root.  This action requires that "expect" already be installed on the target machine, and also requires that your 'su' command support the -c switch.  'expect' can be downloaded from http://expect.nist.gov.  

Input InstallAnywhere Variables:

$EXECUTE_AS_ROOT_COMMAND$: the command to run with root privileges.
$EXECUTE_AS_ROOT_PASSWORD$
: the root password.
$EXECUTE_AS_ROOT_EXPECT_PATH$ (optional): the location of the expect binary on the system (defaults to /usr/bin/expect)
$EXECUTE_AS_ROOT_WAIT_TIME$ (optional): the timeout for the command that is running (defaults at 5 seconds)
$EXECUTE_AS_ROOT_TMP_PATH$ (optional): the location to store the temporary expect script (defaults to /tmp)

Output InstallAnywhere Variables

$EXECUTE_AS_ROOT_EXIT_CODE$: The exit code, 0 success, 100 incorrect password
$EXECUTE_AS_ROOT_ERROR_MESSAGE$: Description of any problems that occured

General Instructions:

This README explains how to set up and take advantage of the ExecuteAsRoot custom code action.

For IA 5.5.1 and earlier versions of IA:

To effectively use this action, you will want to add an "Execute Custom Code" action to anywhere in the IA Advanced designer.  Remember that for the action to work correctly you need to add a "Set InstallAnywhere Variable" action before the "Execute Custom Code" action to set the appropriate Input InstallAnywhere Variables.

Once you have added an "Execute Custom Code" action to your project, you will need to select the JAR or ZIP file that contains the desired action. To select the JAR or ZIP file, click on the "Choose JAR or ZIP..." button and select the ExecuteAsRoot.jar file in the "Choose Code Archive" dialog tht appears.

Next you have to designate the "Class:" that is to be called for the custom code. In this case, you would enter "
com.zerog.ia.customcode.unix.ExecuteAsRoot" (no quotes).

For IA 6.0:

To effectively use this action, you will want to add ExecuteAsRoot.jar in [InstallAnywhere Folder]\plugins . Then, add the action located in the plugins tab to InstallAnywhere in the IA Advanced designer.

Please see the user guide for more information on adding additional properties to the customcode.properties file found in ExecuteAsRoot.jar.


Thank you,

Zero G Developer Technical Services.

Additional Information:

This action has not been fully tested on all UNIX variations, and we can not guarantee that it will work properly on all UNIX variations.  If you experience any problems with the action, or you have a better suggestion on how to execute command as root, email us at SupportTeam@ZeroG.com.


13 January  2003