This is a clarification required to the existing post mentioned below
How to declare an Inno Setup preprocessor variable by reading from a file
Reading value from .txt
file using FileOpen
works perfectly fine, while reading .ini
file using ReadIni
returns an empty string.
The code for reading from txt file is:
#define VerFile FileOpen("common\GlobalConfig.txt")
#define AppVer FileRead(VerFile)
#expr FileClose(VerFile)
#undef VerFile
The txt file has the string Innovation.
The code for reading from ini file is:
#define AppVer ReadIni("common\GlobalConfig.ini", "Productname", "Product")
The content of the ini file is:
[Productname]
Product=Innovation
Both the files are in the same folder location.
The file is encoded with UTF-8 without BOM. I've checked with other types of encoding too, but it is returning only empty. I created with Notepad++.
Thanks in advance!