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?


基础教程推荐
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01