NSIS-结合使用偏移量!插入宏

NSIS-结合使用偏移量!插入宏,nsis,Nsis,我被迫在我的安装程序中使用如下标签: IfFileExists "$INSTDIR\XX\*.*" XX_Found 0 !insertmacro UnselectSection ${Section_XX} XX_Found: IfFileExists "$INSTDIR\YY\*.*" YY_Found 0 !insertmacro UnselectSection ${Section_YY} YY_Found: 因为这些都不起作用: IfFile

我被迫在我的安装程序中使用如下标签:

  IfFileExists "$INSTDIR\XX\*.*" XX_Found 0
      !insertmacro UnselectSection ${Section_XX}
  XX_Found:

  IfFileExists "$INSTDIR\YY\*.*" YY_Found 0
      !insertmacro UnselectSection ${Section_YY}
  YY_Found:
因为这些都不起作用:

  IfFileExists "$INSTDIR\XX\*.*" +2 0
      !insertmacro UnselectSection ${Section_XX}

  IfFileExists "$INSTDIR\YY\*.*" +2 0
      !insertmacro UnselectSection ${Section_YY}

有人提议为什么?我想这是因为!insertmacro语句,但我在internet上找不到任何信息或解决方法。

不能在宏上使用相对跳转,因为宏可以包含多条指令<代码>!insertmacro基本上粘贴
的内容!宏
在第一个编译器阶段插入到代码中

我更喜欢使用LogicLib:

!include LogicLib.nsh
Section
${If} ${FileExists} "$InstDir\file.ext"
  !insertmacro ...
${EndIf}
SectionEnd

您还可以使用标签跳过
!insertmacro

这很有意义。我只是用f${IfNot}代替了f${If}。谢谢