Packaging Lianja Desktop Apps for Windows

From Lianjapedia
Jump to: navigation, search

Publish and Deploy your Apps

Test your Apps in the Lianja App Center

Make sure your Apps are running the way you want by testing them from the Lianja App Center on your development machine.

Test any command line switches you want to use.

  • Do you want your App to run from the Lianja App Center home page or do you want your App to start automatically?
  • Do you want to run a script / program instead of opening an App?
  • Do you want to specify username/password or any display options?

Lianja App Center for redistribution

Do you want to include the Lianja App Center (desktop runtime client) in your installer? If you do:

  • Download the distribution from the Lianja web site.
  • Put the distribution file in your \lianja\redist folder.

New Installer

The Lianja App Builder includes the NSIS Installer Builder and a template that can be easily customized.

New Installer



In the Deploy workspace, click the 'New installer' button and enter a name for your installer


Step 1

Edit Installer script file



Edit the installer template for your files. Look for the 'Step 1', 'Step 2' ... in the template text.

Edit the product name, version, company, and drive if required.


If you do not want to include the Lianja App Center desktop runtime client in your installer, remove the section that does this, as shown below.

;================================================================================================
; The Lianja App Center will be installed quietly if it is not already installed
;================================================================================================
Section -LIANJAAPPCENTER
  SetOutPath "$INSTDIR"
  File "${LIANJA_INSTALLDIR}\installers\${LIANJA_INSTALLERNAME}\readme.txt"
  File "${LIANJA_INSTALLDIR}\redist\${LIANJA_APPCENTER_DISTRIBUTION}"
  IfFileExists "$INSTDIR\bin\lianjaruntime.exe" DontInstallAppCenter 0
    ExecWait '"$INSTDIR\${LIANJA_APPCENTER_DISTRIBUTION}" --mode unattended --unattendedmodeui \
      minimal --prefix ${PRODUCT_INSTALLDRIVE}\lianja --sharedprefix ${PRODUCT_SHAREDINSTALLDRIVE}'
  DontInstallAppCenter:
SectionEnd

If you do want the Lianja App Center desktop runtime client included, remember to download the distribution file and put it in the \lianja\redist folder.

Step 2

Change the databases section so it has your databases. Keep the references to the system database if you have created or modified users and roles. Remove the references to the southwind sample database if it is not required.

Here I have specified my databases 'mydatabase1' and 'mydatabase2'.

;================================================================================================
; Step 2 - Specify the database(s) (if any) that you want to be installed 
;          on the user's desktop machine
;================================================================================================
Section -DATAFILES
  SetOverwrite ifnewer
  SetOutPath "${PRODUCT_SHAREDINSTALLDRIVE}\lianja\cloudserver\tenants\public\data\system"
  File /r /x *.bak "${LIANJA_INSTALLDIR}\data\system\*.*"
  SetOutPath "${PRODUCT_SHAREDINSTALLDRIVE}\lianja\cloudserver\tenants\public\data\mydatabase1"
  File /r /x *.bak "${LIANJA_INSTALLDIR}\data\mydatabase1\*.*"
  SetOutPath "${PRODUCT_SHAREDINSTALLDRIVE}\lianja\cloudserver\tenants\public\data\mydatabase2"
  File /r /x *.bak "${LIANJA_INSTALLDIR}\data\mydatabase2\*.*"
SectionEnd


The /r recursively includes files, the /x excludes files matching the specified skeleton.

Step 3

Change the Apps section so it just has your Apps.

Here I have specified my Apps 'tut_carousel', 'tut_docview' and 'tut_gallery'.

;================================================================================================
; Step 3 - Specify one or more Apps that you want to be installed 
;          on the user's desktop machine. Notice the use of /r to
;          recursively include files from the App directory.
;================================================================================================
Section -APPFILES
  SetOverwrite ifnewer
  SetOutPath "${PRODUCT_SHAREDINSTALLDRIVE}\lianja\cloudserver\tenants\public\apps\tut_carousel"
  File /r /x *.prg /x *.bak /x *.scp /x *.vcp /x *backups* "${LIANJA_INSTALLDIR}\apps\tut_carousel\*.*" 
  SetOutPath "${PRODUCT_SHAREDINSTALLDRIVE}\lianja\cloudserver\tenants\public\apps\tut_docview"
  File /r /x *.prg /x *.bak /x *.scp /x *.vcp /x *backups* "${LIANJA_INSTALLDIR}\apps\tut_docview\*.*" 
  SetOutPath "${PRODUCT_SHAREDINSTALLDRIVE}\lianja\cloudserver\tenants\public\apps\tut_gallery"
  File /r /x *.prg /x *.bak /x *.scp /x *.vcp /x *backups* "${LIANJA_INSTALLDIR}\apps\tut_gallery\*.*" 
SectionEnd

Step 4

Add in the names of any library files used by your Apps.

Here I have specified my library files 'myfunclib.dbo' and 'myjslib.js'.

;================================================================================================
; Step 4 - Specify the library files (if any) that you want to be installed 
;          on the user's desktop machine
;================================================================================================
Section -LIBRARYFILES
  SetOverwrite ifnewer
  SetOutPath "${PRODUCT_SHAREDINSTALLDRIVE}\lianja\cloudserver\tenants\public\library"
  File "${LIANJA_INSTALLDIR}\library\myfunclib.dbo
  File "${LIANJA_INSTALLDIR}\library\myjslib.js  
SectionEnd

Step 5

Add in the names of any page library files used by your Apps.

Here I have specified my library page file 'mydialogpanel.vpx'.

;================================================================================================
; Step 5 - Specify the page library files (if any) that you want to be installed 
;          on the user's desktop machine
;================================================================================================
Section -PAGELIBRARYFILES
  SetOverwrite ifnewer
  SetOutPath "${PRODUCT_SHAREDINSTALLDRIVE}\lianja\cloudserver\tenants\public\library\pages"
  File "${LIANJA_INSTALLDIR}\library\pages\mydialogpanel.vpx
SectionEnd

Step 6

Add in the names of any extension files used by your Apps.

Here I have specified my extension file 'myextension.dll' and also my 'user_extensions.ini' file.

;================================================================================================
; Step 6 - Specify the extension files (if any) that you want to be installed 
;          on the user's desktop machine
;================================================================================================
Section -EXTENSIONFILES
  SetOverwrite ifnewer
  SetOutPath "${PRODUCT_SHAREDINSTALLDRIVE}\lianja\cloudserver\tenants\public\extensions"
  File "${LIANJA_INSTALLDIR}\extensions\user_extensions.ini
  File "${LIANJA_INSTALLDIR}\extensions\myextension.dll
SectionEnd

Readme

Edit your readme.txt file



Edit the readme.txt file in the Readme tab.

License

Edit your license.txt file



Edit the license.txt file in the License tab.

Build Installer

Build Installer



Click the Build Installer button to build your installer.

The Build Log will display the progress of the build and tell you when it is complete.

A sub-folder is created under \lianja\installers with the name you specified for New Installer.

Your installer will be created as an executable (.exe) in this sub-folder and the name will include the 'PRODUCT_VERSION' from Step 1.

So here, my installer is C:\Lianja\installers\mydoc\mydoc-2.0-setup.exe.

Running Installer

Your installer can now be run on the target Windows machine.

Further Customization

See here for more information on the NSIS Installer Builder and further ways it can be customized.

For example, here I use CreateShortcut to create a desktop shortcut to run my tut_gallery App directly. I use the --app <appname> command line switch. I also delete the default Lianja App Center desktop shortcut.

;================================================================================================
; Step 7 - Create desktop shortcut with command line switches 
;          on the user's desktop machine. 
;================================================================================================
Section -SHORTCUTS
; Delete default Lianja App Center shortcut
  SetShellVarContext all
  Delete "$DESKTOP\Lianja App Center.lnk"
  SetOverwrite ifnewer
  SetOutPath "${PRODUCT_SHAREDINSTALLDRIVE}\lianja\bin"
  CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\bin\lianjaruntime.exe" "--app tut_gallery" \
  "$INSTDIR\bin\lianjaruntime.exe"
SectionEnd

See Also

Deploying to LAN - Desktop and Web Clients, Deploying to Local Directory, Standalone Executables on Windows