Integrate a Windows or macOS plug-in to a third-party application

更新时间:
复制 MD 格式

The Alibaba Cloud Workspace plug-in lets third-party applications launch and manage cloud computer sessions without requiring users to switch to a separate client. By embedding stream_launcher into your application, you can connect users to Elastic Desktop Service (EDS) cloud computers, disconnect sessions, trigger updates, and collect feedback—all through your own UI.

Prerequisites

Before you begin, ensure that you have:

  • A signed third-party cooperation contract with Alibaba Cloud Workspace

  • An account registered on the Alibaba Cloud OpenAPI Explorer platform for EDS, with API permissions and credentials obtained

For the full list of EDS API operations, see List of operations by function.

Install the plug-in

Download the plug-in for your platform:

  • macOS: https://ecd-client.oss-cn-shanghai.aliyuncs.com/wuying/mac1015/wuying-setup.dmg

  • Windows: https://ecd-client.oss-accelerate.aliyuncs.com/wuying/windows10/wuying-setup.exe

To verify that stream_launcher is already installed and get its path, see Check whether stream_launcher is installed.

Silent installation

For automated deployments, use the following commands to install without user prompts.

Important

Before running silent installation, make sure that the plug-in is installed. See Check whether stream_launcher is installed.

Windows:

wuying-setup.exe /sp- /verysilent /norestart /nocancel
FlagDescription
/sp-Suppresses the initial "This will install..." prompt
/verysilentRuns the installer with no UI
/norestartPrevents automatic restart after installation
/nocancelDisables the cancel button during installation
After installation on Windows, a desktop shortcut and a Start menu entry are created. To remove them, see Delete the Windows desktop shortcut.

macOS:

hdiutil attach wuying-setup.dmg -mountpoint /Volumes/AliyunEds -nobrowse \
&& cp -R /Volumes/AliyunEds/Alibaba\ Cloud\ Workspace.app /Applications/Alibaba\ Cloud\ Workspace.app \
&& hdiutil detach /Volumes/AliyunEds

Integration methods

Three integration methods are available. All methods pass a JSON payload to stream_launcher to trigger operations on the Alibaba Cloud Workspace client.

MethodHow it worksBest for
CLI-basedCall stream_launcher directly with a --param flagServer-side or scripted integrations
File-basedWrite a .aspkey JSON file and open it via the OS default handlerWorkflows that pass data as files
URL scheme-basedLaunch a wuying:// URL from a browser or shellWeb applications and browser-based triggers
The Alibaba Cloud Workspace client for Windows also supports open SDKs for more advanced integration scenarios. See Windows SDK.

CLI-based integration

Pass the JSON payload directly to stream_launcher using the --param flag.

macOS:

stream_launcher --param='{"operation": "openDesktop", "bizParam": {...}, "partnerInfo": {...}}'

Windows:

stream_launcher.exe --param='{"operation": "openDesktop", "bizParam": {...}, "partnerInfo": {...}}'

To find the path to stream_launcher, see Check whether stream_launcher is installed.

File-based integration

Save the JSON payload to a file with the .aspkey extension and open it using the OS default application handler.

Example file: `demo.aspkey`

{
  "param": {
    "operation": "openDesktop"
  }
}

Open the file directly or pass it to stream_launcher:

macOS:

stream_launcher --file="path/to/param.aspkey"
open -a stream_launcher "path/to/param.aspkey"

Windows:

stream_launcher.exe --file="path\to\param.aspkey"

URL scheme-based integration

Trigger operations by launching a wuying:// URL. This approach works from browsers and any shell that can open URLs.

wuying://?param={"operation": "openDesktop", "bizParam": {...}, "partnerInfo": {...}}

Pass the URL directly to stream_launcher, or use OS-native commands:

macOS:

stream_launcher --url='wuying://?param={"operation": "openDesktop", ...}'
open 'wuying://?param={"operation": "openDesktop", ...}'

Windows:

stream_launcher.exe --url='wuying://?param={"operation": "openDesktop", ...}'
start 'wuying://?param={"operation": "openDesktop", ...}'

Windows (PowerShell):

Start-Process 'wuying://?param={"operation": "openDesktop", ...}'

Connect to a cloud computer

Use the openDesktop operation to connect a user to a cloud computer. Before calling this operation, get a connection ticket from the GetConnectionTicket API.

A universally unique identifier (UUID) is required to get a ticket. See Get a UUID.

Parameters

Required parameters:

ParameterTypeDescriptionExample
operationStringThe operation to perform.openDesktop
bizParam.ticketStringThe connection ticket returned by GetConnectionTicket.
bizParam.desktopIdStringThe ID of the cloud computer. Returned by GetConnectionTicket.ecd-7nvbz4ccjly95xxxx
bizParam.desktopNameStringThe name of the cloud computer. Returned by GetConnectionTicket.cloud-computer-A
bizParam.osTypeStringThe OS of the cloud computer. Returned by GetConnectionTicket.windows
partnerInfo.partnerStringYour company name.Company A
partnerInfo.partnerAppStringThe name of your application.Application B

Optional parameters (`extInfo`):

ParameterTypeDescriptionExample
extInfo.languageStringDisplay language for all cloud computer windows. Default: zh (Chinese).zh, en
extInfo.cloudDpiintDefault dots per inch (DPI) on startup. Windows cloud computers only. Integer between 100 and 200 (percentage).150
extInfo.fullscreenboolStart the session in full-screen mode.true
extInfo.isVpcboolConnect over a virtual private cloud (VPC).false
extInfo.hideFloatingBallboolHide the DesktopAssistant widget on the cloud computer desktop.false

Optional parameters (`proxy`):

