I had a look at my GOG.com FS2, and you may be able to get fix on GOG FS2 installations using the following registry key:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\GameUX\Games\{B14DCE92-4D55-4BBA-984D-1CCB4D48DA36}
Key name
ConfigApplicationPath
I'm not sure where GOG stores its install paths (I checked Program Files (x86)\GOG.com\ and didn't find anything).
EDIT: OK, found it, it's in
%ProgramData%\GOG.com\Galaxy\storage\index.db
- not sure what the file storage spec is, but you can read FS2's install path in plain text.
EDIT2: The above is probably more reliable as the user might have changed the install location, but you can also find the normal GOG Library location in plain text from
%ProgramData%\GOG.com\Galaxy\config.json
EDIT3: of course that all relies on having Galaxy installed instead of using the stand-alone installer. The registry key I initially pointed out would be better in that case then? I dunno what's best, neither, both, or one then the other. If you need more tests / searches done, let me know and I can help.