separate function for get environment to be able used with DLL version of tools