Adding preinstallation and postinstallation commands

You can include extra custom commands before or after the installation command, which is used to install the selected software package on endpoints. All commands are run from the root folder of the software package.

About this task

You can specify custom commands for any of the following script types:
BigFix actionscript
The custom command is added to the actionscript and is run directly from the task.
Windows batch script
A batch file is created that contains the custom command. The file is then run from the actionscript of the installation task.
UNIX shell script
A shell file is created that contains the custom command. The file is then run from the actionscript of the installation task.

Use the correct command syntax for the selected script type and validate that the commands are working. The dashboard does not check for valid actionscript, batch script, or shell script commands.

Procedure

  1. From the Create Distribution Task window of the Manage Software Distribution Packages dashboard, click Next until you see the Show Advanced Options under the installation command.
  2. Click Show Advanced Options.
  3. Click Add custom preinstallation and postintallation commands, and click Next.
    Figure 1. Show Advanced Options


  4. Select the script type and enter the commands in the provided spaces, then click Next.
    Important: Use the correct command syntax for the selected script type. The Manage Software Distribution dashboard does not check for valid commands.
    Note: Ensure that Apply command is selected if you want your custom commands to be added to the script, otherwise clear these options.
    Tip: You can use the return code of the installation as a postinstallation command by using this command: parameter 'returnCode';.
    Figure 2. Add custom preinstallation and postinstallation commands

    Add custom preinstallation and postinstallation commands
  5. Follow the remaining instructions in the Create Distribution Task window.

Running deployment commands

About this task

On Windows systems, you can run the commands as a System User, Current User, or as a Local User. Commands that are run by BigFix Clients default to System User (On OS X, UNIX, and Linux computers, the software is installed as root). In some cases, you might want to install by using the credentials and local context of the Current User or a Local User. Details on how to set various parameters associated with Local User are listed below.

Running deployment commands as a Local User

This section explains the various parameters you can configure when you run a command as a local user that is different than the logged-in user.

  • Username: Name of a user who is different than the user that is currently logged in, in either of the following formats:
    1. user@domain. Example: "myname@tem.test.com"
    2. domain\user. Example: "TEM\myname"
  • Password mode: Defines the mode of authentication. The following options are available:
    1. Required: The application prompts you to enter a password, and the value you enter is passed on to the agent as a Secure Parameter.
    2. Impersonate: The agent searches for a session running for the user specified in Username and runs the command in the session of that user.
    3. System: The command is run as the local system account. For this option to work, the user specified in Username must be logged in to the system when the command is run.
  • Interactive: Select the checkbox. The command opens the user interface of the user specified in Username and runs in that user’s session.
  • Target user: Optional. This option becomes active when you select Interactive. The command opens the user interface in the session of the user you specify in this field and runs in that session. The command runs with the primary user privileges, but the target user must be logged in to the system for the command to work.
  • Completion: Specifies whether the command must wait for the process to end.
    1. None: The command does not wait for the process to end. The user must be logged in to the system before the command starts running. The SWD_Download folder is retained if this option is selected. Deploy the SWD_Download folder cleanup fixlet to clean up the client computer, after the process ends.
    2. Process: The command waits for the process to end. This option does not require the specified user to be logged in to the system.
    3. Job: The command waits for the process to end. This option expects the process to do its own job control management and does not require the specified user to be logged in to the system.