Search code examples
parametersnsis

NSIS LogicLib Parameters failure


I am trying to make an installer that does a several checks at the initializing of the installer such as checking if your windows is 64/32 bit. and if the embedded installer is in the EXEDIR. Here is the piece of code.

${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}

But at the very first line the code is already giving me this error and I tried everything to fix it..

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

I hope I made myself clear.


Solution

  • There is no macro named RunningX32, you need to use the RunningX64 macro:

    !include x64.nsh
    
    ...
    
    ${IfNot} ${RunningX64}
      ...