如何创建自动安装 .Net Framework 4.5 的引导程序

How can I create a bootstrapper that auto-installs .Net Framework 4.5(如何创建自动安装 .Net Framework 4.5 的引导程序)

本文介绍了如何创建自动安装 .Net Framework 4.5 的引导程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 InstallShield 2013 LE,我正在寻找类似于 SQL CE 4.0 的东西作为 InstallShield Prerequisite .只是,我想安装 .Net Framework 4.5,如果它还没有在机器上.我有框架所需的文件,但 LE 不允许我处理先决条件.

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.

我看到了 DotNetInstaller 的推荐,我下载并开始研究它.但看起来 DotNetInstaller 很旧,并且在其列表中不包含 .Net Framework 4.5(独立).有办法添加吗?

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?

然后我查看了 WiX,并不确定我是否可以按照文档进行操作.

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

我还看到 http://msdn.microsoft.com/en-us/library/ms165429.aspx 描述了直接制作引导程序,但那里的细节很少.

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?

谢谢!!!

推荐答案

您需要在引导程序bundle.wxs"中执行以下操作
1. 参考 NetFxExtension.dll,可在 Wix SDK 文件夹中找到
2. 创建 Util 来查看用户是否有 .net45
3.Net 4.5下载链接

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

我为我的一个项目做过类似的事情,下面是我的 bundle.wxs 供您参考

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="ImagesMicrosoft-.NET-4.5-Icon.ico"/>
  <Payload SourceFile="C:Program Files (x86)WiX Toolset v3.8SDKMicrosoft.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> 

这篇关于如何创建自动安装 .Net Framework 4.5 的引导程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何创建自动安装 .Net Framework 4.5 的引导程序

基础教程推荐