You want to use a public property, for example, [APPPOOLNAME]. The WiX 
authoring looks like this:

<iis:WebAppPool Id="AppPoolId" Name="[APPPOOLNAME]" Identity="networkService" 
RecycleMinutes="600" ManagedPipelineMode="integrated"/>

On the command line you simply specify the value of the public property, 
APPPOOLNAME, like this:

msiexec /i "Path\to\package.msi" APPPOOLNAME=MyAppPoolName

Note, that you can use a LaunchCondition to cause an error if the property 
doesn't have a value (the condition needs to be specified in <Product/> or a 
referenced <Fragment/> ):

<Condition Message="APPPOOLNAME must be defined."><![CDATA[Installed OR 
APPPOOLNAME]]</Condition>

You'll want to use a condition that makes sense in your case.

Alternatively, you could simply provide a default value for your public 
property:

<Property Id="APPPOOLNAME" Value="MyAppPoolName"/>

Edwin G. Castro
Software Developer - Staff
Digital Channels
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com
Please consider the environment before printing this e-mail

> -----Original Message-----
> From: Nageswara Rao [mailto:nagmittapa...@gmail.com]
> Sent: Monday, September 17, 2012 4:25 AM
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] How to override wix variable value in runtime(via
> command line)
> 
> Hi Team,
> 
> I am creating an AppPool from my wix project with the below code
> 
> <iis:WebAppPool Id="AppPoolId" Name="XXXXX"
> Identity="networkService"
> RecycleMinutes="600" ManagedPipelineMode="integrated"/>
> 
> Now I want the AppPool Name different for different environments.
> So, My idea is to create a variable and assign that variable to AppPool Name
> and when I am calling the MSI from commandline, variable value should be
> override as per environment.
> 
> Please help me to get the above
> 
> 
> 
> --
> View this message in context: http://windows-installer-xml-wix-
> toolset.687559.n2.nabble.com/How-to-override-wix-variable-value-in-
> runtime-via-command-line-tp7580570.html
> Sent from the wix-users mailing list archive at Nabble.com.
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and threat
> landscape has changed and how IT managers can respond. Discussions will
> include endpoint security, mobile security and the latest in malware threats.
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to