xslt - WiX - Copy compiled web.config based on environment to website root -
as part of wix installation, copying transformed/compiled web.config files install directory. names of compiled web.config in format web.{env}.config. in install ui created custom dialog parse env , populate combobox user can select environment deploy to. combobox sets property env.
i need understand how use property copy installed config files website root.
update: @rob_mensching - solution works, however, on compilation wix forces me have guid created each such component. there way avoid it? thing going generate piece of code running xslt on wxs file gets generated using heat; , there no way generate guid using xslt (or can i?)
this how code looks now:
<componentgroup id='web.config' directory='configlocation'> <component id='copywebconfigfordev1' guid='{f207c26a-5d9c-4f19-96a3-d818bb226efc}' > <condition>env="dev1"</condition> <copyfile id='copydev1config' fileid='fil9c4cfe42035f1a63180142352cf441bc' destinationdirectory='configlocation' destinationname='web.config'/> </component> <component id='copywebconfigforqa1' guid='{f207c26a-5d9c-4f19-96a3-d818bb226efc}' > <condition>env="qa1"</condition> <copyfile id='copyqa1config' fileid='fil12f8b50f03f1bd91a579f6b6ce7195df' destinationdirectory='configlocation' destinationname='web.config'/> </component> </componentgroup>
i use "component condition"b so. following should work well:
<fragment> <componentgroup id='web.config' directory='configfolder'> <component> <condition>env~="production"</condition> <file source='web.production.config'> <copyfile destinationdirectory='installfolder' destinationname='web.config' /> </file> </component> <component> <condition>env~="test"</condition> <file source='web.test.config'> <copyfile destinationdirectory='installfolder' destinationname='web.config' /> </file> </component> </componentgroup> </fragment>
the condition syntax documented here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa368012(v=vs.85).aspx
Comments
Post a Comment