$fdir function

$fdir(path)

The $fdir function returns the folder path of the passed-in path, i.e., it removes the section after the last '\' or '/' separator in the path. If path does not contain any '\' or '/' separators, the result is an empty string; if path ends with a '\' or '/' separator, that separator plus the preceding section are removed. The resulting folder path does not include the final separator.

MSI note 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.

Parameters

All parameters may contain symbolic references; these are resolved before the function is applied. See Examples below.

path
File path from which to extract the folder path.

Examples

Here are some usage examples for this function:

<$fdir(C:\Program Files\Tarma ExpertInstall\Bin\Tin.exe)>
Returns C:\Program Files\Tarma ExpertInstall\Bin from the literal path.
<$fdir(<INSTALLDIR>\Bin\Tin.exe)>
Returns C:\Program Files\Tarma ExpertInstall\Bin from the symbolic path, assuming that <INSTALLDIR> resolves to the appropriate folder path.
<$fdir(<INSTALLDIR>\Bin)>
<$fdir(<INSTALLDIR>\Bin\)>
Both return C:\Program Files\Tarma ExpertInstall from the symbolic path, assuming that <INSTALLDIR> resolves to the appropriate folder path.
<$fdir(<#Tin_alias>)>
Returns C:\Program Files\Tarma ExpertInstall\Bin from the file alias path, assuming that Tin_alias is the file alias for the Tin.exe executable.