How to install .NET framework 4.0 as part of installation?(如何在安装过程中安装 .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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在安装过程中安装 .NET Framework 4.0?
基础教程推荐
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 如何激活MC67中的红灯 2022-01-01