0

when I was looking for an answer to how to find out if a Windows OS was 32bit or 64bit, I stumbled upon this other answer: Use NSIS to install 32bit... and used this code below.

!include x64.nsh

Function .onInit
    #Determine the bitness of the OS and enable the correct section
    ${If} ${RunningX64}
        SectionSetFlags ${SEC0000}  ${SECTION_OFF}
        SectionSetFlags ${SEC0001}  ${SF_SELECTED}
    ${Else}
        SectionSetFlags ${SEC0001}  ${SECTION_OFF}
        SectionSetFlags ${SEC0000}  ${SF_SELECTED}
    ${EndIf}
FunctionEnd

However, I run into this error:

!insertmacro: If
!insertmacro: macro named "_LOGICLIB_TEMP" not found!
Error in macro _RunningX64 on macroline 1
Error in macro If on macroline 5

I'm not sure what that's all about. I figured it might have been something to do with LogicLib.nsh, but I am using the exact same if, else statements else where in the same script and no issues there. So, it leads me to believe that its the x64.nsh library that is stopping me.

Community
  • 1
  • 1
FilBot3
  • 3,460
  • 6
  • 33
  • 55
  • Which NSIS version is this? – Anders May 14 '14 at 21:26
  • I was using 2.9, then I upgraded to 3.0. Got the error in both, but it was a problem with the library file I had. I needed this one, http://nsis.sourceforge.net/Include/LogicLib.nsh , the other lib file I had was completely wrong. – FilBot3 May 15 '14 at 13:10
  • 2.9 was released in 2005 and did not have a x64.nsh! – Anders May 15 '14 at 21:15

1 Answers1

0

I have never seen this error before. Your current code should work unless you happen to define LOGICLIB somewhere in your code before you include x64.nsh and/or LogicLib.nsh.

Try putting this at the top of your .nsi:

!ifdef LOGICLIB
!warning "LOGICLIB should not be defined here"
!undef LOGICLIB
!endif
!include LogicLib.nsh
!ifmacrondef _LOGICLIB_TEMP
!error "Corrupted LogicLib.nsh?"
!endif
!include x64.nsh
Anders
  • 97,548
  • 12
  • 110
  • 164
  • I got through this problem. What it was, is that I had a Library named hte same thing as I needed called LogicLib.nsh that was being called by x64 already. So, a friend of mine and I went looking for the correct one, and found it. Thank you for your help. – FilBot3 May 15 '14 at 13:07