Current fossil behaviour causes problems at least on Windows 7.
On my system (Win 7 Home Basic 32 bit) HOMEPATH variable contains path, relative to HOMEDRIVE value, while USERPROFILE contains full path including drive name. Using HOMEPATH causes wrong behaviour when fossil invoked on the drive, other than HOMEDRIVE. For example using path from directory D:\someproject makes fossil search user profile directory at which is obviously wrong.
I believe fossil should rather use USERPROFILE or construct full path by combining HOMEDRIVE and HOMEPATH values.