When I use script like this it's ok:
...
!define MUI_PAGE_CUSTOMFUNCTION_PRE onlymodeA
!insertmacro MUI_UNPAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
!define MUI_PAGE_CUSTOMFUNCTION_PRE onlymodeA
!insertmacro MUI_UNPAGE_INSTFILES
...
But when I use this one script I've got error - !define: "MUI_UNPAGE_CUSTOMFUNCTION_PRE" already defined!
...
!define MUI_UNPAGE_CUSTOMFUNCTION_PRE un.onlymodeA
!insertmacro MUI_UNPAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
!define MUI_UNPAGE_CUSTOMFUNCTION_PRE un.onlymodeA
!insertmacro MUI_UNPAGE_INSTFILES
...
What's the difference?
The MUI_PAGE_CUSTOMFUNCTION_*
defines are per-page and the !insertmacro call that creates the page will undefine MUI_PAGE_CUSTOMFUNCTION_*
after using their contents. MUI_UNPAGE_CUSTOMFUNCTION_PRE
is not a MUI define and will remain after the macro and when you try to define it again you get a normal compiler error...