I have an uninstall script that takes a custom parameter. After upgrading to 2.01, this script now fails to recognize the parameter. It seems that the GetParameters or $CMDLINE behaviour changed. I now get a trailing space in the returned string from GetParameters, which fails my StrCmp. I know I can add a space to my string, but this should be fixed internally if it is indeed a bug.
Thanks,
Jeremy.
MY Code:
Function un.onInitMY GetParameters (for uninstaller):
SetSilent silent
StrCpy $R0 ""
Call un.GetParameters
Pop $R0
MessageBox MB_OK "[$R0]" ; this shows [/D ]
StrCmp $R0 "/D" 0 GoCheckParm2 ; fails now because "/D"!="/D "
..do stuff..
GoCheckParm2:
..do stuff..
...snip...
Function un.GetParameters
Push $R0
Push $R1
Push $R2
Push $R3
StrCpy $R2 1
StrLen $R3 $CMDLINE
;Check for quote or space
StrCpy $R0 $CMDLINE $R2
StrCmp $R0 '"' 0 +3
StrCpy $R1 '"'
Goto loop
StrCpy $R1 " "
loop:
IntOp $R2 $R2 + 1
StrCpy $R0 $CMDLINE 1 $R2
StrCmp $R0 $R1 get
StrCmp $R2 $R3 get
Goto loop
get:
IntOp $R2 $R2 + 1
StrCpy $R0 $CMDLINE 1 $R2
StrCmp $R0 " " get
StrCpy $R0 $CMDLINE "" $R2
Pop $R3
Pop $R2
Pop $R1
Exch $R0
FunctionEnd