> For the complete documentation index, see [llms.txt](https://community-test.logicnets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://community-test.logicnets.com/release-9/platform-documentation/system-administration/installation/command-line-scripts.md).

# Command-Line Scripts

Use the command-line scripts detailed in this topic when installing/setting up LogicNets.

## Create a New Company

System administrators can create a new company in an existing LogicNets installation using the following steps.

1. Open a system command prompt.
2. Type **cd /system/scripts**.
3. Type **addcompany** .
   * The company name should only contain alphanumeric characters.
   * On some operating systems the folder names are case-sensitive and will reflect in the browser URL.
4. Go to the components folder in the unzipped LogicNets installation package and run **install\_components**.
   * This step installs and registers all licensed LogicNets components in the installed local companies.
5. Open an internet browser.
6. Enter the following URL: **http\:///\<company/logicnets.lns?verb=start\&code=logon**.
7. Verify that the logon page displays.

## Create an Admin User

By default, a new company does have any users configured, and a system administrator must use the command line to create the first user. Authorized admin users can create subsequent users with the browser-based Access Management tool in the LogicNets system.

A system administrator creates the first admin user in an existing LogicNets installation using the following steps.

1. Open a system command prompt.
2. Type **cd /system/scripts**.
3. Type **adduser**.
4. Fill in all user details.
5. Go to the *components* folder in the unzipped LogicNets installation package and run **assign\_default\_components**.
   * By default, no default applications and tools are assigned to the admin user.
   * This step assigns all default components to all admins in all local companies.
6. Open an internet browser.
7. Enter the following URL: **http\:///\<company/logicnets.lns?verb=start\&code=logon**.
8. Verify that the logon page displays.
9. Log in with the credentials assigned to the first user.
10. Verify that the admin user can access all default system components.

## Install a Published Package

System Administrators can install a published package in a different LogicNets installation using the following steps.

1. Publish a project and download the zip file to the server (e.g. **c:\mypackage.zip**).
2. Open the command prompt and go to **c:\LogicNets\system\scripts**.
3. Start the install package script *( )*.
   * install\_package mycompany C:\mypackage.zip myapp.
4. Start the package.
   * Open an internet browser.
   * Go to the URL <http://mydomain.com/mycompany/logicnets.lns?verb=start&code=myapp>

**Notes**

* If you re-install a package with the same name, it overwrites the previous package.
* By default, the system sets to *inactive* the status of those already installed packages that have the same category as the one you are installing. The category is the project name in the Designer. You can disable this functionality by providing an additional command line parameter ‑**keepexistingactive**.
* If a meta-xml file is located next to the package zip file (**C:\mypackage.zip**) with the same name as the package zip file added with “.xml” (**C:\mypackage.zip.xml**), the system also installs the meta-xml file.
* If the installation fails the system sets a non-zero exit code.

## Uninstall a Published Package

System Administrators can uninstall a previously installed package using the following steps.

1. Open the command prompt and go to **c:\LogicNets\system\scripts**.
2. Start the uninstall package script ( ).
   * **uninstall\_package mycompany mypackage**.

## Logging

In some cases, a LogicNets service engineer can request a log file to help debug a reported problem. However, by default, logging is disabled on a production system. Retrieving log files differs on Windows and Linux-systems, and the steps below will help you enable and view logging.

### Enabling Logging

To enable debug logging use the following steps.

1. Open the LogicNets configuration file in a text editor.
   * **c:/logicnets/system/lib/sys/settings.cfg**
2. Search for the setting called **LNLOG\_PROFILE\_DEFAULT**.
3. Change the value to **DEBUG**.
4. Save the configuration file.

The updated configuration will be active for all LogicNets sessions started after the update. The change will not affect existing sessions.

### View Logging on a Windows Machine

The logging on a Windows machine is not saved in log files, but you can access files using an external tool by using the following steps.

1. Download and install **DebugView** from **SysInternals** - <https://technet.microsoft.com/en-us/sysinternals/debugview.aspx>.
2. Start the *DebugView* application in administrator mode.
3. To ensure that **Global Win32** events are logged, click the following
   * **Capture**-Menu.
   * **Capture Global Win32**
4. Use the LogicNets application.
5. Save the log to a file.
6. Send the *log.file* to LogicNets.

### View Logging on a Linux Machine

The logging on a Linux machine is saved in log files, and this logging is saved in three different files:

```
/etc/httpd/logs/error_log
/tmp/lua.log
/tmp/logicnets.log
```

To help with troubleshooting, please send all three files to LogicNets.

Note: RHEL Apache can make use of the "private-tmp" feature. Depending on your RHEL setup the log files may be located somewhere else. Typical locations include the following:

* /tmp/systemd-private-XXXXXXXXXXX-httpd.service-XXXXX/tmp
* /var/tmp/systemd-private-XXXXXXXXXXX-httpd.service-XXXXX/tmp

## Settings

To make changes to the LogicNets configuration you must create or adapt a company settings file. To do this, create a new file called *settings.cfg* in the following folder: *c:/logicnets/dat/bnt/*.

### Add References

To configure the reference source, follow these steps:

* Edit the configuration file, adding the following basic structure:

```
_session = {
reference_sources = {
}
```

* For each source, add the following structure inside the section called reference\_sources = { }

```
{
name = "NAME",
caption = "CAPTION",
browser_uri = "BROWSER_URI",
show_uri = "SHOW_URI",
icon = "ICON_LINK"
},
```

The following is a full example of a company *settings.cfg* file.

```
_session = {
reference_sources = {
{
name = "external_topic",
caption = "External Topic",
browser_uri = "http://topics/InsertTopicLink.aspx?ContentId=$(project_id)&external_id=$(external_session_id)&requestUrl=$(redirect_url)",
show_uri = "http://topics/opentopic.aspx?topicId=$(topicId)&bookmarkId=$(bookmarkId)&view=web",
icon = "/lncore/icons/fileupload.png"
},
{
name = "external_graphic",
caption = "External Graphic",
browser_uri = "http://topics/InsertGraphicLink.aspx?ContentId=$(project_id)&external_id=$(external_session_id)&requestUrl=$(redirect_url)",
show_uri = "http://topics/graphicpreview.aspx?graphicId=$(graphicIdId)",
icon = "/lncore/icons/fileupload.png"
}
}
}
```

## SMTP

You can configure LogicNets applications to send emails. To use this feature, you must configure the SMTP server using the following setup.

```
_global = {
SMTP_SERVER = "localhost",
SMTP_FROM_ADDRESS = "noreply@logicnets.com",
SMTP_PORT = 25,
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://community-test.logicnets.com/release-9/platform-documentation/system-administration/installation/command-line-scripts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
