Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   ReadINIStr Finding a Section name from an entry name? (http://forums.winamp.com/showthread.php?t=336325)

tinytone 20th October 2011 19:35

ReadINIStr Finding a Section name from an entry name?
 
I've got an INI file that looks like this:


[DevCppLang]
Name=Dev-C++ Language
Description=The language files for the wxDev-C++ IDE.
RemoteFilename=Language.DevPak
LocalFilename=Language.DevPak
Group=IDE
InstallPath=
Version=7.3.1.1
Size=315483
Date=2011-01-19 19:02
Execute=1


I can use ReadINIStr to find the value of the version for section [DevCppLang], but what I'd like to do is to find the version based on the LocalFilename field. For example,I'd like to do something like:

FindINIStr $0 $INIfilename 'LocalFileName=Language.DevPak' 'Version'

which will return 7.3.1.1 to $0.

Does something like this exist? Or, can someone suggest a solution?

Thanks.
-Tony

Zinthose 20th October 2011 21:30

I threw this together and it works pretty well ^_^

PasteBin Post

tinytone 21st October 2011 02:43

Quote:

Originally Posted by Zinthose (Post 2811524)
I threw this together and it works pretty well ^_^

PasteBin Post

That's a keeper!

Thanks for the help.

-Tony

Zinthose 21st October 2011 03:08

You're most welcome. :D

The only issue with it is were I put "## WARNING ASSUMTIONS MADE HERE"
Hopefully you won't run it against any INI files that have a lot of long section names. If you do you will have to expand the buffer size within the function. See the GetPrivateProfileSectionNames API function's reference for details.


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

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.