diff --git a/IfKeyExists.nsh b/IfKeyExists.nsh new file mode 100644 index 0000000..5b95665 --- /dev/null +++ b/IfKeyExists.nsh @@ -0,0 +1,27 @@ +!include LogicLib.nsh +!macro IfKeyExists ROOT MAIN_KEY KEY + Push $R0 + Push $R1 + Push $R2 + + # XXX bug if ${ROOT}, ${MAIN_KEY} or ${KEY} use $R0 or $R1 + + StrCpy $R1 "0" # loop index + StrCpy $R2 "0" # not found + + ${Do} + EnumRegKey $R0 ${ROOT} "${MAIN_KEY}" "$R1" + ${If} $R0 == "${KEY}" + StrCpy $R2 "1" # found + ${Break} + ${EndIf} + IntOp $R1 $R1 + 1 + ${LoopWhile} $R0 != "" + + ClearErrors + + Exch 2 + Pop $R0 + Pop $R1 + Exch $R2 +!macroend diff --git a/Makefile b/Makefile index d6d3b85..425de6e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -NSIS=/cygdrive/c/Program\ Files\ \(x86\)/NSIS/makensisw.exe +NSIS=/cygdrive/c/Program\ Files\ \(x86\)/NSIS/makensis.exe SCRIPT=install.nsi OCAMLROOT=/cygdrive/c/ocamlmgw/ OCAMLROOTW=c:/ocamlmgw/