How can I create a bootstrapper that auto-installs .Net Framework 4.5

前端 未结 1 1731
我在风中等你
我在风中等你 2021-01-24 23:23

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 no

相关标签:
1条回答
  • 2021-01-24 23:56

    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> 
    

    0 讨论(0)
提交回复
热议问题