简体   繁体   English

运行远程桌面应用程序时如何访问 UAC 提示?

[英]How to get access to UAC prompt when running remote desktop application?

I have developed my remote screen share software in java.我用java开发了我的远程屏幕共享软件。 It is working fine, but when there is use of UAC , the allow/disallow prompt comes on the screen but remote screen can not see it.它工作正常,但是当使用 UAC 时,屏幕上会出现允许/禁止提示,但远程屏幕看不到它。 So every time user has to allow it manually.所以每次用户都必须手动允许它。 I want to know how to get rid of this problem.我想知道如何摆脱这个问题。

This is exactly what the uiAccess attribute in an application's assembly manifest was created for.这正是创建应用程序程序集清单中的uiAccess属性的目的。

i'll blatently steal and quote from a the Microsoft AppCompat Guy's blog:我将公然窃取并引用 Microsoft AppCompat Guy 的博客:

Using the uiAccess attribute of requestedExecutionLevel to Improve Applications Providing Remote Control of the Desktop 使用requestedExecutionLevel 的uiAccess 属性改进提供桌面远程控制的应用程序

You have to elevate an application.您必须提升应用程序。 When you do, you don't see the UAC dialog – instead, the end user does.当您这样做时,您不会看到 UAC 对话框 - 相反,最终用户会看到。 Even if you decide to give the user the password (it happens), you then can't control or even see the elevated application.即使您决定向用户提供密码(它发生了),您也无法控制甚至看到提升的应用程序。

Kind of makes it hard to be a helpdesk when that happens.发生这种情况时,很难成为帮助台。

Here are the 3 solutions that I have seen to this problem:以下是我看到的解决此问题的 3 个解决方案:

  • Do nothing.没做什么。 That's what our solution did.这就是我们的解决方案所做的。 It just failed every time elevation was involved.每次涉及海拔时它都失败了。
  • Install a service.安装服务。 That's what company X did.这就是 X 公司所做的。 It requires the user to know an admin password, and that's a problem for my customers它要求用户知道管理员密码,这对我的客户来说是个问题
  • Run the application elevated.运行提升的应用程序。 That's what company Y did. Y公司就是这样做的。 It requires the user to know an admin password (a problem with my customers), and also won't allow you to interact with any windows running at System integrity level (so an incomplete solution)它要求用户知道管理员密码(我的客户有问题),并且不允许您与在系统完整性级别运行的任何窗口进行交互(因此是一个不完整的解决方案)

Here's what I wish all 3 had done:这是我希望所有 3 人都完成的事情:

  • Manifest with uiAccess = true带有 uiAccess = true 的清单

most people don't really understand what this is for, and the UAC manifest is typically just a copy/paste affair.大多数人并不真正理解这是为了什么,并且 UAC 清单通常只是复制/粘贴事件。 But it pays for the remote desktop developer to pay attention to it.但是远程桌面开发人员需要注意它。 For any regular piece of software, you generally want to stay away from it – it's dangerous, and sidesteps a significant security feature (UIPI).对于任何常规软件,您通常都希望远离它 - 它很危险,并且回避了重要的安全功能 (UIPI)。 But if you are remoting the desktop, it's precisely what you want – you need to be able to see everything!但是,如果您要远程处理桌面,这正是您想要的——您需要能够看到一切!

It's dangerous enough, in fact, that we won't allow you to set it without digitally signing your application.事实上,这已经够危险了,我们不允许您在不对您的应用程序进行数字签名的情况下对其进行设置。 By default, you also have to have it installed in a secure location (such as Program Files).默认情况下,您还必须将其安装在安全位置(例如 Program Files)。 You can set a group policy to not require a secure location, but there is no option to not require a signature.您可以将组策略设置为不需要安全位置,但没有不需要签名的选项。

However, once set up, it's really powerful.然而,一旦设置,它真的很强大。 You'll be able to remote every possible kind of window – any integrity level at all.您将能够远程控制每一种可能的窗口——任何完整性级别。 No more blank, unresponsive screens.不再出现空白、无响应的屏幕。 Everything comes across, regardless of integrity level.无论完整性级别如何,都会遇到一切。

For the tl;dr version, here is the assemblymanifest with the uiAccess=true option:对于 tl;dr 版本,这里是带有uiAccess=true选项的uiAccess=true

<?xml version='1.0' encoding='UTF-8' standalone='yes'?> 
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' 
 manifestVersion='1.0'> 
  <assemblyIdentity 
   version="1.0.0.0" 
   processorArchitecture="X86" 
   name="client" 
   type="win32" 
  /> 

  <description>Oh god not Java</description> 

  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> 
    <security> 
      <requestedPrivileges> 
        <requestedExecutionLevel level="asInvoker" 
         uiAccess="true"/> 
      </requestedPrivileges> 
    </security> 
  </trustInfo> 
</assembly>

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

相关问题 如何通过JavaFX桌面应用程序捆绑包请求UAC管理特权? - How do I request UAC administrative privileges with a JavaFX desktop application bundle? 如何在运行命令提示符的Java应用程序的桌面上放置图标 - How to put an icon on desktop for my java application that runs on Command Prompt 运行程序时不显示UAC提示 - Don't show the UAC prompt when I run a program Android应用程序如何作为桌面应用程序的远程控制器? (Spotify的) - How can an Android application function as a remote controller to a desktop application? (Spotify) 运行Java Web应用程序时在命令提示符中显示进度 - show progress in command prompt when java web application is running 如何使用远程数据库制作快速桌面应用程序? - How Can I Make Fast Desktop Application With Remote Database? 如何在远程桌面的Swing应用程序中确定字体宽度(以像素为单位) - How to determine font width in pixels in Swing application for remote desktop 如何跟踪在远程主机上运行的Java应用程序 - How to trace a java application running on a remote host 如何获取在远程Windows机器上运行的Java应用程序的所有线程的堆栈跟踪 - How to get the stack trace of all threads of a java application running on a remote windows machine 如何在正在运行的桌面应用程序中使用ANT运行Junit测试用例? - How to run Junit test cases using ANT in a running desktop application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM