logiclib.nsh problem
I am trying to use the logiclib.nsh file in one of my installer's but I can seem to get it to work correctly
I am using to use the getparameters function to get the commandline argument that I specify then use the logiclib to execute different messageboxes, but everytime I execute this no matter what variable I use it always goes thru the "CS" Section.
below is an example of my code
Can someone help with this or is there a better way to do this.
; The name of the installer
Name "setup"
; The file to write
SilentInstall silent
!include "logiclib.nsh"
OutFile "setup.exe"
Function GetParameters
Push $R0
Push $R1
Push $R2
StrCpy $R0 $CMDLINE 1
StrCpy $R1 '"'
StrCpy $R2 1
StrCmp $R0 '"' loop
StrCpy $R1 ' ' ; we're scanning for a space instead of a quote
loop:
StrCpy $R0 $CMDLINE 1 $R2
StrCmp $R0 $R1 loop2
StrCmp $R0 "" loop2
IntOp $R2 $R2 + 1
Goto loop
loop2:
IntOp $R2 $R2 + 1
StrCpy $R0 $CMDLINE 1 $R2
StrCmp $R0 " " loop2
StrCpy $R0 $CMDLINE "" $R2
Pop $R2
Pop $R1
Exch $R0
FunctionEnd
InstallDir "c:\temp"
Section "" ;No components page, name is not important
call getparameters
POP $0
${if} $0 = "CS"
Messagebox MB_OK "CS Section"
${elseif} $0 = "HR"
Messagebox MB_OK "HR Section"
${else}
MessageBox MB_OK "Incorrect Variable Chosen"
${endif}
SectionEnd ; end the section