$iispath(key)
The $iispath function retrieves a path from the IIS (Internet Information Server, Microsoft's Internet server) metadata database, or an empty path if IIS is not running or does not support the requested data. It is typically used to obtain the physical path to a virtual folder of one of the IIS services, for example the WWW or FTP server's root folder.
Tip: To retrieve general IIS metadata (not limited to paths), use the $iisdata function instead.
Note: Because IIS only runs on Windows NT-based systems (Windows NT4, 2000, XP, and later), the function always returns an empty path on other platforms.
Many of the metadata information requires elevated privileges (usually Administrator
rights). Therefore, this function may fail if the installer is running with
a less privileged account. Typically only /LM/W3SVC (and below) information
is available to non-Administrator users.
Windows Installer does not support symbolic functions; if you use this function
during an MSI build, you will get diagnostic message BLD:U0010
and the result is undefined.
All parameters may contain symbolic references; these are resolved before the function is applied. See Examples below.
The key parameter must specify the metadata path of the information that you want to retrieve. Here are some commonly used keys (refer to Microsoft's IMSAdminBase::GetData documentation for a full list):
| Key path | Result |
|---|---|
| /LM/W3SVC/n/ROOT | Physical path to the virtual root folder of the web site identified by n. |
| /LM/W3SVC/n/ROOT/virtual_dir | Physical path to the virtual folder virtual_dir on the web site identified by n. |
| /LM/MSFTPSVC/n/ROOT | Physical path to the virtual root folder of the FTP site identified by n. |
| /LM/MSFTPSVC/n/ROOT/virtual_dir | Physical path to the virtual folder virtual_dir on the FTP site identified by n. |
Here are some usage examples for this function: