2012-01-06 7 views
0

ROに設定されているSectionがあり、特別な場合を除いてすべてInstTypeに発生します。特定のInstTypeのセクションのみを無効にするにはどうすればいいですか?

InstTypeを最初に選択し、InstTypeとして「カスタム」を選択すると、セクションはチェックされず、「カスタム」InstTypeで再度チェックすることはできません。

ユーザーが「カスタム」InstTypeを選択したときに、常にSectionが再度チェックされることを除いて、すべてが問題ありません。

InstType特別使用の場合のみ、チェックをはずす必要があります。

どうすればこの問題を解決できますか?

答えて

1

あなたは.onSelChangeで好きなロジック強制することができます:

!include WinMessages.nsh 
!include LogicLib.nsh 
!include Sections.nsh 

Page Components 
Page InstFiles 

InstType "Normal1" 
!define CIT_Special 1 
InstType "Special" 
InstType "Normal2" 

Section Foo 
SectionIn 1 2 3 
SectionEnd 

Section Bar SEC_Special 
SectionIn 1 3 
SectionIn RO 
SectionEnd 

Section Baz 
SectionIn 1 2 ;3 << Not the same as Foo just to have some sort of difference 
SectionEnd 

Function .onSelChange 
;Normally you would call GetCurInstType here, but it seems we need a little hack to detect the custom section 
FindWindow $1 "#32770" "" $HWNDPARENT 
GetDlgItem $1 $1 0x3F9 
SendMessage $1 ${CB_GETCURSEL} 0 0 $2 
SendMessage $1 ${CB_GETITEMDATA} $2 0 $2 
${If} $2 = ${CIT_Special} 
    !insertmacro UnselectSection ${SEC_Special} 
${Else} 
    !insertmacro SelectSection ${SEC_Special} 
${EndIf} 
FunctionEnd 
+0

はGetCurInstTypeの動作は仕様です、それは必ずしもコンボボックスの選択と同じではありません、現在はInstTypeを返し判明します。 – Anders