简体   繁体   English

.NET Framework 安装没有管理员权限

[英].NET Framework install w/o admin rights

I'm developing a C# WinForms app with VS2010 and its target audience are kids ages 8-14.我正在使用 VS2010 开发 C# WinForms 应用程序,其目标受众是 8-14 岁的儿童。 I estimate about 30% of my users will not have administrative access on their computers, and therefore will not be able to install my app without having their parents install it for them.我估计大约 30% 的用户在他们的计算机上没有管理权限,因此如果没有他们的父母为他们安装我的应用程序,他们将无法安装我的应用程序。

Is there any way I can have the .NET Framework install without requiring administrative rights, or somehow bundle the required .NET components with my app?有什么方法可以让我在不需要管理权限的情况下安装 .NET Framework,或者以某种方式将所需的 .NET 组件与我的应用程序捆绑在一起? I'm currently developing for .NET Framework 4, but I could easily change my code up to have it work with .NET 2 or 3.5, if needed.我目前正在为 .NET Framework 4 进行开发,但如果需要,我可以轻松地更改我的代码以使其与 .NET 2 或 3.5 一起使用。

I recommend against trying to develop a program for kids that explicitly tries to get around administrative access just because parents would have to get involved.我建议不要尝试为孩子们开发一个明确试图绕过管理访问权限的程序,因为父母必须参与其中。 Parents SHOULD be involved in the software kids install on their computers.父母应该参与孩子们在他们的电脑上安装的软件。

Necromancing, since it's 2018 now.死灵法师,因为现在是 2018 年。
Yes you can.是的,你可以。 .NET-Core allows you to do so-called self-contained deployment. .NET-Core 允许您进行所谓的自包含部署。

Windows-x86-32: Windows-x86-32:

dotnet restore -r win-x86
dotnet build -r win-x86
dotnet publish -f netcoreapp2.0 -c Release -r win-x86

Windows-x86-64: Windows-x86-64:

dotnet restore -r win-x64
dotnet build -r win-x64
dotnet publish -f netcoreapp2.0 -c Release -r win-x64

For more information: Understanding .Net Core and Mono and .NET Core vs Mono有关更多信息: 了解 .Net Core 和 Mono以及.NET Core 与 Mono

However, WinForms and WPF will come with .NET Core 3.0 in 2019. (it's now RTM)但是,WinForms 和 WPF 将在 2019 年随 .NET Core 3.0 一起提供。(现在是 RTM)
Prior to .NET Core 3.0, if you used WPF, you were out of luck.在 .NET Core 3.0 之前,如果您使用 WPF,那您就不走运了。
But if you used WinForms, you could use mono's WinForms implementation compiled for NetStandard 2.0+ .但是,如果您使用 WinForms,则可以使用为 NetStandard 2.0+ 编译的 Mono 的 WinForms 实现

However, that means you have to limit yourselfs to the parts of WinForms that mono implements (for the time being).但是,这意味着您必须将自己限制在 Mono 实现的 WinForms 部分(暂时)。

There's also the Avalonia framework , if you want to do cross-platform development.如果您想做跨平台开发,还有Avalonia 框架

Or you can just do everything in the browser, and start a server+WebBrowser on the client - that should work everywhere, particularly if you include Chrome/Chromium for windows-users to avoid browser-problems ( MS InternetExploder ).或者,您可以在浏览器中完成所有操作,并在客户端上启动服务器+WebBrowser - 这应该可以在任何地方使用,特别是如果您为 Windows 用户包含 Chrome/Chromium 以避免浏览器问题( MS InternetExploder )。

It is entirely possible, though not necessarily practical, to install an application including the .net framework without the end user having admin privileges.在最终用户没有管理员权限的情况下,安装包含 .net 框架的应用程序是完全可能的,尽管不一定实用。 The general category for what you want to do is called Application Virtualization.您要执行的操作的一般类别称为应用程序虚拟化。 We use VMWare ThinApp , an application virtualization technology similar to Spoon mentioned in an earlier post in this thread.我们使用 VMWare ThinApp ,这是一种应用程序虚拟化技术,类似于本主题之前的帖子中提到的Spoon Other applications in the category include Cameyo (www.cameyo.com) and InstallAware (www.installaware.com/virtualization/).该类别中的其他应用程序包括 Cameyo (www.cameyo.com) 和 InstallAware (www.installaware.com/virtualization/)。

You can also do a web search for "Application Virtualization" and find other results.您还可以在 Web 上搜索“Application Virtualization”并找到其他结果。 You will want to ignore Microsoft App-V and Citrix XenApp because these solutions are targeted at enterprises wanting to virtualize applications for internal deployment inside a corporate network.您将要忽略 Microsoft App-V 和 Citrix XenApp,因为这些解决方案针对的是希望将应用程序虚拟化以在公司网络内进行内部部署的企业。

There is no way to run .NET applications without installing .NET on your machine first and yes, the installation does require admin rights.如果不先在您的机器上安装 .NET,就无法运行 .NET 应用程序,是的,安装确实需要管理员权限。 Allowing that for regular users would undermine the whole point of having access restrictions in the first place.允许普通用户这样做首先会破坏访问限制的全部意义。

这是一个老问题,但似乎 Microsoft 正在计划一个.NET Native功能,该功能将在某个时候允许您编译不依赖于正在安装的 .NET Framework 的自包含 C# 应用程序,因此理论上会结束巨大的头痛参与尝试将针对较新版本 Framework 的 .NET 应用程序分发给没有管理员权限的用户。

You can try using a zero-installer, like the one from http://spoon.net , which can create single file distributions of .NET apps with the option to include a specific .NET Framework in the zero installer.您可以尝试使用零安装程序,例如http://spoon.net中的那个,它可以创建 .NET 应用程序的单个文件分发,并且可以选择在零安装程序中包含特定的 .NET Framework。 You can host these on spoon to be streamed to the client computer or opt for deploying the single file exe's yourself using Spoon Studio (http://spoon.net/Studio/)您可以将这些托管在勺子上以流式传输到客户端计算机,或者选择使用 Spoon Studio (http://spoon.net/Studio/) 自己部署单个文件 exe

We aren't allowed to install software on our workstations either, but we are able to use the SDK binaries ( not the installers, as they require admin rights ) and dev in dotNet Core on our workstations and do all of this with no admin perms.我们也不允许在我们的工作站上安装软件,但是我们可以在我们的工作站上使用 dotNet Core 中的 SDK 二进制文件(不是安装程序,因为它们需要管理员权限)和 dev 并且在没有管理员权限的情况下完成所有这些.

Simply download the binaries from the dotNet Core download page and select the 'binary installer'.只需从dotNet Core 下载页面下载二进制文件,然后选择“二进制安装程序”。 Then extract the SDK whereever you like.然后在您喜欢的任何位置提取 SDK。

Next, add the path as a new User Path Variable.接下来,将路径添加为新的用户路径变量。 From the Start Menu, type 'environment' and pick Edit environmental Variables for your account .从“开始”菜单中,输入“环境”并为您的帐户选择“编辑环境变量” Then add a new variable titled MSBuildSDKSsPath with a value of the place you extracted the binaries.然后添加一个名为MSBuildSDKSsPath的新变量,其值为您提取二进制文件的位置。

For me, I extracted the binaries to C:\\dev\\dotnetCore so I set the value as C:\\dev\\dotnetCore .对我来说,我将二进制文件解压缩到 C:\\dev\\dotnetCore,所以我将值设置为C:\\dev\\dotnetCore A quick restart of Visual Studio later and .Net Core 2.1 and up now appears within my available targer frameworks.稍后快速重启 Visual Studio 和 .Net Core 2.1 及更高版本现在出现在我可用的目标框架中。

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

相关问题 安装没有管理员权限的 WinForms 应用程序 - Install WinForms application without admin rights 如何从没有实体框架的.NET Core 2.1 Web API中检索类中的连接字符串 - How to retrieve connection string in class from .NET Core 2.1 Web API w/o Entity Framework 是否可以在没有管理员权限的情况下安装,启动和停止Windows服务? - Is possible to install ,start and stop the windows service without admin rights? 安装没有管理员权限的MSBuild 15(Microsoft Build工具)? - Install MSBuild 15 (Microsoft Build tools) without admin rights? 在没有管理员权限的情况下在Linux中运行.NET解决方案文件 - Running a .NET solution file in Linux without Admin rights 使用C#.NET从每个桌面删除管理员权限 - Removal of admin rights from each desktop using C# .NET 在没有管理员权限的情况下自动更新Vista中的.NET应用程序 - automatically update my .NET application in Vista without admin rights 实体框架LINQ-访问实体字段而不获取它 - Entity framework LINQ - access entity field w/o fetching it 单个方法的管理员权限 - Admin rights for a single method 以管理员权限执行安装程序 - Execute Setup with admin rights
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM