PDA

View Full Version : How to know the regionnal settings of user ?!



ChristopheOce
04-16-2007, 08:00 AM
Hi everybody,

I have a setup project made with installshield 11.5 windows and i d like to know if there is possible to know WHEN I REMOVE THE PROGRAM to know the regionnal settings of the users !?

i think it will be possible by script ?!
have tou got any sample ?!


Thanks to all
Christophe

RobertDickau
04-17-2007, 05:57 PM
What type of project? What regional settings do you want to retrieve? With MSI, for example, there are UserLanguageID, SystemLanguageID, and ProductLanguage properties that might be of use.

ChristopheOce
04-18-2007, 01:32 AM
Hi robert,

thanks you for your reply !

i've retrieve the language regionnal settings with script !
my project is a basic msi !

here is it my code :



NumToStr( szLang, LOWORD( SYSINFO.nUserLangID ) );
//szLang contains => 1033, 1040 or it all depends on language

/** SWITCH FOR TO HAVE THE LANGUAGE **/

switch (szLang)

//English
case "1033":
szMsg = "Please close the program before removing.";

//french
..............



I must to do that because when a user remove one of our product the user must be close the program before to remove the product !

thanks you for your information, for your time and so on !

Great product installshield but too big to learn all possibility !!!
Christophe

RobertDickau
04-18-2007, 08:19 AM
As an aside, could you use a string-table entry (which automatically resolves according to language) instead of a switch statement with multiple hard-coded strings?

ChristopheOce
04-18-2007, 08:26 AM
Hi robert,

Yes but is this possible for my problem !

i must to displays a warning message when someone try to remove one of our products !?

I've search a little perhpas :-) but in help i've find the fonction (SYSINFO.nUserLangID) and i think to do my action with this function will be the right think !

I'm a true beginner with IS !
have you good any solution ?!

Thanks in advvnce
Christophe

RobertDickau
04-18-2007, 08:44 AM
You can create new strings in the string table; each string-table entry has an identifier (which does not change between languages) and a value (which does change for each language).

In your InstallScript code, you should be able to use @STRING_ID instead of a hard-coded string. For example:

MessageBox(@MY_WARNING_MESSAGE, WARNING);

At run time, InstallShield should show the translated value from the appropriate string table.

ChristopheOce
04-18-2007, 09:02 AM
Oh my good !

i m so null !!!

you know i've try to search how to do that by script and coded some +- 20 lines of codes for that work and you ...just one line and it'"s ok !

I know i must to learn MANY MANY things with installshield but i like !

Thanks !

by the way, we have buy a book of installshield :

http://www.amazon.com/Official-InstallShield-Windows-Installer-Developers/dp/0764547232

we waiting all with impatience :-)

Thanks for all Robert
Christophe