Troubleshoots

This section provides suggestions and solutions that you can use to find the cause of the problem and the solution.

The following possibilities are currently available:

DWService

Example configuration

install.json file:

{
name: MySoft,
mainurl: https://www.apiremoteaccess.com/,
listenport: 7956,
title: My Title,
logo: logo.ico,
topinfo: My Company\nMy Address,
mode: run,
runputcode: true,
runtoptext: info line 1\ninfo line 2
}

or if you want to show your logo on top panel

{
name: MySoft,
mainurl: https://www.apiremoteaccess.com/,
listenport: 7956,
title: My Title,
logo: logo.ico,
topimage: image.bmp”,
mode: install,
installputcode: true
}

Windows

To customize Windows installer you need:

  • Download the Windows installer: dwagent_x86.exe
  • Download and Install 7Zip.
  • Prepare file install.json and images.
  • Open dwagent_x86.exe with 7Zip Manager.
  • Drag and drop install.json and images inside to 7Zip Manager window (root folder).
  • Close 7Zip Manager window
  • Rename dwagent_x86.exe as you prefer
  • You are now ready to distribute your installer.

It is strongly recommended buy a code sign in order to sign your installer.

When injecting a file inside on dwagent.exe some antivirus like Avast and AVG will probably pick it up. So we suggest to submit your installer to be whitelisted by antivirus companies. Here are some links:

https://www.avg.com/en-ww/whitelist-program-application
https://www.avast.com/whitelist-program-application
https://www.f-secure.com/en/web/labs_global/submit-a-sample
https://www.microsoft.com/en-us/wdsi/filesubmission

After your file has been submitted, wait a few days before publishing the installer on your site.

Customize the installer

You can change the dwagent installer in order to modify some text elements, hide some options, show your company logo and change service and process name. To do that you have to inject the file install.json and images inside of installation package. These are the configurations you can set:

name:Change name of program:

- installation path
- start menu name
- service name
- process name

(don’t use space or special chars)
mainurl:Set this to https://www.apiremoteaccess.com/ (do not forget / at ends). In this way agent send all requests to apiremoteaccess.com instead of dwservice.net
listenport:Is for future use (default dwagent port is 7951 you can use a different value e.g. listenport: 7952)
title:Change window title of installer (you have to inject logo inside of installation package)
logoxos:Change logo for your OS:
Linux: png format 64x64 pixels.
Mac OS: icns format.
Windows: ico format 16x16,32x32,48x48,64x64 pixels.
logo16x16:Logo in bmp format 16x16 pixels.
logo32x32:Logo in bmp format 32x32 pixels.
logo48x48:Logo in bmp format 48x48 pixels.
lang:Force the installation language. (e.g. en, it, pt, de, ...)
topinfo:Show the text on top of installer window. (use \n to start a new line).
topimage:Show the image on top of installer window. Image bmp format 760x70 pixels. (you have to inject image inside of installation package).
leftcolor:Change the color of left panel. (value is hexstring like 83e5ff)
welcometext:Show the text on welcome page. (use \n to start a new line)
mode:run/install (show only run or only install option)
installputcode:true/false valid if mode=install. Show only "put code" option in installation (please always set true)
runputcode:true/false valid if mode=run. Enable user to put connection code when run the installer
runtoptext:Change text on top of run panel. (use \n to start a new line).
runbottomtext:Change text on bottom of run panel. (use \n to start a new line).

The file install.json must be in JSON representations. All the images must be bitmap file (.bmp) except logoxos.

Show App in IFrame session

If you have created a session with more than one app, and you don’t want to show the default DWService App bar (hideAppsBar=true), you can show, after an opened session, the App in the frame by calling dwsApiShowApp:

dwsApiShowApp(ifname, name)

  • iframe: ID of Iframe on your page
  • name: Name of App to show. (desktop, filesystem, terminal, etc…)

Close IFrame session

This function closes the session previously opened by dwsApiOpenIFrameSession:

dwsApiCloseIFrameSession(ifname)

  • iframe: ID of Iframe on your page

Open IFrame session

The API creates a session which returns a url that you can open inside an IFrame of your web page through this function:

dwsApiOpenIFrameSession(ifname, url, callback)

  • iframe: ID of Iframe on your page
  • url: url session to open
  • callback: event callback

The event callback must be only one parameters e.g.:

function(e){
...
}

It’s called when the user is connected to the agent or when user is disconnected from the agent.
e.type = identifies event type (CONNECTED or DISCONNECTED)
e.availableApps = lists of available apps ([desktop, filesystem, …]). It’s present only if type=CONNECTED

Develop the web application

In order to show correctly DWService content inside an IFrame, you have to include the following javascript library on your page:

<script src="https://www.apiremoteaccess.com/res/js/dwsapi.js" type="text/javascript">
</script>

This javascript code enables interaction between your application and DWService content. It works through the Cross-Domain Messaging (window.postMessage), so it’s important to set the property “postMessageOrigin” when you create a new session.

Close session

REQUEST
DELETE /id=<session id> or /idChannel=<channel id>

RESPONSE
200 OK
{
status: 200
}