Inno Setup preprocessor can read a file using FileOpen, but not using ReadIni

前端 未结 1 400
时光取名叫无心
时光取名叫无心 2021-01-16 01:10

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 fro

相关标签:
1条回答
  • 2021-01-16 01:50

    The relative paths in ReadIni are resolved to the current working directory, what particularly in Inno Setup IDE is not the script directory.

    Use absolute paths by using SourcePath predefined variable:

    #define AppVer ReadIni(SourcePath + "\common\GlobalConfig.ini", "Productname", "Product")
    

    For FileOpen ISPP does that automatically, but not for ReadIni.


    While not your case, another possibility is that there's something wrong with the INI file. It has to be UTF-8/ASCII without BOM or UTF-16 LE (with or without BOM).

    0 讨论(0)
提交回复
热议问题