added windows compatible hookEnv