Command Line Switches

From Lianjapedia
Jump to: navigation, search

Overview

When creating a desktop shortcut for running the Lianja App Builder or for runtime Lianja Apps there are several command line options that can be specified.

The following table provides details of the currently available command line options. These can be combined to customize the running of an App e.g.

lianja --app orderprocessing --maximized
lianja myprogram.dbo
lianjaruntime --kiosk --fullscreen --runtimecaption "Our company Apps"
lianjarun --kiosk --fullscreen --runtimecaption "Our company Apps"

Lianja Command Line Options

Option Arguments Description
Filename A filename to run. If no file extension is specified. '.dbo' is assumed. See below for an example.
--activate License product key Activate runtime distribution license product key. Note: Runtime distribution licenses for desktop clients are no longer required from Lianja 9.0.
--app | -a App name Run the specified App.
--appinspector None Show the App Inspector whenever the Pages workspace is selected.
--args Arguments If used with a runtime script (see filename below), Arguments is a comma separated list of arguments to be passed to the script. Enclose Arguments in "..." and use single quotes for individual character arguments e.g.
--args "'hello','world',2600,{04/04/1953}"
If used with --app (see above), Arguments is an 'action'. For supported 'actions', see SHOWDOCUMENT().
The App args can be queried using Lianja.args (from v6.0).
--buttonfontsize Font size Adjust the button font size for the App if you are using very high resolution displays and the default button font size is too big or too small.
--codepage Locale Set the locale for the App. Same as --locale.
--codepagedata None For use of imported VFP data stored via a codepage
--command | -c "command1;command2;"... Execute the list of commands e.g. lianja -c "open database southwind;pack database;"
--config Filename.ext Specify the full path to a configuration file, e.g. --config Z:\appconfig.txt. The configuration file should contain command line switches, with each switch on a line and any arguments on the next line, e.g.
--tenancy
Z:
--activate
XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX

From v6.3.

