【发布时间】:2019-10-03 07:41:57
【问题描述】:
在我的要求中,我需要在运行时动态设置全局变量的值。我需要读取存储在文本文件中的产品名称,并在运行时将其设置为全局变量MyAppName 和MyAppVerName。例如:如果文本文件的值为Innovation,我的全局变量将如下文iss文件中所述:
#define MyAppName "ABC ProductName Database"
#define MyAppVerName "ABC ProductName Database 1.0.0"
这里的 ProductName 必须替换为 Innovation。从文件中读取文本并获取值部分对我来说很清楚。但是如何处理这个问题并为提到的全局变量动态设置值呢?
提前致谢!
【问题讨论】:
-
@MartinPrikryl,你是救星。 ver.txt 解决方案对我来说非常好。 ver.ini 文件解决方案仍然无法正常工作。有什么想法吗?
-
这有效
#define VerFile FileOpen("common\Global_Config.txt") #define AppVer FileRead(VerFile) #expr FileClose(VerFile) #undef VerFile,但失败#define AppVer ReadIni("common\GlobalConfig.ini", "Productname", "Product")。这是ini文件内容[Productname] Product=Innovation -
请针对您的新问题发布一个新问题。
-
@MartinPrikryl 完成!。 stackoverflow.com/questions/58231660/…
标签: inno-setup