NSIS LogicLib参数失败

时间:2012-09-18 09:13:38

标签: parameters nsis

我正在尝试制作一个安装程序,在初始化安装程序时进行几项检查,例如检查您的窗口是否为64/32位。如果嵌入式安装程序在EXEDIR中。这是一段代码。

${If} ${RunningX32}
    MessageBox MB_OK "running on x32"
  ${AndIf} ${FileExists} "$EXEDIR\VDF2012-17.0.22.8.Client.exe" #32 bit version
    !insertmacro UnselectSection ${SEC02}
     SectionSetText ${SEC02} ""
    !insertmacro SelectSection ${SEC03}
  ${Else}
    !insertmacro UnselectSection ${SEC03}
      SectionSetText ${SEC03} ""
      MessageBox MB_OKCANCEL "${PRODUCT_NAME} misses the Visual DataFlex setup. \
                                      Do you wan't to download it?" IDOK true IDCANCEL false
        true:
          StrCpy $2 "$EXEDIR\VDF2012-17.0.22.8.Client.exe"
          inetc::get /caption "Downloading Visual DataFlex" /popup "" "ftp://ftp.dataaccess.com/pub/products/vdf/Software/VDF2012-17.0.22.8.Client.exe" "$EXEDIR\VDF2012-17.0.22.8.Client.exe" $2
          Pop $R0 ;Get the return value
          StrCmp $R0 "success" +3
          ExecWait $2
          Delete $2
        false:
    ${EndIf}

但是在第一行,代码已经给了我这个错误,我尝试了一切来解决它..

!insertmacro: _If
!insertmacro: macro "_If" requires 4 parameter (s), passed 2!
Error in script "Path" Aborting blabla...

我希望我能说清楚。

1 个答案:

答案 0 :(得分:1)

没有名为RunningX32的宏,您需要使用RunningX64宏:

!include x64.nsh

...

${IfNot} ${RunningX64}
  ...