1

I'm using InstallShield 2013 LE and I'm looking to do something similar to SQL CE 4.0 as a InstallShield Prerequisite . Only, I want to install .Net Framework 4.5, if it's not already on the machine. I have the file I need for the framework, but LE doesn't allow me to work on prerequisites.

I saw the recommendation for DotNetInstaller and I downloaded and started working on that. But it looks like DotNetInstaller is very old and doesn't include .Net Framework 4.5 (stand-alone) in its list. Is there a way to add it?

Then I looked at WiX and wasn't sure I could follow the documentation.

I also see http://msdn.microsoft.com/en-us/library/ms165429.aspx that describes making bootstrappers directly, but there's very little detail there.

Can anyone point me to a real tutorial for the bootstrapper file? Or, is it possible that someone has the file I'm after and can just post it?

Thanks!!!

Siguza
  • 21,155
  • 6
  • 52
  • 89
Chuck
  • 203
  • 6
  • 16
  • Before I invest a lot of time, can someone tell me if http://www.schiffhauer.com/bundling-the-net-framework-in-your-wix-bootstrapper/ is what I want? It just concerns me when a description starts off with "Given the complexity of working with WiX, ..." And if this is what I want, what can you tell me about the `Bundle` file? This is different than `configuration.xml`. – Chuck Apr 11 '14 at 16:06
  • I also see http://msdn.microsoft.com/en-us/library/ee335701.aspx , but that installs MSI, so it's not clear how to get it to work with the framework? – Chuck Apr 11 '14 at 18:58

1 Answers1

0

You will need to do following in your bootstrapper "bundle.wxs"
1. ref NetFxExtension.dll, which can be found in Wix SDK folder
2. Create Util to look if the user has .net45 or not
3. Net 4.5 Download link

I worked on similar thing for one of my projects and below is my bundle.wxs for your reference

<?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"
         xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
    <Bundle Name="XXX" 
            Copyright="XXXXX" 
            Manufacturer="XXXXX" 
            Version="0.0.0.0" 
            UpgradeCode="XXXXXX_XXXX" IconSourceFile="..\XXX.ico" >

<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
  <bal:WixManagedBootstrapperApplicationHost LicenseUrl="NetfxLicense.rtf"   
        LogoFile="Images\Microsoft-.NET-4.5-Icon.ico"/>
  <Payload SourceFile="C:\Program Files (x86)\WiX Toolset v3.8\SDK\Microsoft.Deployment.WindowsInstaller.dll"/>
</BootstrapperApplicationRef>

<WixVariable Id="WixMbaPrereqPackageId" Value="NetFx45WebPackageGroup" />   
 </Bundle>

<Fragment>

   <bal:Condition Message="Please select &quot;Accept and Install&quot; to Install it">Not   Netfx4x64FullVersion</bal:Condition>


  <PackageGroup Id="NetFx45WebPackageGroup">
    <ExePackage Id="NetFx45WebPackageGroup"                      
                Cache="no" 
                Compressed="yes" 
                PerMachine="yes" 
                Permanent="yes" 
                Vital="yes" SourceFile="$(var.Bin)\dotNetFx45_Full_setup.exe" InstallCommand="/q"
    DownloadUrl="http://download.microsoft.com/download/B/A/4/BA4A7E71-2906-4B2D-A0E1-80CF16844F5F/dotNetFx45_Full_setup.exe"
    DetectCondition="(Netfx4FullVersion=&quot;4.5.50709&quot;) AND (NOT VersionNT64 OR (Netfx4x64FullVersion=&quot;4.5.50709&quot;))"
    />
 </PackageGroup>
</Fragment> 

Siva Mandadi
  • 3,673
  • 2
  • 18
  • 12
  • Hi Siva, thanks for your reply! Unfortunately, I switched .Net Framework versions overnight and I'm now using version 3.5. I did that so that I could deploy to Windows XP machines. (I hope I have that info correct.) I looked at your solution and I was tempted to just to change the 4.5s to 3.5s, but with the GUID stamps in there, I don't think that'll work. If you can tell me that I can deploy .Net Framework 4.5 to an XP machine, I have a backup I would restore. Otherwise, do you happen to have the same info, only for 3.5? Thanks for your help. I'll mark your answer, to give you credit... – Chuck Apr 15 '14 at 22:21
  • Unfortunately, .Net 4.5 is supported only for Win 7 and above. You have to use 3.5 for XP (even 4.0 is not supported -- I guess). You can use same code for other Net : 3.5,4.0 etc just change the package-group. Also, refer to this example: http://stackoverflow.com/questions/16465971/including-net-installer-in-wix-bundle-not-detecting-if-already-installed. – Siva Mandadi Apr 15 '14 at 22:56
  • OK, I see I have the right understanding for the framework versions. I still have some more "converting" to do, but check out the link you sent. Thanks for your help! – Chuck Apr 16 '14 at 01:23