Category filter

Script to download and install enterprise app (EXE) from its download link

Enterprise apps are apps that are tailored to meet the needs of an organization. At times, organizations may introduce new applications and seek to deploy them across their Windows devices. This can be accomplished through Hexnode UEM’s Execute Custom Script action, allowing the deployment of scripts to automate the downloading and installation of these apps on Windows devices.

In addition to the initial installation, the script can be used to manage updates. Organizations can effectively keep their app versions up to date by executing the script with the latest download link whenever a new update is released. This ensures that the apps are consistently maintained with the latest features, bug fixes, and performance improvements.

Disclaimer:

The sample scripts provided below are adapted from third-party open-source sites.

Batch script

The script begins by defining variables for the download URL, download path, and installation path. Using bitsadmin.exe, it creates a BITS transfer job named “DownloadJob” to download the .exe file from the URL to the specified location on the device. After a successful download, it silently installs the application. Once installed, the script deletes the downloaded installer and displays “Installation complete

E.g., To install a program ‘TeamViewer_Setup.exe’ in the Desktop of the user Deborah,

Notes:

  • You need not install the program with the same name used in the download URL. You can put a more comprehensive name when you specify the path of the .exe file. Make sure that you call the Start command of the program with the newly assigned name.
  • Although the script indicates success on the Hexnode console, the installation of the app may still require some additional time to complete.

PowerShell script

The provided script automates the download and installation process of an enterprise app. It defines the download link and local path for saving the downloaded EXE file, proceeds to download the app, verifies the success of the download, and then attempts a silent installation. Upon successful installation, it displays “Installation completed“; otherwise, it indicates a failure.

For example, the following script will download and silently install a program ‘TeamViewer_Setup.exe’:

Notes:

  • Only apps that support silent installation will be installed without user intervention. Some exe installers cannot be run silently. In such cases those apps will require the user to grant permission or accept an agreement to be installed on the device.
  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository