Old 20th October 2011, 19:35   #1
tinytone
Junior Member
 
Join Date: Dec 2004
Posts: 8
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
tinytone is offline   Reply With Quote
Old 20th October 2011, 21:30   #2
Zinthose
Senior Member
 
Join Date: May 2009
Posts: 152
I threw this together and it works pretty well ^_^

PasteBin Post

Last edited by Zinthose; 20th October 2011 at 23:03.
Zinthose is offline   Reply With Quote
Old 21st October 2011, 02:43   #3
tinytone
Junior Member
 
Join Date: Dec 2004
Posts: 8
Quote:
Originally Posted by Zinthose View Post
I threw this together and it works pretty well ^_^

PasteBin Post
That's a keeper!

Thanks for the help.

-Tony
tinytone is offline   Reply With Quote
Old 21st October 2011, 03:08   #4
Zinthose
Senior Member
 
Join Date: May 2009
Posts: 152
You're most welcome.

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