Hi there,
I'm using nsis for an installer of a webapplication. In one page of the wizard i want the user choice one of three checkboxes: each of them has to set two variables in different ways.
Here is the code i'm trying to run:
!define DATA_ONE data_one.zip !define DATA_TWO data_two.zip !define DATA_THREE data_three.zip
Function myfunc ... ${NSD_GetState} $RadioOne $1 ${NSD_GetState} $RadioTwo $2 ${NSD_GetState} $RadioThree $3
; The two variables i want to set
Var /GLOBAL CUSTOMER_DATA ; this should be a File (?)
Var /GLOBAL LENGTH_POS ; this is a string
StrCpy $CUSTOMER_DATA ${DATA_ONE} ; default value
StrCpy $LENGTH_POS ""
${If} $1 == ${BST_CHECKED}
StrCpy $CUSTOMER_DATA ${DATA_ONE}
StrCpy $LENGTH_POS "3"
${endif}
${If} $2 == ${BST_CHECKED}
StrCpy $CUSTOMER_DATA ${DATA_TWO}
StrCpy $LENGTH_POS ""
${endif}
${If} $3 == ${BST_CHECKED}
StrCpy $CUSTOMER_DATA ${DATA_THREE}
StrCpy $LENGTH_POS ""
${endif}
; here the line i've got the error
File ${BUILD_DIR}/$CUSTOMER_DATA
...
FunctionEnd
When i try to run it i've got:
File: "./$CUSTOMER_DATA" -> no files found.
Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
/oname=outfile one_file_only)
I presume the error is because the File i'm constructing isn't defined at compile time but only at runtime. Is it correct ? Should i use macro ? What is the more elegant way to solve this problem ?