How to deploy an .exe installation using GPO

Image Description
Alex Bav Jan 19, 2017

As well know .exe files cannot be deployed using GPO Software Installation. If an application installer comes only as .exe file it is pretty hard to deploy that app in the Active Directory environment. However, there are three ways to do that without using third party deployment tools.

Deploy with a .zap file (Zero Administration Package)

It is an old Microsoft suggested method of deployment an .exe installations via GPO. A zap files deployment currently is rarely used because has many restrictions. The main disadvantage is that ZAP files are not run be automatically on a User Logon or System startup. Instead, the User must access a Control Panel to install the application from here.

Deploy .exe via logon script

This method is more flexible but requires some scripting skills. You need to create a cmd file that executes the .exe installation with command line switches. These command switches are required to run the installation silently i.e. without user interaction. Additionally, you need to add some conditions to prevent script to run the installation more than once. Below is an example of the cmd script.

@echo off
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\theapp >nul
if %errorlevel% equ 0 (
    echo "already installed - do nothing"
) else (
    pushd \\server\share
    setup.exe /S
)

The .cmd file should be located in the "NETLOGON" share on the Domain Controller and configured as a Computer Startup Script in the GPO. Computer startup scripts always executes under the SYSTEM account, and it is not depends on which user is logged on.

Wrap an .exe installation into msi.

This method allows to deploy .exe wth all advantages of deploying via GPO Software Installation. The MSI setup runs on a common way, however not writes file and registry changes, only runs a msi custom action that executes an .exe installation with given parameters. All you need is create an empty msi package with a Custom action. There is a free tool to do that - Exe to msi converter.

Exe to msi converter free
Using the Exe to msi converter free
  1. Select the exe installer file you wish to wrap.
  2. Specify the command line parameters to run the exe installer in the silent mode.
  3. Click Bulld MSI
  4. The msi file will be created in the exe installer file's directory.

Exe to msi converter free download link: exetomsiSetup.msi