gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 11:11:20 26 4
gpt4 key购买 nike

我用java开发了我的远程屏幕共享软件。它工作正常,但是当使用 UAC 时,屏幕上会出现允许/禁止提示,但远程屏幕看不到它。所以每次用户都必须手动允许它。我想知道如何摆脱这个问题。

最佳答案

这正是 uiAccess 应用程序程序集 list 中的属性是为创建的。

我会公然地从 Microsoft AppCompat Guy 的博客中窃取和引用:

Using the uiAccess attribute of requestedExecutionLevel to Improve Applications Providing Remote Control of the Desktop

You have to elevate an application. When you do, you don’t see the UAC dialog – instead, the end user does. 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:

  • 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. 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. 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:

  • Manifest with uiAccess = true

most people don’t really understand what this is for, and the UAC manifest is typically just a copy/paste affair. 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). 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). 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.



对于 tl;dr 版本,这里是带有 uiAccess=true 的程序集 list 选项:
<?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>

关于java - 运行远程桌面应用程序时如何访问 UAC 提示符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18826248/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com