PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Running PxPlus with Multiple Licenses  (Read 1904 times)

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Running PxPlus with Multiple Licenses
« on: December 13, 2019, 12:02:26 PM »
If you need one machine to run PxPlus with multiple licenses, it’s actually quite easy to setup. 

Here's a typical scenario:

A company has purchased licenses for its two branch operation; a ten user license for the system in Montreal and a twenty user license for the system in Toronto.  Management now decides that instead of having two servers they want to consolidate the branch operation onto a single server in the cloud.

Technically you can simply install two copies of PxPlus in separate locations and run them on different ports and this is the preferred and most straightforward approach

This does however mean that when upgrading the software you would have to upgrade both instances.  If you wish to share a single install between multiple license, the following technique can be used to accomplish this.

This technique involves having multiple license files on the system and pointing different instances of PxPlus to the different license files by setting the PVXKEY environment variable prior to running PxPlus or any of its utility programs, such as product registration.

Unix/Linux Setup

Here is a small Linux shell script that can be used to make it simple to accomplish this:

  • #!/bin/bash
    lic=$PWD/lic_$1
    [ ! -d "lic_$1" ] && mkdir "$lic"
    export PVXKEY=$lic
    shift
    $@
Take the above script and place it in your PxPlus install directory in a file called 'usekey', then set execute permission on this file using the following command:

  • chmod a+x ./usekey
What this script does is allow you to specify the license to use when launching pxplus or the registration program pxpreg.  It creates a sub-directory "lic_XXXX" to hold the license if it doesn't already exist, then sets the PVXKEY environment variable to point to that directory.

So taking our example, to enter the activation key for Montreal we could enter the following:

  • ./usekey MTL ./pxpreg
This would create a sub-directory called lic_MTL and run ./pxpreg against it allowing you to enter the license keys.

For Toronto you could enter:

  • ./usekey TOR ./pxpreg
To run the online registration the commands would be:

  • ./usekey MTL ./pxplus "*plus/reg/net"
  • ./usekey TOR ./pxplus "*plus/reg/net"
Once you have the keys setup you can use the same script to run the Simple CS interface for each of the branches:

For Montreal to allow user to connect to port 4093:

  • ./usekey MTL ./pxplus "*plus/cs/host" -arg 4093
For Toronto to allow user to connect to port 10000:

  • ./usekey TOR ./pxplus "*plus/cs/host" -arg 10000
This approach can be extended to allow any number of different types of licenses to be run from the same install.

Windows Setup

You can setup a similar script on Windows as a .BAT file.  It would look something like this:

  • @ECHO OFF
    SETLOCAL
    SET lic=%CD%\lic_%1
    IF NOT EXIST "%lic%" MKDIR "%lic%"
    SET PVXKEY=%lic%
    %2 %3 %4 %5 %6 %7
Take the above script and place it in your PxPlus install directory in a file called ‘usekey.bat’.

Now you can use this BAT file to register and launch PxPlus using different licenses on Windows.

To enter the installation key for Montreal (MTL) we could go to the Windows command line, change your directory to where you have your PxPlus installed and enter the following:

  • usekey.bat MTL .\pxpwactv

This will run the activation key entry program for PxPlus with the resultant activation key going to the directory lic_MTL in the install directory.

To enter the key for Toronto (TOR) the command would be:

  • usekey.bat TOR .\pxpwactv.exe
To run the online registration the commands would be:

  • usekey.bat MTL .\pxplus "*plus/reg/net"
  • usekey.bat TOR .\pxplus "*plus/reg/net"

In order to run PxPlus using the MTL key you could enter the command:

  • usekey.bat MTL .\pxplus.exe "*plus/cs/host" -arg 4093
For Windows you may want to create a desktop shortcut link for this.  Your shortcut would have the command with the starting directory being where PxPlus is installed.

Note: Should you not want the license files in the directory where PxPlus was installed or if you want to run your application in a different directory, you can provide a full pathname to the pxplus.exe and change the usrkey.bat file so that 'lic' points to where you want to save the license file(s).
« Last Edit: April 29, 2021, 02:05:21 PM by Mike King »
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com