cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Run the Installer only for sudo user else abort the Installation : Installanywhere 2022

Run the Installer only for sudo user else abort the Installation : Installanywhere 2022

Introduction:  This article will show to how to configure an Installer to install only if the user has sudo access else abort the Installation.

Instructions:

1. Create a new project.
2. Goto Sequence and Pre-install Sequence, Add Execute Script/Batch file action and then add the following command to check whether the user has the sudo access or not,
groups username.
Note: If you see the group ‘sudo’ in the output, the user is a member of the sudo group and it should have sudo access.

ab1.JPG
3. Add a Panel: Display message to display $EXECUTE_STDOUT$ which hold the result of groups username command.

ab2.JPG

4. Add a rule to display message panel only if
Operand 1 : $EXECUTE_STDOUT$ does not contain
Operand 2: sudo

ab3.JPG
5. Add Abort Installation plug-in to abort the installation with a rule of
Operand 1 : $EXECUTE_STDOUT$ does not contain
Operand 2: sudo

ab4.JPG

To use the Plug-in "AbortInstallAction", please download from this link https://www.revenera.com/install/products/installanywhere/installanywhere-files-utilities and add AbortInstallActionCustomCode.jar in [InstallAnywhere Folder]\plugins.

ab5.JPG
Learn more: https://www.revenera.com/install/products/installanywhere/installanywhere-files-utilities

Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Feb 22, 2023 02:44 AM
Updated by:
Contributors