[wix-users] Iteration - Can it be done dynamically depending on a runtime variable

Farrukh Waheed farrukh1 at gmail.com
Tue Mar 15 05:41:47 PDT 2016


I haven't used Sql queries like this.  <?forEach.. > is a Preprocessor
thing, and so it would be evaluated before compiling things started.

So I guess, you may have to use SQL script which should execute in
iterative way during installation i.e. Sql query script should be using
similar to <?foreach DynamicDB......  thing....

Hope you got my point.

On 15 March 2016 at 15:32, Venkatesan, Ravikumar <
Ravikumar.Venkatesan at scientificgames.com> wrote:

> Hi All,
>
>                 I use the below code to iterate the execution of an SQL
> script file on a list of DBs that’s declared using “<?define?>” statement.
> Everything is fine with the below. However, what I really want is to use a
> dynamic list that shall be known only during the runtime instead of
> hardcoding it like this. Is there a way to do this?!
>
>
>     <?define DynamicDBList="FinalStaging;FinalStaging2;FinalStaging3"?>
>
>     <?foreach DynamicDB in $(var.DynamicDBList)?>
>       <sql:SqlDatabase Id='Dynamic_SQLDB.$(var.DynamicDB)'
> Database='$(var.DynamicDB)' User='SQLUser_local_ETL'
> Server='[DATABASE_SERVER]'/>
>     <?endforeach?>
>
>                                   <Fragment Id='ThisMustWork2'>
>     <ComponentGroup Id='cmpg_ThisMustWork2' Directory='INSTALLFOLDER'>
>       <Component Id='cmp_ThisMustWork2'
> Guid='CA2C7BB6-2D71-486D-9355-884CFA7ADF3D' KeyPath='yes'>
>         <?foreach DynamicDB in $(var.DynamicDBList)?>
>           <sql:SqlScript Id='ss.$(var.DynamicDB)'
> BinaryKey='bi_TestScript' ExecuteOnInstall='yes'
> SqlDb='Dynamic_SQLDB.$(var.DynamicDB)' Sequence='1'/>
>         <?endforeach?>
>       </Component>
>     </ComponentGroup>
>   </Fragment>
>
>
> Regards,
> Ravy
>
>
> Ravikumar Venkatesan | Lead Analyst | Bally Technologies India Private
> Limited<http://www.ballytech.com>   | (M) +91 98 8436 0607
>
> May be privileged. May be confidential. Please delete if not the addressee.
> Venkatesan Venkatesan
>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/



More information about the wix-users mailing list