Wix - Select MSI features with Burn bootstrapper [duplicate] - wix

I need to install multiple MSIs from a single unified UI.
I also need a 'feature' tree to let the user select which product(s) to install.
Having looked at similar questions, it seems Burn is the way to go.
Looking at this, it seems I must write a custom BA and implement my own feature tree.
Is this correct?
It seems I'll end-up with a custom UI that won't look like the standard UI for MSIs. This seems a pity when IMHO one the great thing about MSIs is that they always present the same UI to users and have been doing so for years.
If that's the way to go, is there a simple example to get started?
Does wix3.6 really not natively support feature tree? ...seems like a pretty basic and useful feature to have IMHO ...

The feature tree is a custom control on MSI and not available for general use. A standard tree control could be used but no one has added that feature to wixstdba. Of course, you could add the feature (start discussion on wix-devs#lists.sourceforge.net) or implement your own BA. The wixstdba code is in src\ext\BalExtension\wixstdba or for managed example there is src\Setup\WixBA. Both are reasonable places to start.

Related

How to do Dynamic Named Instance with Wix+Burn

I have a requirement to create an installer that will allow users to install multiple named instances of our services and application (i.e. Sql Server style).
I have seen that a product called AdvancedInstaller does this and from what I have read this would be achieved through a Bootstrapper capturing the information and streaming it to the MSI. I am assuming here that a Custom UI Burn implementation should be able to do the same, however I cannot find any samples of doing this exactly or on how to do the 'stream' to the MSI.
If I wanted to go this route would I still need to specify instances in my MSI's?
Currently there are separate MSI's for the Windows Services, Application and then a Bundle Bootstrapper EXE that allows the selection of the services to install.
Thanks
MSI has the concept of multiple instance installations using product code changing transforms. These transforms can (but don't have to be) embedded in the MSI. Here's some background reading.
http://blog.iswix.com/search?q=multiple+instance
Read the IS12 then the IS2009. Expect many broken links as Microsoft destroyed their sites. Here are 2020 links.
https://learn.microsoft.com/en-us/windows/win32/msi/installing-multiple-instances-of-products-and-patches
https://learn.microsoft.com/en-us/windows/win32/msi/authoring-multiple-instances-with-instance-transforms
https://learn.microsoft.com/en-us/windows/win32/msi/installing-multiple-instances-with-instance-transforms
When using embedded transforms you are limited to whatever ProductNames you choose when you built them. You could also dynamically generate transforms and apply them.
WiX's standard bootstrapper application doesn't really have much in the way of supporting all the scenarios I talked about in my blog articles. Other tools such as InstallShield and AdvancedInstaller have more.
As much as I like WiX, and MSI for that matter, this is really advanced stuff that takes a long time to understand, develop and test solutions for. You might want to look at using a tool such as InstallShield or Advanced Installer or simply creating a normal straight up MSI that installs a template of an application and then create your own custom instance management tool that allows the user to spin up multiple instances of your application.
I'm an WiX/MSI/InstallShield/DevOps consultant. To be honest, this would not be an inexpensive project if I was to quote it out for a customer.

How do you build conditional logic and user options in WiX?

Having been happy with ClickOnce for a long time, I've been thrust into the weird and wacky world of windows installers. It appears to be a world very short on documentation, unless I don't know what I'm searching for.
I'm aware there's lots of options for building an installer, including Visual Studio setup projects and WiX. Given that I'm looking at a fairly complex scenario, I suspect I'll be going with the latter. What I'm struggling with is doing something like this:
Two things to note about this.
First, it already knows what versions of SQL Server I've got installed. Second, the user can select which options to install and which to skip.
I don't know if there's a particular label for these functions that will help me search for them. But I can't find any details on how to start building this sort of logic into an installer, preferably with WiX.
Can anyone get me started?
This installer UI is WixUI_FeatureTree and it selected by UI reference.
Each line in the UI is a feature.
Each feature can be nested under other feature.
The name of the feature is a property that is set by searching the registry.
To choose if the feature should be enable, expanded etc. check the Feature Element.
Hope it will get you started...

What's the best way to check for prerequisites

I'm building a bootstrapper installer with custom UI. It has some prerequisites that it needs to check before installing and if anything is missing - show it in UI.
I have 2 possibilites:
Check it in XML of my bootstrapper with utils like RigustrySearch
Check it in UI and set some variables in bootstrapper
Have a custom extension and call it from XML
What is the best approach here?
Pros for having it in XML:
Native way of doing it
Pros for having it in UI part:
I could organize code nice and clean
I can have a separate Dll for prerequisites validation, or even a nuget package
I have way more flexibility and it's more simple to make complex assertions
I can have extra information for each prerequisite, like license info and user friendly name
Pros for having a custom extension:
Don't need to fiddle with variables in XML
I personally am more inclined towards the second option as option one is going to make my XML huge and more difficult to read if I have a lot of prerequisites. Option 3 is nice, but It's more difficult to show the user friendly name for a prerequisite and its license information in UI. What do you guys think?
I think this really depends on what your prerequisites are, and how you intend to handle their presence/absence. Here's my personal preference.
Generally, If I'm going for a managed bootstrapper application I'll have that do the detection of the prereqs if I then need some input from the user, ie. an installation directory, credentials, or whatever. I then pass some values from the managed app, into burn variables, and in turn into Wix properties for the individual msi's to respond to. This is my most used approach.
If all of your prerequisites are part of your bundle anyway, and you don't need any interaction from the user, I tend to go ahead as if I'm installing each package, and the packages themselves are responsible for handling their own upgrade/installation not required behaviours. ie. bundling .Net, or 3rd party installers with your application.
I tend to avoid custom actions for this sort of work, I find them a bit cumbersome when trying to deal with all the successful/failed paths of install/upgrade/repair/uninstall etc.
I think it's a bit subjective to your specific use case, and there's not a single best approach for all situations.

WiX extension for burn / bootstrapper

I'm using WixStandardBootstrapperApplication to create a bootstrapper installer using WiX. In it I'm using FileSearch from the WixUtilExtension library (part of a standard WiX install). I'm not quite happy with the logic it's using though, and want to do things just a little differently, but I can't find an easy way to do that. I see my options as:
Create my own managed bootstrapper, this would mean also creating an entire UI experience, which feels like an awful lot of yak shaving.
Create my own library like WixUtilExtension to inject some of my own custom logic.
I favour option 2, given that I have no interest in replacing the overall process offered by WixStandardBootstrapperApplication, but I'm having a hard time finding how to create a burn-centric extension. I can find detail about creating extensions which then get mapped to custom actions (MSI only, not burn bootstrapper), or perform other pre-processing and compiler actions which aren't relevant to my needs here.
How do I go about creating a burn extension? Would I be better off just biting the bullet and creating my own managed bootstrapper, or is there some simple option I'm missing here?
The closest thing to what you want is the BAFunctions.dll that Neil initially wrote for his ExtendedBA. He was able to merge most of that into WiX 3.8. There's example code in Burn's Samples directory.

How to create/Where to get Wix Bootstrapper for Multiple Instances

I'm currently learning how to create msi installers using WiX and it seems I've hit a wall.
All is well when I create an MSI containing everything needed for a single environment.
I have features, and components, and can install my MSI.
Now I'm at the stage where I want to convert this in a SQL Server-style installer, where you have multiple instances support.
At the start I want to user to get a screen which allows him to create a new instance, or manage already existing instances. (to update/remove them)
I've spend 2 full days looking everywhere for a solution, without much luck.
I've found the following resources with some info on it, but either they're limited in the number of instances, or don't describe how to such a bootstrapper which gives a user the option described above.
Multiple Instance MSI's and InstallShield 12
Multiple Instance Transforms Walkthrough
Multiple instance installations and patching
Has anyone achieved this already using WiX? Or can anyone point me towards some working examples on how this is achieved?
I know Installshield 2009 can do this, but since this is just a hobby, I don't have the money to buy that. Also I'd like to do it in WiX, since the upcoming Visual Studio 2010 will improve support for it.
Creating multiple instances is pretty easy with WiX v3. You just use the InstanceTransform and Instance elements to create everything. Now, the bootstrapper problem requires something outside of the WiX toolset since we don't have burn, yet. I'm not sure we'll get this functionality in WiX v3.5 (with burn) but it is on our list for burn post v3.5.
Although I've never created a multi-instance setup, I also noticed that Acresso announced MI support in IS 2009. We have IS 2009 but didnt use this feature.
However, Installshield often simply makes use of new MSI features by offering an "intuitive" frontend to them (like for chaining multiple MSIs together into one). So you might want to look for general information on how to achieve that by using the MSI SDK.
Here are some useful links that might point you to the right direction:
Authoring Multiple Instances with Instance Transforms
Multiple Instance Transforms Walkthrough, Proposed Simple Addition to WiX to Make Them Easier