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

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.

Related

Wix Installer won't build on buildserver

I have tried to build a Wix MSI using our build server. I have set the build configuration in the Configuration manager to DEBUG/x86. All the other projects build correctly EXCEPT for the Wix Installer.
Initially there was an error requesting the latest version of WIX was installed on the build server "The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" so I follwed this -
https://subscription.packtpub.com/book/web_development/9781784393212/1/ch01lvl1sec12/compiling-a-wix-installer-on-a-build-machine-using-msbuild
also have used this -
https://wixtoolset.org/documentation/manual/v3/msbuild/wix_with_team_build.html
Now the build freezes on the Wix project and eventually times oout at 59 minutes. What would be wrong? what needs correctling?
I have tried these suggestions already - https://subscription.packtpub.com/book/web_development/9781784393212/1/ch01lvl1sec12/compiling-a-wix-installer-on-a-build-machine-using-msbuild
also have used this -
https://wixtoolset.org/documentation/manual/v3/msbuild/wix_with_team_build.html
Expecting it to build, then I can create an MSI file.
.NET 3.5: This might very well be something else, but maybe try to install the .NET Framework 3.5. WiX 3.x has a build-dependency requiring this .NET version.
How-To: Please see this answer for more details: WiX Toolset: Creating a simple WiX project breaks in VS2017: The "CreateProjectReferenceDefineConstants" task was not found

Creating New Wix Project In Visual Studio 2017 throws an error

I have installed Visual Studio 2017 Community Edition. Installed it without any specific things selected like C++ development or Windows development etc. After that I have installed Wix through wixtoolset, which downloaded and installed wix tool set components. After that I have installed the Wix ToolSet extension for Visual Studio 2017. Restarted the Visual Studio and trying to create a new project through File -> New -> Project - WiX Toolset -> Setup Project.
It gives the error and does not let me create the project. I am totally new to WiX and have just a little knowledge about Visual Studio.
Initially, I did not select any of the Installation workloads for VS17 and installed it just to make the installation faster.
Through the comments from Azaz, I came to know that NuGet Package Manager is required to install the packages on demand. But since I could not see the NuGet option at all, I tried to install it with Extensions and updates but it did not work. I did a bit of research and found that at least one .Net development workload is required at a time of VS17 installation which will make the NuGet install automatically in VS17.
So I uninstalled the VS17, WiX at all and removed them from the system. Then Installed VS17 with certain workload packages as shown in the below screenshot.
After that I installed WiX and an extension for the same in VS17. i.e. Votive2017.vsix.
I restart the VS17 and now I am able to create project for WiX.
Looks like there is something I missed somewhere in installing which did not let me install required DLLs and GUID feature, which were important for creating project templates.
Sharing the steps I followed in order to fix the same issue that I found with Visual Studio 2019, as I also installed it without any workload. I was also looking at a reduced installation.
The steps I did in order to fix the template error, install the following individual components:
.NET 5.0 Runtime
.Net Core 3.1 Runtime
.NET SDK
C# and Visual Baisc Roslyn compilers
ClickOnce Publishing
Microsoft Visual Studio Installer Projects
Hope it helps someone else. I have to point out that the comments before helped me understand the issue. But, for example, I couldn't even open the NuGet command line.

Wix Toolset install C++ 2010 Redistributable

Can I integrate installation of Microsoft Visual C ++ 2010 redistributable together with my installation package through the Wix Toolset?
I tried this with a custom action, but it does not install if another installation is in progress. Would someone have any suggestions on how to do this?
Also, another question: can I call an MSI installer within this MSI installer that I am creating?
You can't do recursive MSI installs - at the risk of stating the obvious, when you get that error "another install is in progress" that other install is you.
If you use merge modules to install VC Runtimes AND you have a C++ service that is dependent on them that you start with StartServices (WiX ServiceControl) then you may find that the service won't start. This is because the SxS versions of the C++ Runtimes are not available until InstallFinalize, which is after the StartServices action. Possible solutions to this are:
Have the service built with static links to the C++ runtimes, but then updates to the VC++ runtime Dlls won't be applied to your built binary, in case that's an issue.
Use a bootstrapper like Burn to run the VC++ redist exe before you install your own MSI file.
Copy the runtime Dlls to your app folder as private copies that will be used only by your app. This kind of thing, old but still applicable I believe:
http://blogs.msdn.com/b/vcblog/archive/2007/10/12/how-to-redistribute-the-visual-c-libraries-with-your-application.aspx
Another issue you may run into with using the merge modules is that they require a per machine install. If you include them in a per User install then the install will fail.
You can install the C++ runtime files using the C++ runtime merge module:
How To: Install the Visual C++ Redistributable with your installer
And to your second question: No - this is not possible.

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.

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?