in reply to Capturing Win32 registry changes made by a software installation
I think whats happening is that $LmRegBefore and $LmRegAfter get flushed (because they're the same).