简体   繁体   English

静默安装.NET Framework 4.5

[英]Silent installation of .NET framework 4.5

I need to perform a silent installation of .NET Framework 4.5, along with an ASP.NET Core api that runs as a service, because for this api to work, you need this version of the framework installed. 我需要执行.NET Framework 4.5的无提示安装以及作为服务运行的ASP.NET Core API,因为要使该API正常工作,您需要安装此版本的框架。 Does anyone have an idea? 有人有主意吗?

Thanks 谢谢

You must provide the .net 4.5 framework installation as an .msi package if you want the server/user to install the framework on their computer. 如果希望服务器/用户在其计算机上安装框架,则必须以.msi软件包的形式提供.net 4.5框架安装。 Otherwise they need to install it beforehand for your .net core api to work. 否则,他们需要预先安装它才能使您的.net核心api工作。

Unfortunately .net 4.5 does not allow you to do a "Self Contained" deployment package like .Net Core does. 不幸的是,.net 4.5不允许您像.Net Core一样进行“自包含”部署程序包。

If you are able to convert the functionality to pure .net core, then you could absolutely deploy a self contained package to run the APi and the user never needs to know how to install the proper framework for your application to work, obviously this mos likely won't be possible in some situations. 如果您能够将功能转换为纯.net核心,那么您可以绝对部署一个自包含的程序包来运行APi,并且用户永远不需要知道如何安装适当的框架来使应用程序正常工作,这很可能是在某些情况下是不可能的。

EDIT: You can either manually execute or create a quick console app to execute a powershell script to install the .net 4.5 framework. 编辑:您可以手动执行或创建快速控制台应用程序以执行Powershell脚本来安装.net 4.5框架。

This may work or get you on the right path. 这可能有效或使您走上正确的道路。 Instead of using a local path maybe you can pass in an http link or a shared drive elsewhere on your network. 除了使用本地路径之外,您还可以传递http链接或网络上其他位置的共享驱动器。 I only use powershell scripts sometimes so this may need a bit more research to meet your company architecture. 有时我只使用Powershell脚本,因此可能需要更多研究才能满足您的公司架构。

PS C:\Users\VPS1146858Admin\Downloads> Start-Process -FilePath "C:\Users\VPS1146858Admin\Downloads\dotNetFx45_Full_setup.exe" -ArgumentList "/q /norestart" -Wait

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM