pre-hook script runner now executes with app context (using envdir).