[fpc-pascal] SysUtils.GetEnvironmentVariable

Sven Barth pascaldragon at googlemail.com
Thu Mar 29 13:32:08 CEST 2012


Am 29.03.2012 13:29, schrieb Marcos Douglas:
> On Thu, Mar 29, 2012 at 8:13 AM, Sven Barth<pascaldragon at googlemail.com>  wrote:
>> Am 29.03.2012 13:06, schrieb Marcos Douglas:
>>
>>> The application is installed and the system variable is created. The
>>> application and others process should be use this variable just
>>> calling SysUtils.GetEnvironmentVariable.
>>
>>
>> Then let a FPC program print all passed environment variables as a test:
>>
>>
>> === source begin ===
>>
>> program envtest;
>>
>> var
>>   i: LongInt;
>> begin
>>   for i := 0 to GetEnvironmentVariableCount do
>>     Writeln(GetEnvironmentString(i)); // Note: this will include "name=value"
>> unlike GetEnvironmentVariable
>>
>> end.
>>
>> === source end ===
>
> I know it works on WinXP but my client uses Win7 and I don't have Win7
> at this moment so, somebody can test this, please?

The point is that for me it works.

>> Also - as I already wrote - you can use the Process Explorer (
>> http://technet.microsoft.com/de-de/sysinternals/bb896653 ) to check whether
>> the application does indeed contain the environment variable.
>
> If the app do not found the environment variable, what I can tell to
> the user? He do not know this things... the variable was set by
> installer and the application should be able to use.

Ok, that might be a problem then...

Regards,
Sven



More information about the fpc-pascal mailing list