Old 28th November 2006, 22:25   #1
Jamyn
Junior Member
 
Join Date: Aug 2002
Location: Texas
Posts: 36
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.
Jamyn is offline   Reply With Quote
Old 29th November 2006, 00:20   #2
bholliger
Senior Member
 
Join Date: Jul 2004
Location: Switzerland
Posts: 223
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
bholliger is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump