PowerClient: Deploy to a Raspberry pi with Apache.

PowerClient is the new deployment method for client server applications created using PowerBuilder 2019 R3. It offers a “smart” way to install applications to pc’s and keep them up to date. The main advantage of this deployment method is that to install an application to a pc, you simply have to launch a url. If it’s the first time the application is installed on this pc, a web page will show up allowing the installation of a generic launcher application, and later our application will be downloader, installed and executed.

One advantage of this deployment method is that you can make it work in almost any web server. I’ll demonstrate a powerclient application running from an apache server on a raspberry pi 4.

What we need:

  • A raspberry pi.
  • Apache server.
  • FTP server or samba enabled to our raspberry.

I’ll use a raspberry pi 4, with 2 GBytes of RAM. But I’m 100% sure this would easilly run event in a pi 3 board, as apache server runs very well on both of them.

How to deploy to the web server?

I’m doing this by installing the necessary files using samba. But it’s possible to deploy using an ftp server (like ProFTPd). As I don’t have any ftp server installed on my pi, I will use samba (It’s already installed). I’ll describe what I’ll copy to the appropriate folder on my raspberry pi to make it work. The application that I’ll deploy is the googlecharts demo app that is part of PowerBuilder 2019 R3 installation and was developed by Appeon’s stuff.

First of all, I have to create the PowerClient Project.

Create a PowerClient Project.

I will give the basic information the project.

I will declare the files that required from the executable. As those files change rarely, I will deploy them as a package.

Also, the I’ll select the part of the runtime that should be deployed.

I will setup the deployment options I want to use:

Finally, I will configure Run Options:

Now, I will save the project. As I am not deploying directly to the server, what I need is to have two packages: on for the Cloud App Launcher and on for my application (in these case appeon’s GoogleCharts example application). To create the package for the Cloud App Launcher, I will have to press the button “Upload Cloud App Launcher” in the deployment tab of my project. A response window will show up:

I will select: “Zip the files and manually upload later”. Also, I will setup a path where the package should be stored. After the package is created, I will close this window, and also close the project. To prepare the package for the application, I will right click on the project in the system tree, and I will select: “Package PowerClient Project”.

This will show a new response window where I will have to choose a location to store the package, and the package type (in this case a zip file).

After those steps, I will end up with two packages that I should place in my Raspberry Pi. This is easy, as I have samba running, and I have given the appropriate privileges to my web server’s folders. I will copy both files to the folder /var/www/html. Then I will extract them to this folder. I will end up with two additional folders:

Last step is to copy some files from PowerBuilder 2019 R3 installation folder to the folder /var/www/html/GoogleCharts. In my computer they are located to “C:\Program Files (x86)\Appeon\PowerBuilder 19.0\HTML”.

And:

The folder contains some additional files, but those are required depending on the deployment options.

Now we are ready to launch our application. (I consider that Apache is already correctly setup and that necessary privileges to web server folders are already set). My raspberry’s name is: Raspi4-2, so I have to launch the url: “http://raspi4-2/GoogleCharts/”. And yes, it works!

In this case I use a Raspberry pi, but this could work with any linux machine running a Linux Os. Of course, a raspberry is a low cost computer, and I have to say that in my tests, even with larger applications, it was pretty fast and responsive.

Andreas.

3 thoughts on “PowerClient: Deploy to a Raspberry pi with Apache.

      • To be sincere I never tested if this works with pbautobuild. But in my opinion it will work. That’s because, in that case, pbautobuild will use a json file generated by a powerclient project, and should do what this json file describes. So if your powerclient deploys a zip file with the application, this should work.

        Like

Leave a comment