如何在安装过程中安装 .NET Framework 4.0?

How to install .NET framework 4.0 as part of installation?(如何在安装过程中安装 .NET Framework 4.0?)
本文介绍了如何在安装过程中安装 .NET Framework 4.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了引导程序,它可以工作但它不安装 NET Framework 4.0.安装完成后,我的应用程序无法启动,因为没有 NET Framework 4.0.为什么不安装 NETF 4.0?

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 SDKsWindowsv7.0ABootstrapper" 
    Culture="en" />
  </Target>

推荐答案

在wixproj文件中,添加如下结构.请注意,<WixTargetsPath> 标记必须位于第一个 <PropertyGroup> 节点中,以及通常存在的其余部分.

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)MicrosoftWiXv3.xWix.targets</WixTargetsPath>
    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)MicrosoftWiXv3.xWix.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 SDKsWindowsv7.0ABootstrapper</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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)