Archive: Please, test this code


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

That works great for me - running WinXP-Pro

"United Kingdom"

-Stu :)


Thanks Afrow :)
Hope to work in Win9x and WinME
Tested in Windows 2000 Pro, already :D


I will test on Win98.


Ack.
It doesn't work on Win98.

I will search the registry...

-Stu


HKEY_CURRENT_USER\Software\Microsoft\User Location Service\Client

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


-Stu


It's suppose to be the complete String...
Maybe I'll work only at NT OS machines...
I'll search more...


I'm sure System would work somewhere for this?

-Stu


Try this:


ReadRegStr $1 HKU ".DEFAULT\Control Panel\International" "sCountry"

Sorry no :(


Well...I'll submit but warning that only will work on
NT Systems


You could add a bit:
StrCmp $R0 "" 0 +2
StrCpy $R0 "Unknown Country"

-Stu


I wait a little bit...
I try another way...
If not, I'll do that...
Thanks dude :)


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

Yes it Works.. :)
But I was trying without the plugin...
I'm testing...if not working, I'll submit with the plugin...
Thanks....


Maybe this helps:

http://msdn.microsoft.com/library/de...l/nls_8rse.asp


Trying Monki code with few adds...
Please try it...


Works ok for me