From: SourceForge.net <no...@so...> - 2004-12-02 19:01:16
|
Bugs item #1077439, was opened at 2004-12-02 11:46 Message generated for change (Comment added) made by kichik You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373085&aid=1077439&group_id=22049 Category: Documentation Group: 2.0 Series Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Amir Szekely (kichik) Summary: nonstandatd behavior of example for command line parameters Initial Comment: In chapter "4.12 Silent Installers/Uninstallers" is example how to read and parse command line parameters. It expect that quotes will be in form: "/USERNAME=guest". I think that correct quotes using is /USERNAME="guest". Here is my macro for such parsing: !macro FindParam params paramName ${StrStr} $0 "${params}" "/${paramName}=" StrCmp $0 "" no${paramName} Push $1 Push $2 StrLen $1 "/${paramName}=" StrCpy $0 $0 "" $1 StrCpy $1 $0 1 StrCpy $2 " " StrCmp $1 '"' 0 notquo${paramName} StrCpy $2 '"' StrCpy $0 $0 "" 1 notquo${paramName}: ${StrStr} $1 $0 $2 StrLen $2 $0 StrLen $1 $1 IntOp $2 $2 - $1 StrCpy $0 $0 $2 Pop $2 Pop $1 no${paramName}: !macroend Example of use: Call GetParameters Pop $9 !insertmacro FindParam $9 "USERNAME" IfFileExists "$0" 0 skipUSERNAME ---------------------------------------------------------------------- >Comment By: Amir Szekely (kichik) Date: 2004-12-02 21:01 Message: Logged In: YES user_id=584402 If already updating, why not make it recognize both? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373085&aid=1077439&group_id=22049 |