Вопрос

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?

Это было полезно?

Решение

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)

Другие советы

!insertmacro MUI_PAGE_INSTFILES Execute the sections.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top