NSIS pages and sections execution
Asked Answered
S

2

5

probably I am not getting basics of pages and sections in nsis script.

I have to analyse installation script which was not made by me. In the top of the script there are macros of MUI pages for example

!insertmacro MUI_PAGE_LICENSE $(license)
!insertmacro MUI_PAGE_INSTFILES ....

And then further down the code there are sections

Section "MainSection" SEC01

  SetShellVarContext current

  SetOutPath "$INSTDIR"
  SetOverwrite ifnewer
  File "${xy_TEMP_SRC}\InstallSrc\xy.exe"
  File "${xy_TEMP_SRC}\InstallSrc\xy.exe.config"

  SetOutPath "$INSTDIR\sk"
  File "${xy_TEMP_SRC}\InstallSrc\sk\xy.resources.dll"

  SetOutPath "$INSTDIR"

  CreateDirectory "$SMPROGRAMS\xy"
  CreateShortCut "$SMPROGRAMS\xy\xy.lnk" "$INSTDIR\xy.exe"
  CreateShortCut "$DESKTOP\xy.lnk" "$INSTDIR\xy.exe"

SectionEnd  
+ another sections for instance unninstall section

My question is how and when the sections are executed when there is no reference from pages to the sections.

My brain is telling me that the sections should be executed sometimes during the pages confirmation during the installation process, but I guess it's wrong, so please can anyone tell me how it actualy works?

Shep answered 8/3, 2013 at 12:13 Comment(0)
Q
8

All sections are executed on the instfiles page and in the order of your sections. If you need stuff to be executed before, after or in between, you can use functions (e.g. pre- or leave functions)

Quintet answered 8/3, 2013 at 12:38 Comment(0)
O
5

!insertmacro MUI_PAGE_INSTFILES Execute the sections.

Outdoors answered 8/3, 2013 at 12:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.