Discussion:
[WiX-users] How to force .NET prerequisite installation before Burn MBA starts
Jiri Tomek
2015-04-24 09:46:57 UTC
Permalink
Hello,
I have a bootstrapper in Wix Burn with managed UI. Bootstrapper requires
.NET 4 but I also need to install .NET 4.5.1 as part of installation. I
added .NET 4.5.1 to install chain and it installs just fine, but because
bootstrapper itself is using .NET it always requires reboot after
installation.
I want to prevent this so I made the .NET 4.5.1 a prerequisite for
bootstrapper. If I install on a machine without .NET it correctly installs
.NET 4.5.1 before managed UI starts so no reboot is required. But if I
install on a machine where .NET 4 is installed, managed UI starts without
installing .NET 4.5.1 in advance and leaves it to install chain. That leads
to a reboot requirement again.

My question is: Is it possible to force installation of .NET 4.5.1 before
managed UI starts, even if .NET 4 or .NET 4.5 is already installed? I would
expect that engine evaluates prerequisite package install condition and if
it's "true" it installs package before managed UI.



--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-force-NET-prerequisite-installation-before-Burn-MBA-starts-tp7600085.html
Sent from the wix-users mailing list archive at Nabble.com.
Martin Cornelius
2015-04-24 16:44:54 UTC
Permalink
Hi Jiri,

I just managed the task you describe (albeit wit .Net 4.5.2.) with the
follwing setup.

--------------------------- BootstrapperCore.config
-------------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="wix.bootstrapper"
type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperSectionGroup,
BootstrapperCore">
<section name="host"
type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.HostSection,
BootstrapperCore" />
</sectionGroup>
</configSections>
<startup useLegacyV2RuntimeActivationPolicy="true">

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<wix.bootstrapper>
<host assemblyName="CustomBA" />
</wix.bootstrapper>
</configuration>
----------------------------------------------------------------------------------------------------------

--------------------------- bundle.wxs
-------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="MyBootstrapper" Version="1.0.0.0" Manufacturer="WiX Tests"
UpgradeCode="416b6bbf-2beb-4187-9f83-cdb764db2840">
<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">

<Payload SourceFile="$(var.CustomBA.TargetDir)CustomBA.dll" />
<Payload
SourceFile="$(var.CustomBA.TargetDir)BootstrapperCore.config" />
<Payload
SourceFile="$(var.CustomBA.TargetDir)Microsoft.Practices.Prism.dll" />

</BootstrapperApplicationRef>


<WixVariable Id="WixMbaPrereqPackageId" Value="NetFx452Web" />
<WixVariable Id="WixMbaPrereqLicenseUrl"
Value="http://go.microsoft.com/fwlink/?LinkID=260867" />

<Chain DisableSystemRestore="yes">

<PackageGroupRef Id="NetFx452Web"/>
<MsiPackage SourceFile="$(var.MyInstaller.TargetPath)" />
</Chain>
</Bundle>
</Wix>
----------------------------------------------------------------------------------------------------------

Please note that BootstrapperCore.config enforces the use of .NET 4.5 for
the managed bootstrapper application by using the sku Attribute at Tag
supportedRuntime. The possible values for this attribute are stated here:
https://msdn.microsoft.com/en-us/library/w4atty68%28v=vs.110%29.aspx
I suppose this is the bit you are missing ?

Please note that the bundle.wxs explicitly sets variables
WixMbaPrereqPackageId and WixMbaPrereqLicenseUrl. This is necessary due to a
bug in WiX NetFx Extension described here:
http://wixtoolset.org/issues/4671/

In my Test of this Setup, i started with a clean win7 (having .NET 3.5).

First, i manually installed .Net 40.

After that, I started the Installer. It first asks for .NET 4.5.2
intallation (with a native GUI provided by the WiX Libs) and only once the
installation is done, (replacing .net 4.0) the WPF GUI of the Installer
comes up - without asking for reboot.

Let me know if this works for you as well.



--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-force-NET-prerequisite-installation-before-Burn-MBA-starts-tp7600085p7600087.html
Sent from the wix-users mailing list archive at Nabble.com.
Jiri Tomek
2015-04-26 15:19:30 UTC
Permalink
Hello Martin,
thanks for the reply. This indeed works if .NET 4 is installed. But what is
.NET 4.5 is installed? <supportedRuntime> element can't say that it requires
4.5.1 (at least according to
https://msdn.microsoft.com/en-us/library/w4atty68(v=vs.110).aspx). In that
case managed bootstrapper that is targeted for .NET 4.5 will start and
installation of .NET 4.5.1 happens during managed phase and causes reboot.

I'll try to target my bootstrapper to .NET 4.5.1 in Visual Studio to see if
that causes failure in case 4.5.1 is missing. If it does then your
suggestion will cover this scenario. If not, I have to find another way like
having own wrapper over Wix bootstrapper.



--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-force-NET-prerequisite-installation-before-Burn-MBA-starts-tp7600085p7600100.html
Sent from the wix-users mailing list archive at Nabble.com.
Bob Arnson
2015-04-24 22:51:11 UTC
Permalink
The pre-req bootstrapper only kicks in if the managed bootstrapper application can't be loaded. If it can, it doesn't evaluate pre-req packages.

_______________________________________________________________
FireGiant  |  Dedicated support for the WiX toolset  |  http://www.firegiant.com/

-----Original Message-----
From: Jiri Tomek [mailto:***@volny.cz]
Sent: Friday, 24 April, 2015 05:47
To: wix-***@lists.sourceforge.net
Subject: [WiX-users] How to force .NET prerequisite installation before Burn MBA starts

Hello,
I have a bootstrapper in Wix Burn with managed UI. Bootstrapper requires .NET 4 but I also need to install .NET 4.5.1 as part of installation. I added .NET 4.5.1 to install chain and it installs just fine, but because bootstrapper itself is using .NET it always requires reboot after installation.
I want to prevent this so I made the .NET 4.5.1 a prerequisite for bootstrapper. If I install on a machine without .NET it correctly installs .NET 4.5.1 before managed UI starts so no reboot is required. But if I install on a machine where .NET 4 is installed, managed UI starts without installing .NET 4.5.1 in advance and leaves it to install chain. That leads to a reboot requirement again.

My question is: Is it possible to force installation of .NET 4.5.1 before managed UI starts, even if .NET 4 or .NET 4.5 is already installed? I would expect that engine evaluates prerequisite package install condition and if it's "true" it installs package before managed UI.



--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-force-NET-prerequisite-installation-before-Burn-MBA-starts-tp7600085.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
Jiri Tomek
2015-04-26 15:22:07 UTC
Permalink
Hello Bob,
I found this out as well. I checked the source code and saw the logic that
always first tries to load managed bootstrapper. I would really use some
flag telling "evaluate prereqs no matter what".



--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-force-NET-prerequisite-installation-before-Burn-MBA-starts-tp7600085p7600101.html
Sent from the wix-users mailing list archive at Nabble.com.

Loading...