It is possible to use Windows environment variables in Visual Installer. The environment variables can be used in the Registry tab and in the INI files tab in Visual Installer. You can find a list of supported environment variables in this Wikipedia page (see the Windows section).
You use an environment variable in the same way as a Visual Installer variable. For example, to include the %ProgramFiles% environment variable in a file path you can include it like this:
And during the installation the %ProgramFiles% variable will be replaced with the current value that the system returns (usually C:\Program Files (x86)).
The picture below shows how to use the %COMPUTERNAME% environment variable in the Registry tab in Visual Installer:
During the installation the %COMPUTERNAME% variable will be replaced with the current computer name of the computer.