Menu

#1222 macro InstallLib fails

3.0 Series
closed
nobody
None
5
2019-03-19
2019-03-14
DvH
No

With version 3.04 I have an issue with the InstallLib macro. I get the error:

IntCmpU expects 3-5 parameters, got 7.
Usage: IntCmpU val1 val2 jump_if_equal [jump_if_val1_less] [jump_if_val1_more]
Error in macro __InstallLib_Helper_CmpPackedVer64 on macroline 2
Error in macro InstallLib on macroline 135

It seems like the change https://sourceforge.net/p/nsis/code/7014/tree//NSIS/trunk/Include/Library.nsh?diff=6913 caused this trouble. If I manually modify my local Library.nsh to rewind the change, it just works fine.

The call to the macro within my scipt looks like this:

!insertmacro InstallLib REGDLL 0 REBOOT_NOTPROTECTED "MyComponent.ax" "$INSTDIR\MyComponent.ax" $INSTDIR

I use the plugins AccessControl and nsSCM, but I think this does not matter in this case.

Version 3.03 works just fine...

Discussion

  • Anders

    Anders - 2019-03-14

    I'm guessing your .NSI path has a space in it? Try quoting the two IntCmpU instructions in the macro.

     
  • DvH

    DvH - 2019-03-15

    I don't think the problem is caused by the name of my nsi-file. No changes were made on that side for a long time. And with version 3.03 there is no problem at all.

    In case, if I exchange the indirection using InstallLib_Helper_CmpPackedVer64and instead insert the direct call of IntCmpU like in the revision before the mentioned change within Library.nsh, it again works fine. So, if I exchange

    !ifdef LIBRARY_INSTALL_EQUAL_VERSION
    
         !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 "installlib.upgrade_${INSTALLLIB_UNIQUE}" \
                "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}"
    
    !else
    
           !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 "installlib.register_${INSTALLLIB_UNIQUE}" \
                "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}"
    
    !endif
    

    with the former code from the previous commit again

    IntCmpU $R0 $R2 0 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}"
    IntCmpU $R1 $R3 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.register_${INSTALLLIB_UNIQUE}" \
         "installlib.upgrade_${INSTALLLIB_UNIQUE}"
    

    it seems to be ok again. So somehow calling the macro InstallLib_Helper_CmpPackedVer64 the parameters get screwed.

    As Library.nsh is something shiped as content of the NSIS-Setup, I do not want to change too much there. And currently I do not understand the calling convention and why the parameter content changes...

     
    • Anders

      Anders - 2019-03-15

      I know 3.04 introduces a change but I did not see the bug on my side which is why I believe a space triggers it.

       
  • DvH

    DvH - 2019-03-15

    I am not quite sure if I understand your comment right...
    You did not see the bug on your side and now you do?

    If it helps I can reproduce the situation - reinstall 3.04 - if necessary. Then I can try to give you more information. In case you want me to quote parameters in a macro, can you tell me exactly were and what to quote?

     
    • Anders

      Anders - 2019-03-15

      I just meant that I did not see the problem when I changed things for 3.04 because I did not have a space in the path.

      !macro __InstallLib_Helper_CmpPackedVer64 oldhi oldlo newhi newlo jeq jle jgt
      
        IntCmpU ${oldhi} ${newhi} "0"      "${jle}" "${jgt}"
        IntCmpU ${oldlo} ${newlo} "${jeq}" "${jle}" "${jgt}"
      
      !macroend
      

      should fix it.

       
  • DvH

    DvH - 2019-03-15

    Your were right, that change seems to solve the problem. Thanks

     
  • DvH

    DvH - 2019-03-15

    Actually I would be interrested in one more thing. When I tried to fix the problem myself I basically just had the problem to display the content of the variables to a certain moment.
    What would you recommend how to do that? I tried !echo, !warning, !error etc., but I could not get the runtime to actually print out the variable content...

     
    • Anders

      Anders - 2019-03-15

      Depends on what you are talking about when you say variable:

      !error "x=${x}" ; Define
      MessageBox mb_ok "x=$x" ; Variable
      
       

      Last edit: Anders 2019-03-15
      • DvH

        DvH - 2019-03-19

        Ah, ok ... I think I start to understand...
        Thank you

         
  • DvH

    DvH - 2019-03-19

    Ok, I think this issue is solved. As I see you already changed the code in revision https://sourceforge.net/p/nsis/code/7092/

    Are you closing this ticket? I do not see any way to do that myself.
    And thank you for your fast respond.

     
    👍
    1

    Last edit: DvH 2019-03-19
  • Anders

    Anders - 2019-03-19
    • status: open --> closed
     

Log in to post a comment.