Installing Visual Studio runtime and SQL Express dependencies along with my application MSI.

May 11, 2015 at 9:40 PM

My application depends on .Net 3.0, Visual Studio runtime and SQL Express. I'm trying to figure out how to create an MSI file that will install all those dependencies with my application.

I've search for samples and guide about how to do it and this is what I found so far:

1) For .Net, I use CommonTasks SetNetFxPrerequisite() to ensure that the target system has it, I would prefer installing it directly along the application, but it's not mandatory.

2) For the runtime, I'm trying to use the MergeModules samples "Consuming MergeModule" to package and install "Microsoft_VC120_CRT_x64.msm" with my MSI, but with no success:

I'm adding in my Project construction this line
new Merge(@"Resources\MergeModules\Microsoft_VC120_CRT_x64.msm")
and also this, a little further (it removes one error) :
project.Package.AttributesDefinition = "InstallerVersion=300; Platform=x64";
But I got tons of the following error for each file added in the project :
error LGHT0204: ICE21: Component: 'Component.HealthContributor.exe' does not belong to any Feature.
Finally, for the SQLExpress MSI (which is the main priority for my project), I'm trying to figure out how to use the technique shown in this S/O thread:

But I don't really understand how to translate raw Wix XML into WixSharp commands.

I trully hope there's a way to at least bundle SQLExpress with my application MSI installer.

May 12, 2015 at 2:30 PM
I wouldn't bother with MergeModules. IMO MM is a "dead end" approach for such a large dependencies as CLR and SQLServer. Consider bootstrapper.
May 12, 2015 at 3:58 PM
I am actually looking at bootstrapper samples right now.

Do you think it'd be possible to proceed into a silent and fully automated installation of SQL Server ?

May 13, 2015 at 1:46 AM
Yes this is exactly what bootstrapped are for. But considering the size of your prerequisites you may (or may not) find that you are better off not using Wix# simplified bootstrapper but some full scale alternative.
May 18, 2015 at 7:17 PM
Is there a way to pass command line arguments when using the native bootstrappers ? I'm setting "PrerequisiteFile" pointing on my executable and it launches it, but I can't add any parameters required by my application.

Thanks again!
May 19, 2015 at 1:25 AM
Unfortunately no. See me second comment here:
May 19, 2015 at 3:45 AM
I managed to get it all working using the simplified bootstrapping approach. My only remaining concern is too remove the UAC windows when launching installer .exe using Process.Start() in my CustomActions.

So far, I tried all these techniques without success:
AttributesDefinition = "InstallScope=perMachine; InstallPrivileges=elevated";
myManagedAction.Impersonate=true or myManagedAction.Impersonate=false;
new Property("ALLUSERS", "2") or new Property("ALLUSERS", "1")
My custom action are all executing into InstallExecuteSequence. I can get the installer to ask for UAC after pressing the "Install" button, but each further Process.Start(myInstaller) ask for UAC after.

By the way, thanks for your work, it's very usefull and WixSharp is such an interesting way of doing installer :)