ParameterTypeDescriptionExample
proxy.typeStringProxy type. Valid values: system, socket, HTTP.system
proxy.hostStringProxy host address.127.x.x.x
proxy.portintProxy port number.50550
proxy.accountStringProxy account username.
proxy.passwordStringProxy account password.

Example

{
  "operation": "openDesktop",
  "bizParam": {
    "ticket": "xxxxxxxxxxxxxxxxxxxxxxx",
    "desktopId": "ecd-7nvbz4ccjly95xxxx",
    "desktopName": "cloud-computer-A",
    "osType": "windows"
  },
  "partnerInfo": {
    "partner": "wuyingPartnerTest",
    "partnerApp": "WuyingPartnerTestApp"
  },
  "extInfo": {
    "language": "zh",
    "cloudDpi": 150,
    "fullscreen": true,
    "isVpc": true,
    "hideFloatingBall": true,
    "proxy": {
      "type": "system",
      "host": "xxxxxx",
      "port": 1111,
      "account": "xxxx",
      "password": "xxx"
    }
  }
}

Disconnect from a cloud resource

Use the closeConnection operation to end an active session.

Parameters

ParameterTypeDescriptionExample
operationStringThe operation to perform.closeConnection
bizParam.idStringThe ID of the cloud resource to disconnect from. For cloud computers, use the desktopId.ecd-7nvbz4ccjly95xxxx
partnerInfo.partnerStringYour company name.Company A
partnerInfo.partnerAppStringThe name of your application.Application B

Example

{
  "operation": "closeConnection",
  "bizParam": {
    "id": "ecd-7nvbz4ccjly95xxxx"
  },
  "partnerInfo": {
    "partner": "wuyingPartnerTest",
    "partnerApp": "WuyingPartnerTestApp"
  }
}

Submit feedback

Use the feedback operation to upload plug-in logs to Alibaba Cloud Workspace technical support.

Parameters

ParameterTypeDescriptionExample
operationStringThe operation to perform.feedback
partnerInfo.partnerStringYour company name.Company A
partnerInfo.partnerAppStringThe name of your application.Application B

Example

{
  "operation": "feedback",
  "partnerInfo": {
    "partner": "wuyingPartnerTest",
    "partnerApp": "WuyingPartnerTestApp"
  }
}

Check for plug-in updates

Use the upgrade operation to trigger a plug-in update check for stream_launcher.

Parameters

ParameterTypeDescriptionExample
operationStringThe operation to perform.upgrade
partnerInfo.partnerStringYour company name.Company A
partnerInfo.partnerAppStringThe name of your application.Application B

Example

{
  "operation": "upgrade",
  "partnerInfo": {
    "partner": "wuyingPartnerTest",
    "partnerApp": "WuyingPartnerTestApp"
  }
}

Exit stream_launcher

To close the Alibaba Cloud Workspace client from your application, call stream_launcher with the --requestExit flag. Only CLI-based integration is supported for this operation.

macOS:

stream_launcher --requestExit

Windows:

stream_launcher.exe --requestExit

Appendix 1: Check whether stream_launcher is installed and get its path

Run the following code to check if stream_launcher is installed and get its file path.

Windows (C++):

#include <Windows.h>
#include <Shlwapi.h>
#include <string>
#include <iostream>

DWORD length = 0;
HRESULT hr = AssocQueryString(0, ASSOCSTR_EXECUTABLE, ".aspkey", NULL, NULL, &length);

if (length == 0) {
    // stream_launcher is not installed.
}

char* path = new char[length + 1];
hr = AssocQueryString(0, ASSOCSTR_EXECUTABLE, ".aspkey", NULL, path, &length);
if (SUCCEEDED(hr)) {
    // path contains the location of stream_launcher.exe.
} else {
    // stream_launcher is not installed.
}

macOS (Objective-C):

#import <Foundation/Foundation.h>
#import <CoreServices/CoreServices.h>

NSString *extension = @"aspkey";
CFStringRef exUTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)(extension), NULL);
if (exUTI) {
    CFURLRef appURL = LSCopyDefaultApplicationURLForContentType(exUTI, kLSRolesAll, NULL);
    if (appURL) {
        // appPath contains the location of stream_launcher.
        NSString *appPath = [(__bridge NSURL*)appURL path];
        CFRelease(appURL);
    } else {
        // stream_launcher is not installed.
        NSLog(@"No default application found for .%@ files", extension);
    }
    CFRelease(exUTI);
} else {
    // stream_launcher is not installed.
    NSLog(@"Could not find UTI for extension .%@", extension);
}

macOS (Swift):

import Foundation
import CoreServices

let fileExtension = "aspkey"
if let exUTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileExtension as CFString, nil)?.takeRetainedValue() {
    if let appURLCF = LSCopyDefaultApplicationURLForContentType(exUTI, .all, nil)?.takeRetainedValue() {
        let appURL = appURLCF as URL
        let appPath = appURL.path
        // appPath contains the location of stream_launcher.
    } else {
        // stream_launcher is not installed.
    }
} else {
    // stream_launcher is not installed.
}

Appendix 2: Get a UUID

When stream_launcher launches, it reads a universally unique identifier (UUID) from a platform-specific location. Write the UUID to the following location before launching stream_launcher:

  • macOS: Write the UUID to a file named wuying_id at /Users/<username>/Library/Application Support/wuying/wuying_id

  • Windows: Write the UUID to the registry key HKEY_CURRENT_USER\Software\alibaba\wuying\UUID

Appendix 3: Delete the Windows desktop shortcut

After installing the Alibaba Cloud Workspace plug-in on Windows, a desktop shortcut and a Start menu entry are created. To remove them, delete the following files:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Alibaba Cloud Workspace.lnk
C:\Users\Public\Desktop\Alibaba Cloud Workspace.lnk