Что то я не нашел описания для действий DropList, попробовал через NSIS Dialog Designer, какая дрянь этот Dialog Designer.
Прошу помощи?
читать дальше »
Код:
!include MUI2.nsh
!include WinMessages.nsh
SetCompressor lzma
XPStyle on
ShowInstDetails show
AutoCloseWindow false
Name "DropList"
OutFile "DropList_test.exe"
InstallDir "$TEMP\DropList test"
RequestExecutionLevel user
Var Dialog
Var Label
Var DropList
Var LngName
Page custom nsiCustomShow nsiCustomLeave
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE Russian
Function nsiCustomShow
!insertmacro MUI_HEADER_TEXT "Выбор установки" "Выберите способ установки и язык программы"
nsDialogs::Create 1018
Pop $Dialog
${NSD_CreateLabel} 174u 2u 60u 10u "Язык программы:"
Pop $Label
${NSD_CreateDropList} 240u 0u 50u 12u "DropList"
Pop $DropList
SendMessage $DropList ${CB_GETCOUNT} 0 0 $0
IntCmp $0 0 0 0 next
${NSD_CB_AddString} $DropList Russian
${NSD_CB_AddString} $DropList English
${NSD_CB_AddString} $DropList Ukrainian
next:
; Помнить выбранное в выподающем списке!
${Unless} $LngName == ""
SendMessage $DropList ${CB_FINDSTRING} -1 "STR:$LngName" $0
${If} $0 = -1
SendMessage $DropList ${CB_SETCURSEL} 0 0
${Else}
SendMessage $DropList ${CB_SETCURSEL} $0 0
${EndIf}
${Else}
SendMessage $DropList ${CB_SETCURSEL} 0 0
${EndUnless}
${NSD_OnChange} $DropList GetSelectedLng
nsDialogs::Show
FunctionEnd
Function GetSelectedLng
Pop $DropList
${NSD_GetState} $DropList $LngName
; ==========??????
FunctionEnd
Function nsiCustomLeave
${NSD_GetState} $DropList $LngName
FunctionEnd
Section Main # секция установки!
SetOutPath $INSTDIR
SetDateSave off
WriteUninstaller "$INSTDIR\unins000.exe" # создание деинстолятора
${If} $DropList = $LngName
WriteINIStr "$INSTDIR\Lng.ini" "Setting" "Language" $LngName
${EndIf}
DetailPrint "DropList - $DropList"
DetailPrint "LngName - $LngName"
Sleep 3000
ExecShell open "$WINDIR\notepad.exe" "$INSTDIR\Lng.ini"
SectionEnd
PS. примерно такое.
--