Distribute WPF app with WIX and .net Framework - wix

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.

Related

WiX toolset: How to execute multiple exe files with MSI package

I am working on my first MSI builder with WiX. I am hoping that I can receive some help on what I am trying to achieve.
For my app, the user has to have Visual Studio Code (latest) and a couple of other applications on the local machine. Therefore, I included .exe file in the MSI package like the screenshot below.
I am wondering if there is a way to run those execution files as a part of Microsoft Installer download...?
I am using Visual Studio 2017 and WiX toolset to build a Microsoft installer.
I appreciate any comments or resource that I can look into.
Best regards,
You'll need a bootstrapper (setup.exe) to properly get them preinstalled along with installing your app's MSI. You can generate a bootstrapper using a WiX bundle.

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.

Sample application for WiX bootstrapper for beginners

I'm very new to WiX based applications, and I need to create an MSI file where it has to check for .NET Framework 4.0 and SQL Server 2008. If they are not installed, I have to get them installed first and then have to install my application's EXE file and one more VBScript agent. It must be done like when you install WiX 3.7 setup (if we double click the setup file, it will show a UI as shown below!
Where do I start? Is there any step-by-step guide to develop this kind of application?
You'll need the following projects. They can be created from project templates in Visual Studio. Each of them would probably have separate tutorials that you might find with a Web search.
A WiX Setup project to build an .msi. The source files for such a project declare a WiX/Product. It could have conditions that check for .Net Framework4.0 and SQL Server 2008. If a check fails, installation of the .msi will fail, which is all that can be done in an .msi. The project would include your application .exe as a Component.
A WiX Bootstrapper project to build an .exe. The source files for such a project declare a WiX/Bundle. In the bundle is a Chain of installers, which would include .Net Framework4.0, SQL Server 2008, your .msi, and your VBScript Agent.
A WPF Library project to provide a BootstrapperApplication implementation with a custom UI for the bootstrapper project.
Your best bet is to consult the documentation, the WiX source code and various tutorials. Keep in the mind that tutorials might be out-of-date--in most cases WiX has gotten simpler with each version.

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.

Where can I find the .NET bootstrapper files?

I have created a setup project with VS2008 for a .NET Windows Forms application using .NET Framework 3.5.
But I want to create an installation with WiX 3.5. Since I have VS2008 installed, I expected I can use the instructions in the help section How To: Install the .NET Framework Using a Bootstrapper. Unfortunately this includes a reference to the directory
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\
that I cannot find on my PC although this should be present if VS2008 is installed. Should I find it somewhere on my PC or do I have to install this manually? Why should this be necessary?
What are other opportunities to automatically install the .NET framework when required?
Edit:
The WiX documentation describes the path for VS2005 on a 32 bit operating system. I found the boostrapper at
C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper
There are a few related questions to yours, check out WiX: Where can I download the bootstrapper?