--customer Name This will be used as the suffix to display a customized login file and a customized appcenter file. You can copy the existing login.rsp and appcenter.rsp in the cloudserver\appcenter directory and customize these with your own login captions and icons. The name is a suffix that will be appended onto the login.rsp and appcenter.rsp filenames e.g. --customer myco will look for login_myco.rsp and appcenter_myco.rsp respectively.
--debug None Run in debug mode.
--debugfile Debug file name Send debug logging to the specified file.
--deferredload None Forces all App pages to handle deferred loading.
--dir Directory Default directory.
--disableparentvtrequery None Handle legacy VT usage prior to Lianja 6.3. Start the App Builder with the --disableparentvtrequery switch and set the Disable VT requery when parentdatachanged App Setting to True.
Once set, the command line switch is no longer required. From v6.3.
--input | -i Filename.ext A filename to run. Filename can be a .dbo, .py, .php or .js file.
--fontsize Font size Adjust the base font size of the App if you are using very high resolution displays and the default font size is too big or too small.
--fullscreen None Run the App fullscreen.
--geometry x,y,width,height Specify the geometry of the window, e.g. C:\lianja\bin\lianja.exe --geometry 10,10,1598,868
--homepageapp App name After logging in, the specified App will be displayed rather than the App Center.
Similarly, clicking the "Home" icon displays the login screen then the specified App rather than the App Center.
--icon Window icon Specify an App specific window icon at runtime.
--kiosk None This will run the Lianja App Center (and login) in full screen kiosk mode with no window frame or title bar. This prevents users from minimizing the window and breaking out of your App in RDP sessions and information kiosks.
--locale Locale Set the locale for the App.
--loginapp App name This will load the App immediately after login without displaying the Lianja App Center. This provides you with the ability to replace the Lianja App Center with your own that you have written as a Lianja App or alternatively run an App directly after login bypassing the App Center.
--maximized None Maximize the window.
--minimalui None Starts the Lianja App Builder with 'minimal' ModeBar icons: 'Teams', 'Doc' and 'Forums' are excluded.
Also note that to simplify the ModeBar display, the icon captions can be toggled on and off from the View menu in the App Builder MenuBar. From v5.3.
--networkshare None Path inside the database catalog is ignored and the tables are always accessed inside the database directory. This simplifies the sharing of data across a LAN between Windows and Linux. The SET NETWORKSHARE command can also be set ON to provide the same behavior.
Note: To share databases between Windows and Linux, lowercase names should always be used for the tables as Linux filenames are case sensitive.
--nodeferredload None Disables deferred loading.
--noguests None Prevents readonly access to the Apps using the guest/guest login (disables guest login).
--nosplashscreen None Disable splashscreen at runtime.
--noutf8 None Use system locale.
--output | -o Filename.ext A filename to redirect output to from an input script.
--parentpid Parent PID Specify the parent PID.
--password Password Specify a password for automatic login.
--path Path Comma separated list of directories to be used as the file search path.
--pgdebug None Enable PhoneGap debugging information when SET DEBUG is ON.
--rdp None This will display the login screen with a plain background (no image) and no progress bar when loading an App.
--reset None Run Lianja App Builder without restoring previous App state.
--runtime None Runs the Lianja App Center.
--runtimecaption Caption text Replaces the "Lianja App Center" caption text in the App Center Home workspace with the specified caption text.
--runtimedatadir Runtime data directory Specify the shared LAN directory where databases reside. You can alternatively set the environment variable LIANJA_RUNTIMEDATADIR. Note that when a "runtimedatadir" is specified then --networkshare is also implied and turned on. Introduced in Lianja v1.3.1.
--runtimedir Runtime directory Windows: root drive or directory where lianja sub-directory contains runtime path for Apps, Library and Data, e.g. F: (where files are located in F:\lianja\cloudserver\tenants\public\...). Linux: root directory for Lianja, e.g. /opt/lianja/. This is the equivalent of setting the LIANJA_RUNTIMEDIR environment variable. Note that when a "runtimedir" is specified then --networkshare is also implied and turned on. See also: Deploying to LAN - Desktop and Web Clients.
--splashscreen Path to a custom splashscreen or "None" to disable Specify an App specific splashscreen at runtime. Note that if --app is specified no splashscreen is displayed unless specified.
--tenancy Mapped drive Mapped drive to tenancy, e.g. P: (where P: is a mapped drive to the tenancy share point S:\lianja\cloudserver\tenants\public). This is the equivalent of setting the LIANJA_TENANCY environment variable. See also: Deploying to LAN - Desktop and Web Clients.
--title Window title Specify an App specific window title at runtime.
--username Username Specify a username for automatic login.
--utf8 None Same as --locale utf-8. This is the default.
To use a non UTF-8 locale, specify --noutf8 or use a --codepage <locale> or --locale <locale>.

Filename

When running a custom program, if no file extension is specified, '.dbo' is assumed (.dbo files are pre-compiled .prg script files). If your program is not controlled by a Form object along with form.show(1), remember to add READ EVENTS at the end of the program file otherwise it will just exit and no UI will be displayed.

Shortcut



For example, here a desktop shortcut has been created for 'My App'. The myapp App includes the program start.prg which displays a Form and its controls using form.show(1).

The App has been deployed to the default deployment directory on Windows: C:\lianja\cloudserver\tenants\public\apps.

The shortcut specifies the filename to call: C:\lianja\cloudserver\tenants\public\apps\myapp\start


It also disables the splashscreen: --nosplashscreen


The full Target is:

C:\lianja\bin\lianjaruntime.exe 
C:\lianja\cloudserver\tenants\public\apps\myapp\start
--nosplashscreen

Note: If you are running some custom program code that is going to take a long time to complete e.g. consolidating inventory, then you can provide feedback to the user via a system tray icon on the desktop e.g.

tray = createObject("SystemTrayIcon")
tray.icon = "app:/myapp.png"
tray.showMessage("Message", "Consolidating inventory...")
// perform some long running operation to consolidate inventory
tray.showMessage("Message", "Consolidation completed...")

See Also

Background Tasks, Command Line Tools