Installation NSIS GetParent functon引发未知错误

Installation NSIS GetParent functon引发未知错误,installation,nsis,Installation,Nsis,在我的NSIS安装程序脚本中,我试图使用在FileFunc.nsh中定义的GetParent宏,但我遇到了一个奇怪的错误。有人知道为什么吗 这是我的脚本代码 !include "FileFunc.nsh" Section ${GetParent} "$INSTDIR" $parentDir SectionEnd 我得到的错误是: !insertmacro: GetParentCall Usage: Pop $(user_var: output) Error in macro GetPa

在我的NSIS安装程序脚本中,我试图使用在FileFunc.nsh中定义的GetParent宏,但我遇到了一个奇怪的错误。有人知道为什么吗

这是我的脚本代码

!include "FileFunc.nsh"

Section
   ${GetParent} "$INSTDIR" $parentDir
SectionEnd
我得到的错误是:

!insertmacro: GetParentCall
Usage: Pop $(user_var: output)
Error in macro GetParentCall on macroline 5

我正在使用NSIS 2.46

尚未声明
$parentDir
变量,请尝试:

!include "FileFunc.nsh"
Var parentDir    

Section
   ${GetParent} "$INSTDIR" $parentDir
SectionEnd

默认情况下,只有$0..$9、$R0..$R9和少数其他($instdir等)记录的变量存在。

2.46旧版,升级到v3或至少2.51!谢谢,但不幸的是,我不得不使用这个版本(遗留代码项目)。2.51应该与2.46完全兼容。最有可能的情况是(对于v3.x的afaik API也没有更改),但在发布之前更改版本仍然太危险(如果有什么问题,我将承担责任):)啊!!谢谢,这完全有道理。一旦我回到办公室,我会得到一个答案(并向上投票),如果它起作用的话,但这看起来像是罪魁祸首。啊!为帮助干杯!