Archive: Strange GetOptions behaviour


Strange GetOptions behaviour
Hi,
First hello to everyone here, I'm new and I really appreciate NSIS. I used Vise in the past and I decided to move forward by using NSIS.
I already spend a full week on it to understand its behaviour.
I'm very excited about it ! I really enjoy all those nice features.

I have a question about GetOptions as I don't really get my problem...

I decided to write a macro to get the value of command line parameters.

My code:

!macro RecupPrm Prm
Push $4
${GetParameters} $R5
${GetOptions} "$R5" ${Prm} $4
StrCpy $Parametre $4 "" 1
DetailPrint "Param:${Prm}-Val:$Parametre"
Pop $4
!macroend

!insertmacro RecupPrm USER ; called in Main section
I'm executing my exe:
setup.exe /HOST1=HOME /USER=alex /PAL=bill

But in my detail info screen, the value displayed for USER is not 'alex' but 'alex /PAL=bill' !!

I'm wrong somewhere but where ?
I have to get many parameters that's why I decided to use a macro, but maybe it doesn't work in this case...?
Thank you !

!insertmacro RecupPrm /USER=

Syntax Error:

    !macro RecupPrm Prm
Push $4
${GetParameters} $R5
${GetOptions} $R5 "${Prm}=" $4
StrCpy $R0 ${prm} '' 1
DetailPrint "Param:$R0 -- Val:$4"
Pop $4
!macroend

!insertmacro RecupPrm /USER ; called in Main section


Thank you very much!
IT works like a charm now :)