How can I create a bootstrapper that auto-installs

2020-04-29 16:09发布

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!!!

1条回答
老娘就宠你
2楼-- · 2020-04-29 17:00

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> 

查看更多
登录 后发表回答