Any chance you're using NSIS? You can get FF7's install directory this way:
SetRegView 32
ReadRegStr $FF7DIR HKLM "Software\Square Soft, Inc.\Final Fantasy VII\" "AppPath"
It doesn't matter if you're on XP, Vista, or 7. What *DOES* matter is whether you're using x86 or x64, but this bit of code above accounts for both.
If you're not using NSIS, just remember that in 64-bit Windows, it's in "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Square Soft, Inc.\Final Fantasy VII". Identical to the 32-bit entry, but with "Wow6432Node" in the middle.
Additionally, Aali's driver does not set registry entries anymore. I advise checking to see if the config file exists in the install directory. Again, here's a bit of NSIS code that can do this for you:
IfFileExists $FF7DIR\ff7_opengl.cfg +3 0
MessageBox MB_OK "Error: Aali's Custom Graphics Driver is required."
Quit
Obviously, it'll have to be adapted to whatever variable names you're using. If you're using something other than NSIS, the code will be different, but the same basic principles should apply.