Skip to content
⌘ NSIS Forum Archive

Name of Section from TXT file

5 posts

kukymann#

Name of Section from TXT file

Hi, i have 25 sections, and i need put name for all Sections and Subsections from txt file.
Structure this file is:
title.txt

title=01 section
For all sections is one directory with one txt file "title.txt"
Structure directory is:

Root
|
install.exe
|- 01
| |- title.txt
|
|- 02
| |- title.txt
...
|- 25
|- title.txt

My solution:

Section "$1"
SectionEnd

Section "$2"
SectionEnd

Function .onInit
FileOpen $R1 "$EXEDIR\01\title.txt" r
FileRead $R1 $R2
StrCpy $1 $R2 "" 6
FileClose $R1

FileOpen $R1 "$EXEDIR\02\title.txt" r
FileRead $R1 $R2
StrCpy $2 $R2 "" 6
FileClose $R1

FunctionEnd
But this is not good, because user variables is only 20, and i have 25 sections. So, what can i do? Any reason? Thx
Vytautas#
If your are using the latest version of NSIS 2.0b4(CVS) it has support for unlimited user variables, see the 'var' command in the readme file.

Vytautas
Vytautas#
You can get the latest version here however you should note that you will most likely have to modify your existing scripts to work with the newer version of NSIS.

Vytautas