Difference between revisions of "Packaging Lianja Desktop Apps for Windows"

From Lianjapedia
Jump to: navigation, search
(See Also)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
''Under Construction''
 
 
 
==Publish and Deploy your Apps==
 
==Publish and Deploy your Apps==
  
 
* Publish your Apps by checking the [http://www.lianja.com/images/stories/tutorials/tiles/app_settings.png Published attribute in Settings]
 
* Publish your Apps by checking the [http://www.lianja.com/images/stories/tutorials/tiles/app_settings.png Published attribute in Settings]
* [[Deploying to Local Directory|Deploy your Apps and databases]].  If your Apps use any library, [http://www.lianja.com/resources/blog/39-coding-tips/347-working-with-ui-page-libraries page library] or [[Lianja/SDK C API|extension files]], deploy these too.  Note that if you add your files into a [[Lianja Projects|Project]], you can deploy them all just by deploying the Project.  
+
* [[Deploying to Local Directory|Deploy your Apps and databases]].  If your Apps use any library, [http://www.lianja.com/resources/blog/39-coding-tips/347-working-with-ui-page-libraries page library] or [[Lianja/SDK C API|extension files]], deploy these too.  
 
* If you have [[:Category:Users and Roles|created or modified users and roles]], deploy the system database too.
 
* If you have [[:Category:Users and Roles|created or modified users and roles]], deploy the system database too.
  
Line 22: Line 20:
 
==New Installer==
 
==New Installer==
 
The Lianja App Builder includes the NSIS Installer Builder and a template that can be easily customized.
 
The Lianja App Builder includes the NSIS Installer Builder and a template that can be easily customized.
 +
 +
[[{{ns:file}}:installer_new1.png|450px|thumb|left|link={{filepath:installer_new1.png}}|New Installer]]
 +
 +
 +
  
 
In the Deploy workspace, click the 'New installer' button and enter a name for your installer
 
In the Deploy workspace, click the 'New installer' button and enter a name for your installer
  
Edit the installer template for your files. Look for the 'Step 1', 'Step 2'  ... in the template text.
+
<br clear=all>
  
 
===Step 1===
 
===Step 1===
 +
[[{{ns:file}}:installer_step1.png|450px|thumb|left|link={{filepath:installer_step1.png}}|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.
 
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 text from '''Section -LIANJAAPPCENTER''' to '''SectionEnd'''.  If you do want it included, remember to download the distribution file and put it in the \lianja\redist folder.  
+
<br clear=all>
 +
 
 +
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. 
 +
<pre>;================================================================================================
 +
; 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</pre>
 +
 
 +
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===
 
===Step 2===
 
Change the databases section so it has your databases.  Keep the references to the '''system''' database if you have [[:Category:Users and Roles|created or modified users and roles]].  Remove the references to the '''southwind''' sample database if it is not required.
 
Change the databases section so it has your databases.  Keep the references to the '''system''' database if you have [[:Category:Users and Roles|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'.
 +
 +
<pre>;================================================================================================
 +
; 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</pre>
 +
 +
 +
The /r recursively includes files, the /x excludes files matching the specified skeleton.
  
 
===Step 3===
 
===Step 3===
 
Change the Apps section so it just has your Apps.
 
Change the Apps section so it just has your Apps.
 +
 +
Here I have specified my Apps 'tut_carousel', 'tut_docview' and 'tut_gallery'.
 +
 +
<pre>;================================================================================================
 +
; 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</pre>
  
 
===Step 4===
 
===Step 4===
 
Add in the names of any library files used by your Apps.
 
Add in the names of any library files used by your Apps.
 +
 +
Here I have specified my library files 'myfunclib.dbo' and 'myjslib.js'.
 +
 +
<pre>;================================================================================================
 +
; 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</pre>
  
 
===Step 5===
 
===Step 5===
 
Add in the names of any [http://www.lianja.com/resources/blog/39-coding-tips/347-working-with-ui-page-libraries page library files] used by your Apps.
 
Add in the names of any [http://www.lianja.com/resources/blog/39-coding-tips/347-working-with-ui-page-libraries page library files] used by your Apps.
 +
 +
Here I have specified my library page file 'mydialogpanel.vpx'.
 +
 +
<pre>;================================================================================================
 +
; 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</pre>
  
 
===Step 6===
 
===Step 6===
 
Add in the names of any [[Lianja/SDK C API|extension files]] used by your Apps.
 
Add in the names of any [[Lianja/SDK C API|extension files]] used by your Apps.
 +
 +
Here I have specified my extension file 'myextension.dll' and also my 'user_extensions.ini' file.
 +
 +
<pre>;================================================================================================
 +
; 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</pre>
  
 
===Readme===
 
===Readme===
 +
[[{{ns:file}}:installer_readme.png|450px|thumb|left|link={{filepath:installer_readme.png}}|Edit your readme.txt file]]
 +
 +
 +
 +
 
Edit the readme.txt file in the Readme tab.
 
Edit the readme.txt file in the Readme tab.
 +
<br clear=all>
  
 
===License===
 
===License===
 +
[[{{ns:file}}:installer_license.png|450px|thumb|left|link={{filepath:installer_license.png}}|Edit your license.txt file]]
 +
 +
 +
 +
 
Edit the license.txt file in the License tab.
 
Edit the license.txt file in the License tab.
 +
<br clear=all>
  
 
==Build Installer==
 
==Build Installer==
 +
[[{{ns:file}}:installer_build.png|450px|thumb|left|link={{filepath:installer_build.png}}|Build Installer]]
 +
 +
 +
 +
 
Click the '''Build Installer''' button to build your installer.
 
Click the '''Build Installer''' button to build your installer.
  
Line 59: Line 176:
  
 
A sub-folder is created under \lianja\installers with the name you specified for '''New Installer'''.
 
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|Step 1]].
 
Your installer will be created as an executable (.exe) in this sub-folder and the name will include the 'PRODUCT_VERSION' from [[#Step 1|Step 1]].
  
 +
So here, my installer is C:\Lianja\installers\mydoc\mydoc-2.0-setup.exe.
 +
<br clear=all>
 
==Running Installer==
 
==Running Installer==
 
Your installer can now be run on the target Windows machine.
 
Your installer can now be run on the target Windows machine.
  
 +
==Further Customization==
 
See [http://nsis.sourceforge.net/Main_Page here for more information on the NSIS Installer Builder] and further ways it can be customized.
 
See [http://nsis.sourceforge.net/Main_Page 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 Switches|command line switch]].  I also delete the default Lianja App Center desktop shortcut.
 +
 +
<pre>;================================================================================================
 +
; 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</pre>
  
 
==See Also==
 
==See Also==
[[Deploying to LAN - Desktop and Web Clients]], [[Deploying to Local Directory]]
+
[[Deploying to LAN - Desktop and Web Clients]], [[Deploying to Local Directory]], [[Standalone Executables on Windows]]
  
 
[[Category:Deployment]]
 
[[Category:Deployment]]
[[Category:Developers Guide]]
 

Latest revision as of 09:45, 4 February 2022

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