WixSetup - Check pre-requisites & Adding redistributable? - wix

I am using WixSetup project for my application, which generates msi as output successfully. Now, I have to add few more details-
Question 1: Check pre-requisites before installation:
As a part of pre-requisites, I have to check few conditions in product.wxs file (Similar to .NET Framework 4.0)
<PropertyRef Id="NETFRAMEWORK40FULL"/>
<Condition Message="[ProductName] requires .NET Framework 4.0.">Installed OR NETFRAMEWORK40FULL</Condition>
How to add pre-requisite condition in product.wxs file with registry entry check?
Question 2: Adding redistributable packages in msi
Also, I need to add couple of redistributable items in msi, which will be shipped with msi.
How I can add these packages in msi?

For the first point, the WiX documentation covers this exact scenario. See http://wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/read_a_registry_entry.html
With your second question, this is generally done by creating a bootstrapper bundle, which is a separate wix project that runs through a series of .msi files in sequence. Bootstrapper projects are generally quite simple to set up.

Related

Using Windows SDK Bootstrapper Packages with WiX

In tracking down another issue I came across the folder C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages that looks like it contains a number of pre-made installer items for various programs. I have a project I am on now that requires Crystal Reports and would like to know:
1) Can I use the "Crystal Reports for .NET Framework 4.0" installer project found in this directory to install Crystal Reports using a WiX bootstrapper (exe output) or WiX project (msi output)?
2) How would I go about including this Crystal Reports installation package in the bootstrapper or msi project?
1) You can use pretty much any msi/exe setup into bootstrapper
2) If you want to include EXE/MSI into bootstrapper then have a look at the documentation http://wixtoolset.org/documentation/manual/v3/xsd/wix/packagegroup.html and i believe what you need is MsiPackage Element for .msi or if it's exe setup then you use ExePackage Element.

Using bootstrapper with MSI ui

I have MSI file that is ready to install. It contains a customized UI that also collects data from user. As part of installation, i would like to install following things if missing
.Net framework 4.0
Microsoft Visual C++ 2010 Redistributable Package (x64)
From what I learned, bootstrapper should contain UI as well. How can I use bootstrapper for only initiating prerequisites stage and then proceed with MSI UI installation?
If you use the Visual Studio Setup and Deployment projects bootstrapper (GenerateBootstrapper related things) then it will show your MSI UI after installing the prerequisites. It's a pretty simple bootstrapper.
I believe the custom bootstrapper UI you are thinking about is the new Burn functionality in WiX v3.6+. Burn is a lot more powerful and can create single, seamless user experience for multiple chained packages (.exe's or .msi's or .msp's or .msu's). Using Burn you can create a very custom UI that does not show any UI from your chained packages. Alternatively, you can have Burn show the MSI UI. Basically, Burn is highly configurable but does require a bit of extra work (since WiX toolset doesn't provide everything out of the box, yet).
To show the MSI UI when running in a Burn-based Bundle you'll need to add DisplayInternalUI='yes' to the MsiPackage elements you want to display. For example:
<Chain>
...
<MsiPackage ... DisplayInternalUI='yes' />
</Chain>
If you are using the wixstdba (which is very common), it will show it's UI until it comes time to install the .msi package. Then the .msi package UI will pop-up on top and return back to the wixstdba UI to complete the Bundle install. You could provide your own Bootstrapper Application if you want to change the way that the Bundle based UI shows up.

VS2012 and Wix 3.6 - Installing .Net 4.5 with my application

I am very new to the installer world.
I have successfully made an .msi for my application and it is building with short-cuts and also uninstalls correctly.
My next goal is to package .Net 4.5 with the installer and have it be installed prior to the installation of my application.
I also have a third party application that needs to be installed. It is packaged as an msi.
From what I can gather I need to develop a Bootstraper solution to have these applications install in sequence.
Can anyone provide a guide as to how to implement an installer in such a way? My searches have come up with a bunch of partial implementations with an assumption of the design of a Wix Bootstrapper Project in Visual Studio.
I hope this helps someone. It took me 5 hours to figure it out. Maybe, my bad, but did not find anything about it in the docs or blogs.
So my scenario is: VS 2012, WIX 3.6 with Burn bootsrapper, create a Setup executable in order to check .NET Framework 4.5 and install it by downloading if not installed already. Sounds simple. And it is. Actually very.
Create your MSI installer project (WIX Setup Project), to produce an installer for your application.
Create a WIX Bootstrapper Project for your Setup executable.
Follow the instructions here, to create your Boundle.wxs
Add a reference to the WixNetFxExtension.dll which can be found in the WIX program directory.
Include the following line in your Chain:
<PackageGroupRef Id="NetFx45Redist"/>
Actually the WixNetFx extension contains a working install package definition for the .NET Framework 4.5.
As caveman_dick mentioned, Burn in WiX 3.6 supports this but you may also want to take a look at dotNetInstaller (http://dblock.github.com/dotnetinstaller/). We use it to install .NET 4.0 but I'm sure it works for installing 4.5 as well. It can also install other MSI dependencies very easily.

Distribute WPF app with WIX and .net Framework

I need to distribute my WPF application. I am using WIX for building the Setup.exe.
But I also need to ensure that the .net framework 4.0 is first installed on the user's PC. I have downloaded dotNetFx40_Full_x86_x64.exe but how do I create a WIX installation that will contain MyApp.Msi and the .net framework redistribution file?
What I really want is to have just 1 Setup.exe that contains and runs both installs(my.msi and the .exe) in order.
Can this be done with WIX? Is there a better solution?
You can use the WiX bootstrapper technology (referred to as Burn) to create a single bootstrapper to install .NET and your .msi. Burn will enable you to embed the .NET redistributable and your .msi into a single setup.exe as well.
A setup bootstrapper is the file that could install the .NET framework. You can read about the WiX bootstrapper here. If you want the final output to be one .EXE file, you can pack the bootstrapper and the .MSI file into a new .EXE file using IExpress. IExpress is included in your Windows installation.
With WiX + IExpress you can create an installation package contained in one .EXE file.

wix: running external msi before installation begins

my application requires the microsoft visual c++ redisributable package (vcredist_x86.exe).
i have a custom action to run the vcredist_x86.exe
i want it to run only if it's not already installed. i created a registry search to check it.
the question: how do i run this action with the check? when using the InstallExecuteSequence element, as shown below, the vcredist_x86.exe crashes because you cannot run an msi while running a different msi
thanks,
Uzi
what you need is a bootstrapper that would install the VC++ redistributable before your MSI starts.
i'm using open source dotNetInstaller and it works pretty well.
Don't use the exe at all. To distribute the VC++ runtime in an msi-based install, use a merge module. No custom actions, no conditions to add, it just works.
Aaron Stebner's blog specifically talks about doing this with WiX.
http://blogs.msdn.com/astebner/archive/2007/02/13/building-an-msi-using-wix-v3-0-that-includes-the-vc-8-0-runtime-merge-modules.aspx