# Elastic Agent MSI – Is INSTALLDIR supported for custom installation directory?

**URL:** <https://discuss.elastic.co/t/elastic-agent-msi-is-installdir-supported-for-custom-installation-directory/381998>\
**Category:** Elastic Agent\
**Created:** [September 17, 2025, 4:10am UTC](https://discuss.elastic.co/t/elastic-agent-msi-is-installdir-supported-for-custom-installation-directory/381998 "2025-09-17T04:10:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh\_tran](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/josh_tran/32/145034_2.png) [@josh\_tran](https://discuss.elastic.co/u/josh_tran)\
**Post date:** [September 17, 2025, 4:10am UTC](https://discuss.elastic.co/t/elastic-agent-msi-is-installdir-supported-for-custom-installation-directory/381998/1 "2025-09-17T04:10:00Z")

</div>

Hi all,

I am installing Elastic Agent 9.0.4 using the MSI package and I would like to place it in a custom directory.

According to the official elastic documentation, it seems possible to specify a custom installation directory with `INSTALLDIR` (available since version 8.13).

However, in this GitHub repository I also found a note stating that customizing the installation directory is not supported for Elastic Agent MSI (only for Beats).

 ![1000058935](https://us1.discourse-cdn.com/elastic/original/3X/9/e/9e48193a1e9dcab75e9cbc9bd5caa4fb91c8f25f.jpeg)

When I try with:

```auto
msiexec /i Elastic-Agent-9.0.4.msi INSTALLDIR="D:\Elastic\Agent"

```

it still installs everything into the default path under `C:\Program Files`.

Could someone confirm whether `INSTALLDIR` is actually supported for Elastic Agent MSI, and if the docs need an update?

Thanks in advance!

> **[Install Elastic Agent from an MSI package | Elastic Docs](https://www.elastic.co/docs/reference/fleet/install-agent-msi#_installing_in_a_custom_location)**
>
> MSI is the file format and command line utility for the Windows Installer. Windows Installer (previously known as Microsoft Installer) is an interface...
