2017-12-21 13 views
0

나는 섹션 그룹을 가지고 있으며,이 그룹에는 4 섹션이 있습니다. 내가 원하는 것 : 그룹의 처음 두 섹션 만 읽기 전용으로 만들고, 나머지 부분은 제거 부분에 남겨 둡니다.NSIS의 섹션 그룹에 대해 읽기 전용으로 일부 섹션 만 만들려면 어떻게합니까?

Function un.onInit 
    !insertmacro SetSectionFlag ${firstUnSec} ${SF_RO} 
    !insertmacro SetSectionFlag ${secondUnSec} ${SF_RO} 
FunctionEnd 


SectionGroup "What to delete" groupsec 
    Section "un.First part" firstUnSec 
     Call "un.DropFirst" 
    SectionEnd 

    Section "un.Second part" secondUnSec 
     Call "un.DropSecond" 
    SectionEnd 

    Section "un.Third part" thirdUnSec 
     Call "un.DropThird" 
    SectionEnd 

    Section "un.Forth part" forthUnSec 
     Call "un.DropForth" 
    SectionEnd 
SectionGroupEnd 

그러나 그것은 단지 그룹을 읽기 전용 만들고, 그룹 내 모든 섹션은 선택 사항 :

내 코드는 다음입니다! 왜 그런가요?

감사합니다.

답변

1

섹션 인덱스를 사용하는 코드는 .NSI 파일의 섹션 자체 뒤에 와야합니다. 그것은 항상 읽기 전용 않다면

SectionGroup "What to delete" groupsec 
    Section "un.First part" firstUnSec 
     Call "un.DropFirst" 
    SectionEnd 
SectionGroupEnd 

Function un.onInit 
    !insertmacro SetSectionFlag ${firstUnSec} ${SF_RO} 
FunctionEnd 

당신은 당신이 컴파일시에 섹션 속성을 설정할 수 있습니다, 어떤 코드가 필요하지 않습니다

SectionGroup "What to delete" groupsec 
    Section "un.First part" firstUnSec 
     SectionIn RO 
     Call "un.DropFirst" 
    SectionEnd 
SectionGroupEnd 
+0

그래서 그 트릭입니다! 고맙습니다! – victorio