Archive: Printing the section's name during install?


Printing the section's name during install?
Hi all,

I have a map installer with ~ 180 sections. The section names describe the item being installed (like "Assault: AS-UF4-Incursion"). What I would like to do is print the section name during install with DetailPrint. Like:


!macro PRINT MYTEXT
SetDetailsPrint both
DetailPrint "${MYTEXT}"
SetDetailsPrint none
!macroend

Section "Really Fun Map" SEC000
...
!insertmacro PRINT "Installing: ${SECTIONNAME}"
...
SectionEnd


This would cut down on the amount of typing. I am still sifting through the docs to see if there is a variable that holds the current section name during install, but so far I haven't run across anything. Any ideas on this? Thanks all.

Hi Jamyn!

You could use this code to get the sectionname with SectionGetText. You "only" have to introduce a line with the sections index.


!macro PRINTSECTIONNAME SEC
Push $R0
SectionGetText ${SEC} $R0
DetailPrint $R0
Pop $R0
!macroend

Section A secA
!insertmacro PRINTSECTIONNAME ${secA}
SectionEnd

Section /o B secB
!insertmacro PRINTSECTIONNAME ${secB}
SectionEnd


Cheers

Bruno