Lianja Package Manager

From Lianjapedia
Revision as of 22:08, 15 June 2018 by Barrymavin (Talk | contribs)

Jump to: navigation, search

Under Construction

See Also

Deployment

Overview

Lianja Package Files (.lpk) are used to package up Apps, databases and Library files to transfer to another Lianja App Builder installation.

From Lianja v4.2, they can also be installed/updated automatically by the Lianja Cloud Server.

How to create a package file

You create packages in the Deploy worksurface.

File:Buildpackage.png
Build Lianja Package



Select the data, Apps and Library files as you would to deploy them.

Note: if your files have been added to a Lianja Project, just tick the checkbox next to the Project name, and all its files will be selected.

Click the Build Package button in the headerbar and enter the name for your package. There is no need to include the .lpk file extension.


Your package will be created in the packages directory.

OS Location
Windows C:\lianja\packages
Linux /opt/lianja/packages
Mac /Users/<username>/Library/Application Support/Lianja/packages

How to install a package file

Lianja packages can be installed from the toolbar in the Lianja App Builder Apps workspace. From Lianja v4.2, they can also be installed using the LPK() function or automatically by the Lianja Cloud Server.

Apps Workspace

File:Installpackage.png
Install Lianja Package



Click the Install Package button in the headerbar.


Select the package to install.


The installation progress will be displayed in the Console workspace and you will be prompted to confirm if a file will be overwritten.

LPK() Function

The LPK() function can be used to install or list the contents of .lpk Lianja Package Files. See LPK() for full details.

Lianja Cloud Server

The Lianja Cloud Server can automatically install any new packages it detects in its packages directory.

OS Location
Windows C:\lianja\cloudserver\tenants\public\wwwroot\packages
Linux /opt/lianja/cloudserver/tenants/public/wwwroot/packages

The Lianja Cloud Server will disable user access while an upgrade is to be performed and then re-enable user access after the upgrade is complete. This is handled using LOCKRESOURCE().

If the package contains scripts called setup.prg (compiled to setup.dbo) and/or upgrade.prg (compiled to upgrade.dbo), then these are run after all the files are extracted and moved into place. This provides the ability to install on live systems and then set file permissions etc. and/or check for database schema changes.

The steps for live updating are:

  1. Write optional setup.prg and upgrade.prg scripts.
  2. Compile them using the button in the Script Editor or the COMPILE command.
  3. Package up your App including these scripts, any required library files (use of lib:/thirdpartylibs is recommended) and any required database if it is a new App.
  4. Transfer the .lpk file to the packages directory of the remote Lianja Cloud Server.
  5. Make sure DB_WWWAUTOUPDATE is enabled on the remote server.
  6. Access your app in the browser by logging in: the package will be installed automatically and your system updated.