how to pass parameter into Files section in Inno -


i've googled lot not find answer on question.

how correctly pass parameter function this: getpath('myparam')?

i have such code:

[files] source: "appname\*"; destdir: "{code:getpath('myparam')}";  [code] function getpath(param: string):string;   var  objregexp: string;       path: variant; begin   path := expandconstant('{userappdata}') +'\adobe\' + param + '\.+';   objregexp := createoleobject('vbscript.regexp');   objregexp.pattern := '(.+(\\version )?( cs)?\d.+)';    if objregexp.test(path)       begin          objregexpmatches := objregexp.execute(path);          result := objregexpmatches.item[0].value;       end; end 

as it's shown in the reference, prototype of scripted constants looks this:

{code:functionname|param} 

so need add | char after function name , remove parentheses single quote marks scripted constant function call. in pseudo-code might this:

[files] source: "appname\*"; destdir: "{code:getpath|your input string value}";  [code] function getpath(param: string): string; begin   msgbox(param, mbinformation, mb_ok); end; 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -