How can I know the MT5 installed path from registry?

You can easily find it:

- type regedit in your command line
- search for MetaTrader5 (press F3 until u find some relevant key)

e.g.:

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MetaTrader 5]

"DisplayName"="MetaTrader 5"

"InstallLocation"="C:\\Program Files\\MetaTrader 5"

"DisplayIcon"="C:\\Program Files\\MetaTrader 5\\terminal.ico"

"Publisher"="MetaQuotes Software Corp."

"HelpLink"="http://www.metaquotes.net"

"UrlInfoAbout"="http://www.metaquotes.net"

"UninstallString"="C:\\Program Files\\MetaTrader 5\\Uninstall.exe"

"DisplayVersion"="5.00"

"MajorVersion"="5"

"MinorVersion"="0"