Seite 1 von 1

splitstring illegal String expression

Verfasst: 07 Feb 2013, 10:18
von Lo5t
I have an install script which successfully installs the printer drivers i want for specific printer. The printer i select over a product properties tab. I now want to select more then one printer. I don't want to wait untill each driver is installed before having to install the packet again with different product property setting.
So I have selected a property as two printers seperated with a comma. Yet this fails on both splitString (with illegal String expression) and on the following line ( for %s% in $printers$ do sub_startinstall - with no valid expression for a string list).

Code: Alles auswählen

[Actions]
DefVar $printer$
Defvar $toInstall$
Defvar $printers$

Set $printer$ =  GetProductProperty("printer", "")

comment "Start setup program"

set $printers$ = splitString($printer$,",")
for %s% in $printers$ do sub_startinstall

[sub_startinstall]
comment "Installing printer"
set $toInstall$ = "%s%"
DosBatch_install

[DosBatch_install]
%scriptpath%\winprinter.exe --cfg %scriptpath% --add $toInstall$
ProductProperty Printer is:

Code: Alles auswählen

values: ["OFF_PRINTER_1,OFF_PRINTER_2", "Room2_OFF_PRINTER", "Room3_OFF_PRINTER"]
Any Help would be much appriciated

Re: splitstring illegal String expression

Verfasst: 07 Feb 2013, 16:51
von tobias
please try without the "

like this:
values: [OFF_PRINTER_1, OFF_PRINTER_2, Room2_OFF_PRINTER, Room3_OFF_PRINTER]

Re: splitstring illegal String expression

Verfasst: 08 Feb 2013, 08:22
von Lo5t
but this would give me all printers as an option.
I would like to have the following as ProductProperties:

OFF_PRINTER_1,OFF_PRINTER_2
Room2_OFF_PRINTER
Room3_OFF_PRINTER

If i do what u say i would recieve something like this:

OFF_PRINTER_1
OFF_PRINTER_2
Room2_OFF_PRINTER
Room3_OFF_PRINTER

I would like my script to automatically install an amount of printers i have selected. in est if the product property lists, for example, 3 printers, the script should loop the install routine 3 time.

Re: splitstring illegal String expression

Verfasst: 08 Feb 2013, 19:15
von d.oertel
Hi,

Code: Alles auswählen

Defvar $printers$
set $printers$ = splitString($printer$,",")
wrong variable declaration: $printers$ has to be a stringlist:

Code: Alles auswählen

DefStringlist $printers$
regards

d.oertel