1
votes

I am new to Wix. I have created a Wix bootstrapper project. I was going to use variables defined from registry search to check if my .net redistributable install should run. However from this source I saw how to include links for the different .net installs bundling .net

but this will not work for an offline capable installer as stated in the article.

Is there a way to bundle my .net install into my burn package and still use something like this to run the .net install? Again I a new to wix and the way I think the PackageGroupRef is working here is to only run the install of this version of .net if needed.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<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"
     xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension" >


<Bundle ...>
   <Chain>
      <PackageGroupRef Id="NetFx451Redist" />
      <MsiPackage ... />
  </Chain>
</Bundle>
</Wix>

Below is what I used and it installs on win 7 and installs .net 4.5.1 and after removal of my install and reinstall does not call .net 4.5.1 install.

Using Ricks Example, I did this. However I had to include the define for NetFx451MinRelease. There is something I am missing, but for now it is working. Thanks Rick.

<?define NetFx451MinRelease = 378675 ?>
<util:RegistrySearchRef Id="NETFRAMEWORK45"/>

    <Chain>

  <ExePackage Id="Netfx451Full"
                DisplayName="Microsoft .NET Framework 4.5.1"
                SourceFile="..\..\Requirements\NDP451-KB2858728-x86-x64-AllOS-ENU.exe"
                InstallCommand="/passive /norestart"
                Permanent="yes"
                Vital="yes"
                Compressed="yes"
                DetectCondition="NETFRAMEWORK45 &gt;= $(var.NetFx451MinRelease)" />


    </Chain>
3
Please post your answer as an answer separate from the question, and when you decide it's the best answer, accept it.Tom Blodget

3 Answers

1
votes

Take a look here, What is the difference between NetFx45WebLink and NetFx45RedistLink

What we did (for .Net 4.0) is to copy and modify the source, specifically setting the SourceFile attribute to a path containing the downloaded redistributable .Net installer.

.Net 4.0 example

<Fragment>
  <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4FullVersion" />
  <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4x64FullVersion" Win64="yes" />

<PackageGroup Id="Netfx4Full">
  <ExePackage Id="Netfx4Full"
              DisplayName="Microsoft .NET Framework 4.0"
              SourceFile="..\redist\dotNetFx40_Full_x86_x64.exe"
              InstallCommand="/passive /norestart"
              Permanent="yes"
              Vital="yes"
              Compressed="yes"
              DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)" />
</PackageGroup>
</Fragment>
0
votes

Add the .NET offline/standalone installer to the setup and install it using the silent install switch.

Check http://unattended.sourceforge.net/installers.php for more info. Might information specific to wix, but it should help.

This answer - https://stackoverflow.com/a/2899673/1678053 - is another way of doing it.

UPDATE:
I think this is what you're looking for: https://stackoverflow.com/a/14341308/1678053

0
votes

Use the /passive switch carefully.

<Fragment>
<WixVariable Id="WixMbaPrereqPackageId" Value="Netfx451Full" />
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx40EulaLink)" />

<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version"
                     Variable="Net4FullVersion" />
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version"
                     Variable="Net4x64FullVersion" Win64="yes" />

<PackageGroup Id="Netfx451Full">
  <ExePackage Id="Net45" Name="Microsoft .NET Framework 4.5.1.exe"
              Description="Microsoft .NET Framework 4.5.1 AllOS (x86 and x64) Setup"
              Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="yes"
              InstallCommand="/norestart"
              SourceFile="$(var.PreRequisites_x86)DotNetFramework\NDP451-KB2858728-x86-x64-AllOS-ENU.exe"
              DetectCondition="(Net4FullVersion = &quot;4.5.50938&quot;) AND (NOT VersionNT64 OR (Net4x64FullVersion = &quot;4.5.50938&quot;))"
              InstallCondition="(VersionNT >= v6.1 OR VersionNT64 >= v6.1) AND (NOT (Net4FullVersion = &quot;4.5.50938&quot; OR Net4x64FullVersion = &quot;4.5.50938&quot;))" />
</PackageGroup>