Studio
2023.4
False
横幅背景图像
Studio 用户指南
上次更新日期 2024年4月26日

UiPath 远程插件

概述

With the UiPath® Extension for Windows Remote Desktop you can natively generate selectors over RDP connections handled by custom remote applications that use the Microsoft RDP ActiveX control.

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

<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;
}
注意:若要通过 RDP 连接器生成原生选取器,您还需在远程桌面计算机上部署 UiPath Remote Runtime 组件,如关于 UiPath Remote Runtime 所述。您可以通过在此处请求 UiPathRemoteRuntime.msi 安装程序来获取它。

此页面是否有帮助?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath 白色徽标
信任与安全
© 2005-2024 UiPath. All rights reserved.