- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Knowledge Base
- :
- Run the Installer only for sudo user else abort the Installation : Installanywhere 2022
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
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.
3. Add a Panel: Display message to display $EXECUTE_STDOUT$ which hold the result of groups username command.
4. Add a rule to display message panel only if
Operand 1 : $EXECUTE_STDOUT$ does not contain
Operand 2: sudo
5. Add Abort Installation plug-in to abort the installation with a rule of
Operand 1 : $EXECUTE_STDOUT$ does not contain
Operand 2: sudo
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.
Learn more: https://www.revenera.com/install/products/installanywhere/installanywhere-files-utilities