# Installing DWAgent

## Installing on UNIX

To install on Unix, simply expand the compressed .tar installable image in a directory of your choice. We will refer to this directory as **DWAHOME** in the remainder of this manual.

## Installing on WINDOWS

To install on Windows simply expand the compressed .tar installable image in a directory of your choice. We will refer to this directory as **DWAHOME** in the remainder of this manual.

{% hint style="info" %}
**NOTE**: During the product configuration phase, you need to edit configuration files such as the dwagent.properties. Depending on the tool used to expand the compressed .tar installable image, these files might have Unix-style end-of-line terminator, which makes editing difficult using Windows Notepad. In this case, use Windows Wordpad (or any other smart editor). The product runtime will handle any type of end-of-line terminator without problems.<br>

In the rest of this section, we will talk about the DWAgent Windows service commands (i.e. *\<DWAHOME>\ bin\runtimeW64\dwagentservice.bat and \<DWAHOME>\bin\runtimeW64\dwagentservicemgr.bat*).
{% endhint %}

### Installing as Windows service

When running DWAgent on an unattended Windows server, it might be convenient to configure DWAgent to run as a service.\
This can be done running the following command as administrator (JAVA\_HOME environment variable must be set for the user):

`dwagentservice.bat install`

This command may fail in some environments, reporting that it is impossible to locate jvm.dll. If this is the case, a jvm location hint can be given on the command line as an argument via the\
–jvmdll switch:

`dwagentservice.bat install –jvmdll “C:\my jre\binext\jvm.dll”`

To verify the installation of the DWAgent service you can run:

`dwagentservice.bat ivp`

Once DWAgent is installed as a service, you can optionally customize the service name (by default it is **DWAgent**) and other attributes by using the provided service manager GUI:

`dwagentservicemgr.bat config`

You can also monitor DWAgent service status at runtime by running the service manager widget (a system tray application), using this script:

`dwagentservicemgr.bat monitor`

Finally, the DWAgent service can be cleanly removed from Windows Services by running:

`dwagentservice.bat remove`

### Coexistence of multiple DWAgent instances as Windows Services

Most of the times, a single DWAgent instance is required on each node. But it may happen that more than one instance is needed, e.g. when two different Administrators need to operate independently on DWAgent or when different operating system credentials must be associated to different DWA Emitters.\
To install two DWAgent instances you simply need to install a second copy of DWAgent on a different **DWAHOME**.

When installing DWAgent as a Windows service, you also need to ensure that the two instances use different service names. You can do this by specifying the optional `–service` switch on `dwagentservicemgr.bat` and `dwagentservice.bat` to install or administer a specific service instance.\
For example, this command will install a DWAgent Windows Service named `myOtherDWAgent`:

`dwagentservice.bat –service myOtherDWAgent install`

For more information on the available command line options please refer to the System Administration section of this documentation.

## Post-installation tasks

After the installation, copy the provided **DWAHOME**/config/dwagent.properties.template to **DWAHOME**/config/dwagent.properties. This latter file is read at runtime by DWAgent and will be used to configure it.

## Installed directory tree

Once the product is installed, the following directories will be created in **DWAHOME**:

* bin/runtime: this directory contains a shell script and the batch file.
* bin/runtime/runtimeW64: this directory contains Windows specific scripts and executables (e.g. Windows service support).
* config: this directory contains the product configuration files.
* dat: this directory contains the data and caches managed at runtime by DWAgent. This data is managed by DWAgent at runtime and must not be altered or removed.
* lib: this directory contains the product jar files.
* lib-ext: this directory contains third-party products runtime jars that come bundled within DWAgent.
* lib-emitter-ext: this directory contains additional emitters jars, it is empty out-of-the-box.
* licenses: this directory contains third-party products licenses.
* logs: this directory contains all the diagnostic files produced by DWAgent at runtime.
* version: this directory contains the file with the DWAgent version installed.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.primeur.com/dwagent-2.1.0/getting-started/installing-dwagent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
