Skip to content
⌘ NSIS Forum Archive

Please, test this code

18 posts

Joel#

Please, test this code

Hi you all... Please test this code in your PC...
It's suppost to retrive the user's country.. thanks...

OutFile "UserCountry.exe"
Name "Detect User Country"
Caption "Detect user Country"
XPStyle "on"

Function GetCountry
ReadRegStr $1 HKCU "Control Panel\International" "sCountry"
MessageBox MB_OK|MB_ICONINFORMATION $1
FunctionEnd

Function ".onInit"
Call "GetCountry"
Quit
FunctionEnd


Section "-boo"
;
SectionEnd
Afrow UK#
HKEY_CURRENT_USER\Software\Microsoft\User Location Service\Client

That's another one I found, but the value was GB not Great Britain.


-Stu
Joel#
It's suppose to be the complete String...
Maybe I'll work only at NT OS machines...
I'll search more...
MoNKi#
Lobo Lunar, try with this:

Function GetCountry
System::Call 'kernel32::GetLocaleInfoA(i 1024, i 6, t .r1, i ${NSIS_MAX_STRLEN}) i r0'
MessageBox MB_OK|MB_ICONINFORMATION "$1"
FunctionEnd
Joel#
Yes it Works.. 🙂
But I was trying without the plugin...
I'm testing...if not working, I'll submit with the plugin...
Thanks....
MoNKi#
Maybe this helps: