Lianja Package Manager

From Lianjapedia
Jump to: navigation, search

See Also

COMPARE DATABASE, 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.

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

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 or update 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. Note that from Lianja v5.0, the COMPARE DATABASE command can be used to compare two databases and automatically generate the upgrade.prg script to perform any required database schema upgrades.

The installation and update of packages creates (if it does not exist) a file packagename-install.log in the packages directory. This is a text file that contains a full history of initial installation and all updates applied. To perform an update of an existing package all you need to do is build the .lpk and upload to the packages directory.

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.