Reputation: 15413
I've found that the best way to modify machine.config is to use the XmlConfig tool and pass in the path: [WindowsFolder]\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config. But the problem arises since this installer is meant to work on both x86 and x64. The site it's installing will be set up on IIS on whatever platform is available. Which means it might be in Framework64 instead.
I've seen some guidance on how to make two different installers from the same file, but is there any way at install time to decide which file the XmlConfig will be editing? I tried using the SetProperty element, but I'm not sure what variable to use to decide and anyway I couldn't use SetProperty twice on the same property.
If that's not possible, is there some way to conditionally run the XmlConfig statement only when installing in x64 mode?
Upvotes: 0
Views: 946
Reputation: 32250
Technically you can wrap XmlConfig elements in two different components and condition those appropriately (for instance, using VersionNT64 property). One will point to Framework (x86), another one to Framework64 (x64).
BUT, are you sure you'd like to change the machine.config file with your installer? You should be aware that the settings defined in machine.config are inherited by ALL ASP.NET applications on the server. And hence, your change will influence ALL other applications.
I would highly recommend you instead to think about overriding necessary settings in web.config file of the application you install (which I assume you do).
Upvotes: 1