Environ function returns an error

Hello,

I’m trying to use ENVIRON funtion to retrieve a system variable on XP in Navision 2.60D 4sp3.

Although in the function description it’s said, that “it can return garbage”, if the variable doesn’t exist, function gives an error “variable does not exist” in this case.

I’m trying to find out if some custom program is installed by looking for specific system variable, which is set during this program installation.

Does anyone know the solution for this? Or maybe some suggestion, what else can I use instead to check out, if the my program is isntalled on particular computer.

Thanks,

Janis