Skip to content
⌘ NSIS Forum Archive

Problems with a select box

3 posts

CPIbilly#

Problems with a select box

Hi all,

sorry my english is not the best :-)

ive got a problem wir a select box during the install.

the user can select "Master", "Wave" and "Cpos" and then the script has to wirte in the cpos.ini "0", "1" or "2".
not the clear text.

so here my try but it isnt working.

!insertmacro MUI_INSTALLOPTIONS_READ $0 "ioGeneral.ini" "Field 2" "State"
StrCmp $0 "Master" +1
StrCpy $1 "2"
StrCmp $0 "Wave" +1
StrCpy $1 "1"
StrCmp $0 "cPOS" +1
StrCpy $1 "0"
WriteINIStr $INSTDIR\cpos.ini Options VolumeControl $1

the setting is after the setup everytime at "0" for cPOS the last option.

thanks for help.

with regards
philipp
Afrow UK#
There are two problems with your current code, FYI, +1 is the same as 0 (i.e. jumps to the proceeding instruction (you'd need +2)) and also you should have a Goto after each StrCpy to jump to the end.

Just use ${If}, ${ElseIf} and ${EndIf} from LogicLib.nsh.

Stu