NSIS MessageBox 跳转偏移量

NSIS MessageBox jump offset

如果 MessageBox returns IDNO.

,我无法理解以下跳转到特定偏移量的代码有什么问题

下面的代码是在选择 IDNO 时退出安装程序,但它总是跳转到 Goto endCurrentBlock

    MessageBox MB_YESNO|MB_ICONEXCLAMATION "Would you like to continue installation?" IDNO +3
    !insertmacro ShowStatus "Failed to install software"
    Goto endCurrentBlock
    Quit

如果我使用 absoule 标签进行跳跃,效果很好。可能是什么原因?

按偏移量跳转会跳过 x 条 NSIS 指令,但 !insertmacro 是一条预处理器指令,可能会扩展为零条、一条或多条 NSIS 指令。

不建议将偏移跳转和 !insertmacro 结合使用,因为它可以通过更改宏来破坏您的代码...