セットアップが実行されている OS をテストするには、Winver.nsh
提供されているマクロで定義されたマクロを使用しLogicLib.nsh
て、このような洗練されたテストを作成できます。
;Dont't forget to include
!include "LogicLib.nsh" # use of various logic statements
!include "WinVer.nsh" # LogicLib extension for OS tests
プラットフォーム テストの例:
${if} ${AtLeastWin95}
${AndIf} ${AtMostWinME}
;here we are on a pre-win2k
;do something
${elseIf} ${isWin2008}
${orIf} ${AtLeastWin2008R2}
;this is post-win7
;do other thing
${endif}
インストールするコンポーネントを実行時に変更するには、次のマクロを使用できますSections.nsh
。
;if you have
Section "Sample Database" SecApplicationDB
;...
SectionEnd
;you can select or un select by code:
!insertmacro SelectSection ${SecApplicationDB}
;or
!insertmacro UnselectSection ${SecApplicationDB}