Archive: How to set a silent install language?


How to set a silent install language?
Hello,

I'm currently trying to get the default language to be definable via the command line for a multilingual silent install. I can get my parameter parsed out of the command line just fine, however, when I set it in the silent section, I can messagebox it out as the right value but it's not using my language specific strings. And as documented when I attempt to set $LANGUAGE in .OnInit, it doesn't take affect. Could someone show me the light! ;)

P.S., here's a code snippet, that I have placed in .oninit to see if it would work as well as in the very first section defined in my soucre called "-Silent". I know for a fact that my GetParameterValue function works properly.

; load language from command line /L=1033
; foo.exe /S /L=1033 /D=C:\Program Files\Foo
; or:
; foo.exe /S "/L=1033" /D="C:\Program Files\Foo"
IfSilent 0 lbl_NotSilent
; GPV SWITCH DEFAULT, return value, defined value or specified default
!insertmacro GetParameterValue "/L=" "1033"
pop $R0
StrCmp "$R0" "2052" 0 +3 ; Simplified Chinese
StrCpy $LANGUAGE "2052"
goto lbl_langDefined
StrCmp "$R0" "1034" 0 +3 ; Spanish
StrCpy $LANGUAGE "1034"
goto lbl_langDefined
StrCmp "$R0" "1036" 0 +3 ; French
StrCpy $LANGUAGE "1036"
goto lbl_langDefined
; use default English
StrCpy $LANGUAGE "1033" ; English
lbl_langDefined:
lbl_NotSilent:


Cheers,

ZIMSMS


Setting $LANGUAGE should work fine. You can use language strings in sections etc.


Where would the best place to set $LANGUAGE be? As I stated I tried both...


$LANGUAGE should always be set in .onInit.