如何添加.Net Framework前提条件以进行安装安装 [英] How to add .Net framework prerequisite to setup install

查看:40
本文介绍了如何添加.Net Framework前提条件以进行安装安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MS Visual Studio 2017 中有一个C#WinForms项目.我已经添加了一个Visual Studio安装程序安装向导项目来为我的应用程序创建一个安装程序.这是我第一次使用安装程序项目.

I have a C# WinForms project in MS Visual Studio 2017. I have added a Visual Studio Installer Setup Wizard Project to create an installer for my application. This is my first time using an installer project.

安装程序正确具有.Net Framework 4.5.1的前提条件.但是,我想让安装程序包括.Net框架安装,而不是要求用户在安装时单独下载并安装(某些用户的计算机没有Internet连接).

The installer correctly has a prerequisite for .Net framework 4.5.1. However, I would like to make the installer include the .Net framework installation instead of asking the user to download and install it separately at install-time (some of the users' machines don't have internet connections).

我已经在设置属性"页面中将前提条件设置为从与应用程序相同的位置下载前提条件",但是在构建安装程序时,我看到3个错误,如下所示:

I have already set the prerequisites to "Download prerequisites from the same location as my application" in the Setup Property Pages, but when I build the setup I see 3 errors as follows:

错误:要在先决条件"对话框中启用从与我的应用程序相同的位置下载先决条件",必须为项目"Microsoft"下载文件"DotNetFX461 \ NDP461-KB3102436-x86-x64-AllOS-ENU.exe".NET Framework 4.6.1(x86和x64)"添加到本地计算机.有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkId=616018 .

包含的链接并没有真正帮助,因为它涉及ClickOnce安装.我已经有提到的NDP461 exe,但我不知道将其放在哪里.我看到其他一些问题,提到使用MS Bootstrapper程序包管理器创建引导程序包,但是由于MS关闭了code.msdn.microsoft,并使用

The link included doesn't really help as it refers to ClickOnce installs. I have the mentioned NDP461 exe but I don't know where to put it. I see some other questions mention creating a bootstrapper package using the MS Bootstrapper Package Manager, but this seems to have disappeared from the internet with MS's closure of code.msdn.microsoft, with apparently no information on a replacement. Additionally, most documentation and SO questions that I can find on the subject relate to older versions of MSVS, and do not correlate (at least not directly enough for me to figure out!) to MSVS 2017.

我该如何实际获取安装项目以找到exe?我是否只需要将其放置在正确的位置(已经尝试了在各种MSDN页面和注册表项下列出的一些文件)?还是我需要创建一个引导程序包?如果是后者,是否在某处有关于此过程的最新文档?谢谢!

How do I go about actually getting the setup project to find the exe? Do I simply need to plop it in the right location (already tried a few that were listed on various MSDN pages and under registry keys)? Or do I need to create a bootstrapper package? If the latter, is there up to date documentation on this process somewhere? Thanks!

PS:如果我选择使用开发机器上已经安装的(最新).Net框架,此过程会更容易吗?(我猜想机器上可能已经有安装信息了)

PS: Would the process be easier if I chose instead to use the (more recent) .Net framework that is already installed on my development machine? (I'm guessing there might be install information for that already on the machine somewhere)

更新,所以我尝试改用.NET 4.6,下载了NDP46-KB3045557-x86-x64-AllOS-ENU.exe并将其放置在目录 C:\ Program Files中(x86)\ Microsoft SDKs \ ClickOnce Bootstrapper \ Packages \ DotNetFX46 .现在,将安装安装程序安装项目,但会发出以下警告(同样,其中3个警告):

Update So I tried switching to targeting .NET 4.6 instead, downloaded NDP46-KB3045557-x86-x64-AllOS-ENU.exe and placed it in the directory C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX46. The installer setup project now builds but gives the following warning (again, 3 of them):

警告:"Microsoft .NET Framework 4.6(x86和x64)"中"PublicKey"属性的值与文件"C:\ Program Files(x86)\ Microsoft SDKs \ ClickOnce Bootstrapper \ Packages \"的值不匹配DotNetFX46 \ NDP46-KB3045557-x86-x64-AllOS-ENU.exe'.

WARNING: The value of the 'PublicKey' attribute in 'Microsoft .NET Framework 4.6 (x86 and x64)' does not match that of file 'C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX46\NDP46-KB3045557-x86-x64-AllOS-ENU.exe'.

我想这意味着我应该这样做吗?

I guess this means I'm not supposed to do it this way?

推荐答案

只需从以下位置下载 NDP461-KB3102436-x86-x64-AllOS-ENU.exe 文件此链接

Just download NDP461-KB3102436-x86-x64-AllOS-ENU.exe file from This Link

并复制到 C:\ Program Files(x86)\ Microsoft SDKs \ ClickOnce Bootstrapper \ Packages \ DotNetFX461

这篇关于如何添加.Net Framework前提条件以进行安装安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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