Skip to content
⌘ NSIS Forum Archive

How can I enumerate INI keys ?

6 posts

Yovav#

How can I enumerate INI keys ?

Hi all.

I'm trying to load some "default" options to registry when installing,

I need to get an INI file that can be defined by the user,
so I don't yet know what would the INI key names will be,

is there a way to go through all the INI file keys (one by one) ?
Joost Verburg#
You have to write a plug-in or manually call GetPrivateProfileString using the System plug-in.
n0On3#
You can read the ini file like a normal file (with FileOpen, FileRead and so on), search for the '=' character and work from there
Yovav#
10X 4 the help.

Hi,

I finally found some workaround for that,

I read the ini file in a loop,
and reading the key name + the index
until read fails, the only "problem" with this is that I have to
write the number on the key name (which is not that bad):

[edited by kichik]please attach large scripts. attached below 👎[/edit]
Afrow UK#
Use this to remove everything after the "=" sign:



You just need to replace " " with "="

-Stu