pass value to config file

Mar 12, 2012 at 3:06 AM

Hi,

I have 3 editions of same product, having x86 and x64 msi for each editon, with slight difference in each. So currently I am using 3X2=6 configuration files with very small changes in each. Is there a way that I can use a single config.xml and pass edition specific values to it through command line. Currently I am calling something like below from the Target after build in wix project.

 InstallerLinker.exe" /Output:"$(OutputPlatformPath)\Install\$(OutputName)\$(OutputName).exe" /Template:"$(MSBuildProjectDirectory)\..\..\Common\libs\dotNetInstaller\Bin\dotNetInstaller.exe" /Configuration:$(MSBuildProjectDirectory)\Configuration.xml /AppPath:"$(OutputPlatformPath)\Install\$(OutputName)" /Embed+

I mean, here you have provided a way to pass apppath. same way can i have custom parameter say /xyz and use it in config.xml as say #xyz. This way I can keep just a single config file for all the edition and x86,x64 builds. Now it is a maintenance overhead keeping 6 config file.

Or is there any option to create config file dynamicaly?

Thanks,

Kavitha 

Mar 13, 2012 at 7:21 PM

Why don't you just use a Template task on the original config file? That can expand any kind of variables before you call InstallerLinker. We've used http://msbuildtasks.tigris.org/ TemplateFile for this in the past.