views:

133

answers:

2

I'm working with a very old installer that can read Registry entries but has a difficulty (complex) time executing Windows APIs.

I'm trying to detect whether the PC it's being installed on is in Australia.

Any ideas?

+1  A: 

This key:

HKEY_USERS.DEFAULT\Keyboard Layout\Preload

sets the default language for the login screen

The different country codes are listed here:

http://www.windowsitpro.com/Article/ArticleID/14867/14867.html

Techboy
I don't think that'll work.There's an error in that code. They refer to a key \Preload1 but it's \preload\1 . And you can have multiple preloads (English-usa, english-australian). I changed the language from usa to aussie and it didn't change 1, it just created another key ("1") set to aussie.
Clay Nichols
A: 

From my testing and the MSDN page below, this will work:

HKEY_CURRENT_USER\Control Panel\International\sCountry ="Australia"

This corresponds to setting in the Region Options ("Select an item to match it' preferences".

http://support.microsoft.com/kb/102978

This has the advantage of also being able to be read from a non-admin account.

Clay Nichols