Hi
Hopefully I have understood your issue correctly. I have never had an issue with the use of the FGLPROFILE environment variable. We use Linux and for our non interactive and non GUI sessions we set the variable like this snippet:
TEQDIR=/opt3/teq
FGLDIR=/opt3/fourjs/fgl
GREDIR=/opt3/fourjs/gre
FLMDIR=/opt3/fourjs/flm
FGLASDIR=/opt3/fourjs/gas
FGLRESOURCEPATH=$TEQDIR/etc
FGLPROFILE=$FGLRESOURCEPATH/fglprofile
export FGLPROFILE FGLAPPSERVER FGLLDPATH LD_LIBRARY_PATH CLASSPATH
For our interactive sessions our xcf file looks like this snippet:
<APPLICATION Parent="defaultwa">
<RESOURCE Id="res.teqdir" Source="INTERNAL">/opt3/teq</RESOURCE>
<RESOURCE Id="res.teqdir.bin" Source="INTERNAL">$(res.teqdir)/bin</RESOURCE>
<RESOURCE Id="res.teqdir.jar" Source="INTERNAL">$(res.teqdir)/jar</RESOURCE>
<RESOURCE Id="res.teqdir.poi" Source="INTERNAL">$(res.teqdir.jar)/poi-4.1.0</RESOURCE>
<RESOURCE Id="res.teqdir.etc" Source="INTERNAL">$(res.teqdir)/etc</RESOURCE>
<EXECUTION>
<ENVIRONMENT_VARIABLE Id="FGLRESOURCEPATH">$(res.teqdir.etc)</ENVIRONMENT_VARIABLE>
<ENVIRONMENT_VARIABLE Id="FGLPROFILE">$(res.teqdir.etc)/fglprofile</ENVIRONMENT_VARIABLE>
<PATH>$(res.teqdir.bin)</PATH>
<MODULE>teqstart.42r</MODULE>
</EXECUTION>
</APPLICATION>
For our web services, our xcf file looks like this snippet:
<APPLICATION Parent="ws.default" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://4js.com/ns/gas/3.10/cfextws.xsd">
<RESOURCE Id="res.teqdir" Source="INTERNAL">/opt3/teq</RESOURCE>
<RESOURCE Id="res.teqdir.bin" Source="INTERNAL">$(res.teqdir)/bin</RESOURCE>
<EXECUTION>
<ENVIRONMENT_VARIABLE Id="FGLPROFILE">$(res.teqdir)/etc/fglprofile</ENVIRONMENT_VARIABLE>
<PATH>$(res.teqdir.bin)</PATH>
<MODULE>gwssrvr</MODULE>
<POOL>
<START>0</START>
<MIN_AVAILABLE>0</MIN_AVAILABLE>
<MAX_AVAILABLE>1</MAX_AVAILABLE>
</POOL>
</EXECUTION>
</APPLICATION>
When developing in Studio, I set the FGLPROFILE variable via an environment variable.
Have you checked you are exporting the variable and checked the file permissions?
Gary