Archive: Bug: StrCmp + MUI_LANGDLL_DISPLAY


Bug: StrCmp + MUI_LANGDLL_DISPLAY
Hello,

I´ve a problem with the following code in onInit:

---------------
StrCmp $IsUpdate False +1 +2
!insertmacro MUI_LANGDLL_DISPLAY
---------------

I want to show the language dialog if the installation is not an update. But it doesn´t matter which value $IsUpdate has.

If the variabel $IsUpdate is true or false the code "!insertmacro MUI_LANGDLL_DISPLAY" will be executed every time.

The next code works, but it is not really correct because the last line will be skipped if there is any code:

---------------
StrCmp $IsUpdate False +1 +3
!insertmacro MUI_LANGDLL_DISPLAY
---------------


This works to correctly without any problems:

---------------
StrCmp $IsUpdate False ShowLanguageDialog DontShowLanguageDialog

ShowLanguageDialog:
!insertmacro MUI_LANGDLL_DISPLAY

DontShowLanguageDialog:
---------------

Is the first version a bug?

Best regards

Rainer



StrCmp $IsUpdate False +1 +2

What is False?

you can't do relative jumps over a macro, you don't know how many instructions the macro has, so you must use labels or even better, logiclib.nsh:

${If} $IsUpdate == "False"
!insertmacro xxxxx
${EndIf}


Hello,

yes you are right. I though that +1 is a relative jump so that the macro code should be ignored. Now I use Labels...

Kind regards

Rainer