我有一个文件'releaseVersionNumber.txt',我在构建过程中读到了该文件; 目前它为我的Mac版本读取,但我想在我的Windows NSIS版本中读取它以减少编辑位置的数量(复制是邪恶的)...
所以我试图替换:
!define VERSION 1.2.3
Run Code Online (Sandbox Code Playgroud)
喜欢的东西
FileOpen $4 "..\releaseVersionNumber.txt" r
FileRead $4 $1
FileClose $4
!define VERSION ${1}
Run Code Online (Sandbox Code Playgroud)
但是我得到一个错误命令FileOpen在Section或Function之外无效.将它包装在函数中我生成的命令调用在Section或Function之外无效,所以我似乎无法在安装程序设置中执行此操作,仅在运行时.
有没有办法实现我追求的目标?!