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?


- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 输入按键事件处理程序 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01