Skip to content
⌘ NSIS Forum Archive

Conditional compilation based on an ini file

3 posts

Simbonino#

Conditional compilation based on an ini file

Hello, I'm trying to perform conditional actions at compile time based on a previous read value from an ini file.

Practically the compiler must read the value from an ini file and if this value is equal to the specified one it must add the folder and its contents, but if the value is different the folder must not be added. All this must happen at compile time.

How can I solve it? Thank you.
Anders#
The compiler does not know how to read ini files.

If this ini has the value just once in the file you can use !searchparse to extract it.

If the value appears in multiple sections then you probably need a real ini parser. You can use !system to execute external tools that create a .nsh file with a !define in it. If you want, the thing you execute can be a little NSIS installer...
Simbonino#
Originally Posted by Anders View Post
If this ini has the value just once in the file you can use !searchparse to extract it.

Anders I solved it, in the end I used !searchparse. Thank you very much.