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?
A block of commands "executed in order by the resulting installer." "If [Attribute] ComponentText is set, the user will have the option of disabling/enabling each visible section. If a section's name is 'Uninstall' or is prefixed with 'un. ', it's an uninstaller section."
Nullsoft Scriptable Install System (NSIS) is a script-driven installer authoring tool for Microsoft Windows backed by Nullsoft, the creators of Winamp. NSIS is released under a combination of free software licenses, primarily the zlib license.
To compile you can right-click your . nsi file and select Compile NSIS Script. This will cause MakeNSISW, the NSIS Compiler Interface, to launch and call MakeNSIS to compile your script.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With