Driver installation with INF and CAT files

Oct 29, 2016 at 7:33 PM
First, thanks for the great library. WiX has way to steep a learning curve so this is just what I needed to help create MSI files.

I'm having trouble understanding how to install drivers that use INF and CAT files. The driver sample just has a SYS file but generally a lot of drivers are installed via an INF. In a non-WiX installation package that I created, I use InfDefaultInstall.exe to do the installation.

But looking at other WiX samples online (like https://kobyk.wordpress.com/2008/10/21/installing-filter-drivers-with-difxapp-and-a-wix-v3-msi/) it shows the SYS, INF and CAT files all under one Component tag and that's something I can't seem to figure out how to do with WixSharp. Am I overlooking something or is that not possible right now? When listed under individual components the MSI runs and I get the 'Install Trusted Driver' pop-up box but when I click 'Install' it doesn't seem to actually install the driver. So I don't know if that's related to the component issue or not. Any help would be appreciated.
Coordinator
Oct 31, 2016 at 1:47 PM
Hi there,

Wix# is trying to get away from the concept of installation Component as it's hard to find today a valid use-case when the deployment requirements force user/developer to deal with the product sub-parts individually. Even MSI support for Features doesn't justify existence of Components as features can directly group deployment artefacts instead if their groups. Components are legacy entities that came from the times when it was believed that the deployment life cycle has higher resolution than a product scope (e.g. components can be updated without updating the product). And today even MS completely abandoned the Components idea (e.g. ClickOnce).

Well this is a theory :)
On practical level MSI just forces you to have components and Wix# complies by creating them automatically by wrapping every artefact into a component. If you want to inject an extra component or extra items into it you will need to do it via XML injection (see InjectXML sample).

However... I haven't seen yet (even once) any problem that was caused by the Wix# component hiding "attitude". Thus there is a good chance that your problem can be solved with the existing component handling.

Just going through the sample you provided the link for I see that most likely the pseudo-code below will produce the required WXS:
new Dir("Drivers",
    new File(@"Files\Drivers\test.inf")
    {
        DriverInstaller = new DriverInstaller
                            {
                                Legacy = true
                            }
    }
Oct 31, 2016 at 6:20 PM
Thanks. I ran my MSI with Sysinternals Process Monitor running and I can see that DrvInst is executed which then calls rundll32 to register the driver. So it appears that the MSI is built properly with the drivers. However, they are not actually being installed by rundll32. Rundll32 returns success so something funny seems to be going on that I haven't figured out yet. But at least it's not a Wix# problem.
Oct 31, 2016 at 11:30 PM
Just to follow up, I did not specify that the driver was not PnP in the INF file. Once that was fixed, everything works great. So totally unrelated to Wix#.
Coordinator
Oct 31, 2016 at 11:56 PM
> So totally unrelated to Wix#
And look at me! I produced such an essay argumenting why Component today is such a big mistake. :) :)