Modifying machine.config with WiX x86/x64 - wix

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?

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).

Related

Customisation of BizTalk BTDF MSI Files

Is there a way via the BTDF configuration files to customize the Program Group, default installation folder and other high-level installer settings for a BizTalk BTDF generated MSI file? This would be in the latest BTDF version.
As BTDF is built on Wix I'm wondering if there is any way to access these kind of settings, or alternatively whether any of them are exposed in the .btdfproj file (though searching the documentation and online resources has drawn a blank here - apologies if I missed anything obvious).
The situation is that we will be deploying over 200 interfaces to the same server, and the default approach will become hard to manage. I'm aware that I could post-process the MSIs but would rather avoid this.
Yes. You can get the GenericBizTalk.wsx file from the %PROGRAM_FILES%\Deployment Framework for BizTalk x.x\Developer\GenericBizTalkMSI.wxs as a starting point. Add it to your solution, and update/customize it as desired. Then, set the property in your .btdfproj:
<WixProjectFile>MyNewGreatWix.wxs</WixProjectFile>
See here for more info: http://www.tfabraham.com/BTDFDocs/V5_5/DeploymentFrameworkForBizTalkDocs.html?CustomizingtheDefaultWiXTemplate.html (applies to current version as well).

WIX remove DLL from registry if it set it

I have an MSI installer that registers a DLL. I also want to give the users the option to manually register the same DLL (could be different version). Consider the case where the user first installs the MSI, then manually registers the DLL (using regsvr32). The previous file is overwritten.
When I uninstall my initial MSI, the overwritten DLL is also removed. Is there a way I can prevent that from happening in case the first DLL has been overwritten.
You could use the FileSearch element of WiX and, if the DLL with this version is found, set a property accordingly. You could then use this property to decide if the DLL should be unregistered or not.
I guess for checking if the user registered it manually or not you have to save that information during installation, e.g. somewhere in the Registry. You could then also do a RegistrySearch for this key.
You probably also have to set the Permanent-attribute of the component and then remove it by yourself (depending on the property set above).
You could ship that other Dll in a separate MSI, making sure it's installed to the same location and has the same component guid. That would result in Windows knowing about it being shared, and uninstalling one MSI would not remove the remaining Dll because of that sharing.
Without knowing your exact situation it's hard to know if that will work. If you always ship a higher version than than the one in your current MSI then it will work. If you try to replace that Dll manually with a lower file version then repair will restore the correct higher version from the original MSI, so you're already in potential trouble. The only safe way to maintain files installed with MSI is with another MSI-type update, like a patch, major upgrade etc.

Replacing element in app.config from external config file using WiX

I am 100% new to WiX but I have to start off with a advanced issue and I have virtually no idea if that is even possible. I have an out of-the-box WiX project in front of me that creates a msi installer for me. But I want to deploy an external config file with it, from which a specific element will be inserted into the app.config within the msi file. I need this because I need to have custom behavior on different target machines without rebuilding for every one.
Does anyone have some kind of opinion on that?

WiX - how to modularise by features?

I want to make a MSI installation using WiX and EmbeddedGUI. I really want to make it highly modular - ie the main MSI will contain only the basic files (the required ones), and all other features will be split into separate MSI files, which will be downloaded from internet if not present on hard drive and installed only if selected in my EmbeddedGUI.
But I am totally new to WiX, and I can't find a way to actually how to make that modules? MS Office and MS Visual Studio seems to be using this scheme, by using the modules which it downloads over internet and installs them in case of need - something like this:
It seems that Fragments is mostly like "static libraries", not "dynamic libraries" which would be more useful in such a situation. There is also the Chaining mechanism, but I'm not sure I will be able to bundle the features as the same application (only one entry in "Install/Delete" window) because it seems to be calling external MSIs completely separately (more like invoking "separate exes" instead of loading "dynamic libraries").
So, what is the way to go for making a highly modular setup package with WiX?
Use a bundle (chain). The Burn engine, which manages bundles, will show only the bundle in Add/Remove Programs and can download any packages that aren't already present -- for example, using the MsiPackage/#DownloadURL attribute.

WIX: How to detect if third-party application is installed?

Is it any way in WIX to detect that a third-party application with a specified upgrade code is installed and what is it's installation folder? I can suggest a custom action is required, but what exactly to do in such custom action? Is it possible to detect such things in VBS custom action?
It really depends on the application. Most applications publish a registry key that can be used to detect them. In that case you just need a RegistrySearch element, no custom actions necessary. If the application was installed via MSI, sometimes a ComponentSearch is better.
You can use dotNetInstaller for configure it very well. With the help of registry search you can easily find out that the program is installed or not(Use product version / Product name for additional check)