IF-condition gives back error macro "_If" requires 4 parameter(s), passed 3!
Hi all,
I try to compile an NSIS script for a software I'd like to deploy. It is an addition to an allready installed software, so I want to determine the installation path via registry. The information is stored in different places for x64 and x86 machines, so I need to use an If clause.
I was googleing around for several hours and didn't find a working solution. Also I couldn't find a solution on the forums (even by using the suggestions mentioned in the "How to find the answer (READ ME FIRST)"-Thread ;)). But I am sure that you can help me :)
I found several ways to check if the system is x64 when looking for a solution, like using winver.nsh or many other possibilities.
Here i'd like to show you my initial script which I guess will work as well as winver.nsh. I guess I did something wrong concerning the IF condition:
>Function .onInit
ClearErrors
!include 'LogicLib.nsh'
; Check if x64 via determining if wow6432node key exists
EnumRegKey$0 HKLM "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node" 0
${If} 0 keyexist
InstallDirRegKey HKLM "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\BLA" "InstallPath"
${Else}
InstallDirRegKey HKLM "HKEY_LOCAL_MACHINE\SOFTWARE\BLA" "InstallPath"
${EndIf}
>FunctionEnd
>
So far so good.When trying to compile I get this error:
Please please tell me what I am doing wrong!".onInit"
insertmacro: _If
>ClearErrors
EnumRegKey$0 HKLMHKEY_LOCAL_MACHINESOFTWAREWow6432Node(default)
!
>***91;COLOR="SandyBrown"***93;!insertmacro: macro "_If" requires 4 parameter(s), passed 3!***91;/COLOR***93;
>Error in script "E:\Fischi\Downloads\WORKDIR\trp_101_with_REG_nsis_DH_mui.nsi" on line 25 -- aborting creation process
>
Thanks in advance,
Dendro.