如何安装.NET Framework 4.0的安装的一部分? [英] How to install .NET framework 4.0 as part of installation?

查看:324
本文介绍了如何安装.NET Framework 4.0的安装的一部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建的引导程序,它的工作原理 但它并没有安装.NET框架4.0。安装完成后,我的应用程序无法启动,因为没有.NET框架4.0。 为什么不安装NETF 4.0?

 < ItemGroup>
    < BootstrapperFile包括=Microsoft.Windows.Installer.4.5>
      <产品名称>的Windows Installer 4.5< /产品名称>
    < / BootstrapperFile>
       < BootstrapperPackage包括=NETFramework,版本= V4.0。>
            &其中;可见>真&所述; /可见光>
            <产品名称>的.NET Framework 4.0< /产品名称>
            <安装>真< /安装>
        &其中;可见>真&所述; /可见光>
      < / BootstrapperPackage>
  < / ItemGroup>
  <导入项目=$(WixTargetsPath)/>
  <目标名称=AfterBuild>
    < GenerateBootstrapper ApplicationFile =DOGInstaller.msi
    应用程序名称=狗
    BootstrapperItems =@(BootstrapperFile)
    CopyComponents =真
    ComponentsLocation =首页网站
    OutputPath =$(OutputPath)\ EN-US \
    PATH =C:\ Program Files文件(x86)的\微软的SDK \的Windows \ v7.0A \引导程序
    文化=EN/>
  < /目标>
 

解决方案

在wixproj文件,添加下面的结构。请注意,< WixTargetsPath> 标签必须位于第一个<的PropertyGroup> 节点,随着其余什么是平时有。

 <项目>
  <的PropertyGroup> <! - 这必须是第一个的PropertyGroup节点。 - >
    ...
    < WixTargetsPath条件='$(WixTargetsPath)'==''和'$(MSBuildExtensionsPath32)'!='> $(MSBuildExtensionsPath32)\微软\维克斯\ 3.x版\ Wix.targets< / WixTargetsPath>
    < WixTargetsPath条件='$(WixTargetsPath)'==''> $(MSBuildExtensionsPath)\微软\维克斯\ 3.x版\ Wix.targets< / WixTargetsPath>
  < /的PropertyGroup>
  ...
  < ItemGroup>
    < BootstrapperFile包括=Microsoft.Windows.Installer.3.1>
      <产品名称>的Windows Installer 3.1< /产品名称>
    < / BootstrapperFile>
    < BootstrapperFile包括=NETFramework,版本= V4.0。>
      <产品名称>的Microsoft .NET Framework 4.0(x86和x64)LT; /产品名称>
    < / BootstrapperFile>
  < / ItemGroup>
  <的PropertyGroup>
    < BootstrapperPath> $(PROGRAMFILES)\微软的SDK \的Windows \ v7.0A \引导程序\< / BootstrapperPath>
  < /的PropertyGroup>
  <目标名称=AfterBuild>
    < GenerateBootstrapper
      ApplicationFile =$(TargetFileName)
      应用程序名称=$(OutputName)
      BootstrapperItems =@(BootstrapperFile)
      ComponentsLocation =相对
      CopyComponents =真
      OutputPath =$(OutputPath)
      PATH =$(BootstrapperPath)/>
  < /目标>
< /产品>
 

I created bootstrapper,it works but it does not install NET Framework 4.0. After the installation completed my application does not start because no NET Framework 4.0. Why it does not install NETF 4.0?

<ItemGroup>
    <BootstrapperFile Include="Microsoft.Windows.Installer.4.5">
      <ProductName>Windows Installer 4.5</ProductName>
    </BootstrapperFile>
       <BootstrapperPackage Include=".NETFramework,Version=v4.0">
            <Visible>True</Visible>
            <ProductName>.NET Framework 4.0</ProductName>
            <Install>True</Install>
        <Visible>True</Visible>
      </BootstrapperPackage>
  </ItemGroup>
  <Import Project="$(WixTargetsPath)" />
  <Target Name="AfterBuild">
    <GenerateBootstrapper ApplicationFile="DOGInstaller.msi" 
    ApplicationName="DOG" 
    BootstrapperItems="@(BootstrapperFile)" 
    CopyComponents="True" 
    ComponentsLocation="HomeSite"
    OutputPath="$(OutputPath)\en-us\"
    Path="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper" 
    Culture="en" />
  </Target>

解决方案

In the wixproj file, add the following structure. Note that the <WixTargetsPath> tags must reside in the the first <PropertyGroup> node, along with the rest of what's usually there.

<Project>
  <PropertyGroup> <!-- This must be the first PropertyGroup node. -->
    ...
    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
  </PropertyGroup>
  ...
  <ItemGroup>
    <BootstrapperFile Include="Microsoft.Windows.Installer.3.1">
      <ProductName>Windows Installer 3.1</ProductName>
    </BootstrapperFile>
    <BootstrapperFile Include=".NETFramework,Version=v4.0">
      <ProductName>Microsoft .NET Framework 4.0 (x86 and x64)</ProductName>
    </BootstrapperFile>
  </ItemGroup>
  <PropertyGroup>
    <BootstrapperPath>$(ProgramFiles)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\</BootstrapperPath>
  </PropertyGroup>
  <Target Name="AfterBuild">
    <GenerateBootstrapper
      ApplicationFile="$(TargetFileName)"
      ApplicationName="$(OutputName)"
      BootstrapperItems="@(BootstrapperFile)"
      ComponentsLocation="Relative"
      CopyComponents="True"
      OutputPath="$(OutputPath)"
      Path="$(BootstrapperPath)" />
  </Target>
</Product>

这篇关于如何安装.NET Framework 4.0的安装的一部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