How to check and install required .net version while installing bootstrapper application - wix

Following is the code for my bootstrapper application:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Bundle Name="BootstrapperSetup" Version="1.0.0.0" Manufacturer="Company" UpgradeCode="XYZ">
<Chain>
<ExePackage SourceFile="C:\SW\XYZ.exe" Compressed="yes"></ExePackage>
<MsiPackage SourceFile= "C:\SW\ABC.msi" Compressed="yes" DisplayInternalUI="yes"/>
<MsiPackage SourceFile="C:\SW\PQR.msi" Compressed="yes" Name ="INSTALLDIR"/>
</Chain>
</Bundle>
</Wix>
Before installing all the 3 packages, I want to check weather .net framework is installed on the machine or not, and if not, then i need to install it from another folder.
Please help me to do the needful.

Depending on the version of .NET you need you can add something like this to your chain:
<PackageGroupRef Id="NetFx40Redist" />
See here for other alternatives: http://wix.sourceforge.net/manual-wix3/wixnetfxextension.htm.

This article talks abut Managed UX and Adding .net for same http://blogs.msdn.com/b/heaths/archive/2011/10/28/introducing-managed-bootstrapper-applications.aspx

Related

CMake and CPack WiX Standard Bootstrapper Application

according to CPack/WIX documentation
I can create *.msi installer
as described here
Feeding a custom wxs file to CPackWIX
But I need more complex scenario, where I have top level Bundle -> bootstrapper_installer.exe
which in turn run child *.msi installers:
https://wixtoolset.org/documentation/manual/v3/bundle/wixstdba/
It means like I need to run CPack twice firstly to generate product_installer.msi
second time to make main installer - bootstrapper_installer.exe with embedded product_installer.msi
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle Name="Source-Connect" Version="$(var.Version)" Manufacturer="$(var.Manufacturer)" UpgradeCode="69157fdc-819e-4e70-9fac-b2a0840a7a11">
<MsiPackage SourceFile="$(var.Product-Installer.TargetPath)" DisplayInternalUI="no" Compressed="yes">
<MsiProperty Name="LAUNCH_AFTER_INSTALL" Value="[LaunchAfterInstall]" />
<MsiProperty Name="FORCE_CLOSE_APPLICATION" Value="[CloseRunningApp]" />
</Chain>
</Bundle>
</Wix>
Is there way to achieve this using Cmake/CPack?

How to install vcredist.exe files from Wix Setup Bootstrap Project

I am trying to install the Visual C++ Redistributables along with the .msi for my application. However when I go to install the project I keep getting a "Another install is currently running error". Here is my bundle.wxs file:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Application" Version="1.0.0.0" Manufacturer="Manufacturer" UpgradeCode="6c5daa41-4ce9-4f20-94b2-2471a6932542">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<!-- TODO: Define the list of chained packages. -->
<!-- <MsiPackage SourceFile="path\to\your.msi" /> -->
<PackageGroupRef Id="MyPackage" />
<MsiPackage Id="MyApplication" SourceFile=".\Application.msi"/>
</Chain>
</Bundle>
<Fragment>
<PackageGroup Id="MyPackage">
<ExePackage Id="VisualCPlusPlus32Bit"
DisplayName="Microsoft Visual C++"
SourceFile=".\vcredist_x86.exe"
Vital="no"
InstallCommand="/q /ACTION=Install"
DetectCondition="NOT VersionNT64"/>
<ExePackage Id="VisualCPlusPlus64Bit"
DisplayName="Microsoft Visual C++"
SourceFile=".\vcredist_x64.exe"
Vital="no"
InstallCommand="/q /ACTION=Install"
DetectCondition="VersionNT64"/>
</PackageGroup>
</Fragment>
</Wix>
I have looked at the docs for wix and this tutorial but I still cant get the Visual C++ libraries installed first without two installs run concurrently.
Thanks!
See How To: Install the Visual C++ Redistributable with your installer. This approach uses a Merge Module to include the Visual C++ Redistributables with your msi instead of running vcredist as a separate installer.

WiX Bundle: Patches for 1.0.0 are not removed from Programs & Features when bundle 2.0.0 is installed

