how to detect in which country / region installer is running (offline)
Make a unique HTTP Get
request to your server while installing and from header detect its IP and from that resolve it to location.
provided that user is online
You should access registry key 'H_KEY_CURRENT_USER/Control Panel/International/sCountry' or possibly 'sLanguage'.
Note this will give you the cultural conventions and language the user wants rather the actual geographical loacation.
A possible alternative is 'H_KEY_CURRENT_USER/Software/Microsoft/Windows NT/TimeZones/TimeZoneKeyName' which may give you a clue as to the real location.
Otherwise you could use a web service like 'http://www.ip-adress.com/' which will tell you the location of the machines ISP, which may well be in a different country from the machine itself given the tortured topoloigy of some corporate networks.
What usually works best is to ask the user to "Select Country" from a pulldown menu.
You should not rely on registry values, they might be changed or removed from later version of Windows without further notice. I recommend to use Windows API GetLocaleInfo()
directly instead.
BTW, why do you want to do that? If you just want to make your installer automatically use a language corresponds to the language settings in the user's control panel, set LanguageDetectionMethod=locale
in the [Setup]
section.