Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Printing the section's name during install? (http://forums.winamp.com/showthread.php?t=260628)

Jamyn 28th November 2006 22:25

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:

code:

!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.

bholliger 29th November 2006 00:20

Hi Jamyn!

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

code:

!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


All times are GMT. The time now is 17:47.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.