Support Windows environment variables in HiddenServiceDir
Expansion should be done each time the hidden service dir is opened, and stored unexpanded. Actually, my impression is that if you use the right Win32 API calls to open the location, tor itself doesn't need to worry about expansion. Win32 will take care of any necessary.
One direct benefit to you devs is that you could then use '%UserProfile%' in the HiddenServiceDir examples for Windows in your documentation, such as the one discussed in !#4798 (moved), yielding the appropriate location in every version that Tor supports.
This behavior could/should eventually broadened to all options for which a path can be specified (e.g. DataDirectory, GeoIPFile, PidFile), so if the fix would affect the opening of other paths (I haven't looked through the source code), all the better. If the fix isn't in a core function, I'd be happy to add a new, broader, ticket.
P.S. The version I'm using is actually 0.2.2.37, but I don't see it in the list.