2017-12-21 4 views
0

私にはセクショングループがあり、このグループには4つのセクションがあります。 必要なもの:グループの最初の2つのセクションだけを読み取り専用にし、残りはオプションのままアンインストールパートに残します。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

関連する問題