We are trying to get a published application to work on Window Server 2012 R2 that requires the %CLIENTNAME% environment variable. When logged in locally on that Remote Desktop Server the variable is available and works as expected. When we publish our application and try to reference %CLIENTNAME% we then receive an error that nothing is set for %CLIENTNAME%. I have checked the HKCU\Volatile Enviroment\ and I can see the session with the CLIENTNAME there.
If we change the application to use %USERNAME% or %COMPUTERNAME% than it will input the corresponding values, so I know it is reading some environment variables.
Our clients are Windows 10.