There are 3 bundles, code is listed below. 1.0.0, 1.0.0.1, and 2.0.0.
If 1.0.0, 1.0.0.1, and 2.0.0 are installed, View Installed Updates will still have 1.0.0.1 listed as installed. It will remain there until the last Version is uninstalled.
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Burn Installer" Version="1.0.0" Manufacturer="LANSA" UpgradeCode="AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA" Copyright="..." AboutUrl="...">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<MsiPackage Id="MainPackage" SourceFile="TESTLIST_v1.0.0_en-us.msi" Vital="yes" DisplayInternalUI="yes" />
</Chain>
</Bundle>
</Wix>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Patch 1.0.0.1" ParentName="Burn Installer" Version="1.0.0.1" Manufacturer="LANSA" UpgradeCode="AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA" Copyright="..." AboutUrl="...">
<RelatedBundle Id="AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA" Action="Patch"/>
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<MspPackage Id="Patch" SourceFile="TESTLIST_v1.0.0.1_en-us.msp" Vital="yes" DisplayInternalUI="no" PerMachine="yes" Permanent="no"/>
</Chain>
</Bundle>
</Wix>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Burn Installer" Version="2.0.0" Manufacturer="LANSA" UpgradeCode="AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA" Copyright="..." AboutUrl="...">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<MsiPackage Id="MainPackage" SourceFile="TESTLIST_v2.0.0_en-us.msi" Vital="yes" DisplayInternalUI="yes" />
</Chain>
</Bundle>
</Wix>
When an Upgrade is applied, all prior Versions and Patches should be delisted from Programs and Features and/or View Installed Updates. Exactly the same as does occur when the MSI/MSP are directly installed rather than through the Bundler.
The answer for WiX 3.9 and later is as follows...
In Major Upgrade bundles the UpgradeCode must match. "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA" in the example below.
In Patch Bundles the Upgrade Code must be unique, unrelated to any other GUID used in any bundle. "CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC" in the example.
In the Major Upgrade bundles the RelatedBundle must be unique. This GUID is used in all the patches for that Major Upgrade. "BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB" in the example.
These settings also ensure that the Major Upgrades are listed in Programs and Features and the patches are listed in View Installed Updates.
<Bundle Version="1.0.0" UpgradeCode="AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA">
<RelatedBundle Id="BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB" Action="Detect" />
</Bundle>
<Bundle Version="1.0.0.1" UpgradeCode="CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC">
<RelatedBundle Id="BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB" Action="Patch" />
</Bundle>
<Bundle Version="2.0.0" UpgradeCode="AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA">
<RelatedBundle Id="DDDDDDDD-DDDD-DDDD-DDDD-DDDDDDDDDDDD" Action="Detect" />
</Bundle>

Wix installer install .net if not installed

I stumbled upon this documentation. http://wix.sourceforge.net/manual-wix3/wixnetfxextension.htm.
I can't figure out how to install for example .net4full when it is not installed.
Currently my wix xml looks like this:
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Product Id="*"
.....
.........
>
<PropertyRef Id="NETFRAMEWORK40FULL"/>
<Condition Message="This application requires .NET Framework 4 FULL. Please install the .NET Framework then run this installer again.">
<![CDATA[Installed OR NETFRAMEWORK40FULL]]>
</Condition>
.....
.........
............
.........
............
</Product>
.......................
..............................
................................
.........................
</Wix>
BTW, I'm using wix 3.7!
In the Wix setup project, you can check the existence of .net framework 4.0 and give a message to user like you have to install .net framework 4.0 before install this product.
But if you want to do silently (Check .net framework 4.0 existence...if available install only your product and if not first install .net framework 4.0 and then install your product) You have to do by wix bootstrapper
Sample Bootstarpper code as follows
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle
Name="My Application" Version="1.0.0.0" UpgradeCode="8DA460D6-B4CB-4ED0-A1FE- 44F269070647" Manufacturer="ABC">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
<bal:WixStandardBootstrapperApplication LicenseFile="Agreement.rtf"
LogoFile="App.ico"/>
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="Netfx45Xxx"/>
<MsiPackage SourceFile="D\MySetup.msi" Compressed="yes" EnableFeatureSelection="yes" Vital="yes">
<MsiProperty Name='INSTALLFOLDER' Value='[InstallFolder]'/>
</MsiPackage>
</Chain>
<Variable Name='InstallFolder' Value='[ProgramFilesFolder]MyApp' />
<Fragment>
<PackageGroup Id="Netfx45Xxx" >
<ExePackage Id="Netfx45Xxx" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="yes" InstallCommand="/q"
SourceFile="dotnetfx45_full_x86_x64.exe"
DetectCondition="(Netfx4FullVersion="4.5.50709") AND (NOT VersionNT64 OR (Netfx4x64FullVersion="4.5.50709"))"
InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Netfx4FullVersion="4.5.50709" OR Netfx4x64FullVersion="4.5.50709"))"/>
</PackageGroup>
This code attach the .net version with itself. If the .net 4.5 is not available in the machine, it will install the framework before install the application setup
The solution for me, using .NET 5 was to include the [ApplicationName].runtimeconfig.json in the application folder.

Wix Burn 3.6 RTM, still installing .NET 4.5 Beta

I'm using WiX Burn to lay down .NET 4.5. It seems really straightforward from the documentation, How To: Install the .NET Framework Using Bur.
My installer is dead simple:
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="My App"
Version="1.0.0.0"
Manufacturer="My Company"
UpgradeCode="My GUID-4fa299bf4589"
IconSourceFile="My Icon File" >
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" >
<bal:WixStandardBootstrapperApplication
SuppressOptionsUI="yes"
LicenseFile="License.rtf"
LogoFile="Installer_Banner.bmp"/>
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="NetFx45Web" />
<MsiPackage
DisplayName="My App Name"
SourceFile="myMSI.msi"></MsiPackage>
</Chain>
</Bundle>
</Wix>
But when I run the generated EXE file it wants to install .NET 4.5 beta. I've got WiX 3.6.3303 which is RTM and Visual Studio 2012 RTM. How can I fix this problem?
The correct URLs for NETFX v4.5 are used in WiX v3.8. It was a mistake that the URLs were not updated sooner.