Summary
This script takes an action parameter of 'Install', 'Uninstall', or 'ReInstall' and performs that action on the target machine.
Sample Run

Variables
Document the various variables in the script. Delete any section that is not relevant to your script.
Name | Description |
---|
Installed | This is 0 (Uninstalled) or 1 (Installed). |
UninstallState | This is 0 (Success) or 1 (Failed). |
InstallState | This is 0 (Success) or 1 (Failed). |
Global Parameters
Name | Example | Required | Description |
---|
Acct_Key | hfdkjaldhfuinb933487fg0a | True | This is the assigned Account Key for Huntress. |
User Parameters
Name | Example | Required | Description |
---|
Action | 'Install', 'Uninstall', or 'ReInstall' - Default = Install | False | The action you wish to take with the Huntress application. |
Process
- Action - Uninstall or Reinstall
- Start Uninstall.
- Check for method of removal and remove.
- Check if still installed.
- Return 0 if successfully removed; return 1 if still present - Variable
UninstallStatus
, Logged.
- If return is 0 and there is a 'ReInstall' action, then initiate install; otherwise, exit with an error.
- Action Install - or sent to by Reinstall action
- Check if account key applies; set
InstallState
to 1 if not valid and return an error.
- Download the application for Mac or Windows.
- Execute the installer for Mac or Windows.
- Check for the installation.
- Return 0 if the software is installed or 1 if Huntress is not installed.
- Errors out if failed.
Output