studio
2023.10
false
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

Studio 用户指南

上次更新日期 2025年9月3日

为自定义远程应用程序配置 UiPath 远程插件

概述

借助 Windows 远程桌面扩展程序,您可以通过使用 Microsoft RDP ActiveX 控件的自定义远程应用程序处理的 RDP 连接原生生成选取器。

例如,当自定义应用程序从服务器打开计算器应用程序时,选取器为:

<wnd app='customapp.exe' cls='RAIL_WINDOW' title='Calculator (Remote)' />

完成以下步骤后,选取器将变为:

<wnd app='win32calc.exe' cls='CalcFrame' isremoteapp='1' title='Calculator' />

这使您可以自动化远程应用程序。

安装 UiPath Microsoft 远程桌面和 Apps 扩展程序

  1. 首先,请按照“Microsoft 远程桌面和应用程序扩展程序”中所述的步骤安装扩展程序。
  2. 该扩展程序通过以下任一方式更新 Software\Microsoft\Terminal Server Client\Default\AddIns注册表:
    • LocalMachine - 如果已为整个系统安装扩展程序
    • CurrentUser - 如果扩展程序是为单个用户安装的
  3. 检查注册表编辑器,确保扩展程序更改了注册表。其外观应如下所示:


更新自定义应用程序中的 PluginsDLL 配置

  1. 获取对 PluginDLL 配置的引用。
  2. Software\Microsoft\Terminal Server Client\Default\AddIns 注册表项的“名称”子项中获取 UiPath Windows 远程桌面 DLL 文件路径扩展程序,方法可选择以下其一:
    • LocalMachine - 如果已为整个系统安装扩展程序
    • CurrentUser - 如果扩展程序是为单个用户安装的
  3. 使用在上述步骤中获得的 DLL 文件路径构建一个以逗号分隔的字符串。
  4. 使用新计算的字符串更新 PluginDLL 配置。

有关更多详细信息,请参阅 Microsoft 的远程桌面 ActiveX 控件文档

在下面的代码片段中,您可以看到如何使用从注册表读取的值设置 PluginDLL 配置的示例:

// Setting the PluginDlls configuration
mstscActiveX.AdvancedSettings7.PluginDlls = GetInstalledPluginDlls();// Getting the DLL paths from the Registry
private string GetInstalledPluginDlls()
{
    List<string> pluginDllsPerMachine = GetInstalledPluginDllsFromKey(Registry.LocalMachine);
    List<string> pluginDllsPerUser = GetInstalledPluginDllsFromKey(Registry.CurrentUser);
    
    var allPlugins = pluginDllsPerMachine.Concat(pluginDllsPerUser).ToList();
    return string.Join(",", allPlugins);
}
private List<string> GetInstalledPluginDllsFromKey(RegistryKey key)
{
    List<string> pluginDlls = new List<string>();
    try
    {
        using var regAddIns = key.OpenSubKey(@"Software\Microsoft\Terminal Server Client\Default\AddIns", false);
        if (regAddIns != null)
        {
            foreach (var regAddIn in regAddIns.GetSubKeyNames())
            {
                using var regAddin = regAddIns.OpenSubKey(regAddIn, false);
                var addInName = regAddin.GetValue("Name");
                if (addInName != null && addInName.ToString().ToLower().EndsWith(".dll"))
                {
                    pluginDlls.Add(addInName.ToString());
                }
            }
        }
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex.ToString());
    }
    return pluginDlls;
}…
// Setting the PluginDlls configuration
mstscActiveX.AdvancedSettings7.PluginDlls = GetInstalledPluginDlls();
…
// Getting the DLL paths from the Registry
private string GetInstalledPluginDlls()
{
    List<string> pluginDllsPerMachine = GetInstalledPluginDllsFromKey(Registry.LocalMachine);
    List<string> pluginDllsPerUser = GetInstalledPluginDllsFromKey(Registry.CurrentUser);
    
    var allPlugins = pluginDllsPerMachine.Concat(pluginDllsPerUser).ToList();
    return string.Join(",", allPlugins);
}
private List<string> GetInstalledPluginDllsFromKey(RegistryKey key)
{
    List<string> pluginDlls = new List<string>();
    try
    {
        using var regAddIns = key.OpenSubKey(@"Software\Microsoft\Terminal Server Client\Default\AddIns", false);
        if (regAddIns != null)
        {
            foreach (var regAddIn in regAddIns.GetSubKeyNames())
            {
                using var regAddin = regAddIns.OpenSubKey(regAddIn, false);
                var addInName = regAddin.GetValue("Name");
                if (addInName != null && addInName.ToString().ToLower().EndsWith(".dll"))
                {
                    pluginDlls.Add(addInName.ToString());
                }
            }
        }
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex.ToString());
    }
    return pluginDlls;
}
Note: To generate native selectors over RDP connections, you also need to deploy the UiPath Remote Runtime component on the Remote Desktop machine, as explained in About UiPath Remote Runtime.
可从以下位置下载 UiPathRemoteRuntime.msi 安装程序:

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo
信任与安全
© 2005-2025 UiPath。保留所有权利。