The $srcpath function returns the source path of the installation file with the alias file_alias. If file_alias is empty or refers to a non-existing file, the result is an empty string. The function's behavior differs slightly between build time and installation time:
- At build time (for example, as part of a custom build action), the result is the source file path of the file on your development system.
- At installation time (the normal usage), the result is the installation source path of the file if the file is being distributed in uncompressed form, or empty if the file is part of the compressed distribution package.
An installation file is part of the uncompressed distribution if the file is specifically marked as Packaging: Plain file in its file attributes, or if the package has its Packaging: Plain file tree option set and the file is marked Packaging: Default.
This function allows you to refer to an uncompressed distribution file in the installer before any files are installed on the target system. After installation, you can use the regular <#file_alias> syntax.
All parameters may contain symbolic references; these are resolved before the function is applied.
- File alias of the desired file.
Here are some usage examples for this function:
- When used at build time (for example, as part of a custom build action), returns the source file path of the installation file with the alias License.rtf_452BBCED444414DA. When used at installation time (the normal usage), returns either the path to the uncompressed file on the distribution medium, or an empty path if the file is distributed in compressed form.