In some instances, installing an add-on may require the user to run LabVIEW as an administrator. Without the proper checks, the installation of an add-on may fail, which can even go unnoticed at first. By determining if LabVIEW has administrator privileges, the developer of an add-on can take the appropriate actions necessary, such as aborting the installation and prompting the user to restart LabVIEW as an administrator.
An example of this check can be seen if one tries to install NI's Third Party Licensing and Activation Toolkit without Administrator privileges through VI Package Manager:
This package used a pre-install VI to check for administrator privileges and generated an error when it was determined that it did not have sufficient admin rights.
An attempt is made to write a temporary file to a directory (or create the directory if it does not exist) that requires administrator privileges. If the attempt is unsuccessful, an error is generated, thus preventing the installation from continuing.
Use the attached VIs as example.
Rick C.