1

我正在尝试制作一个安装程序,该安装程序在初始化安装程序时会进行多项检查,例如检查您的 Windows 是否为 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...

我希望我说清楚了。

4

1 回答 1

2

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

!include x64.nsh

...

${IfNot} ${RunningX64}
  ...
于 2012-09-18T12:26:55.930 回答