I just tested this with v9.5 sp2 and you do need a reboot now for the LDMS_LOCAL_DIR varable to work after installing the agent. This used to work ok so looks like Peter's option is the best but be careful about the path depending on the version of Windows you are running ie 32 or 64bit.
Either that or put a reboot in after agent install and before running patch.