1. Brian Greiman
  2. PowerBuilder
  3. Thursday, 26 August 2021 21:15 PM UTC

We are testing deployment of our application with Powerclient.  One issue we have yet is being able to run the application via a windows shortcut (or windows scheduled task) using parameters. 

In the past, this would have been our start line:

c:\program files\application\app.exe parm1 parm2 parm3 (these parameters will be variable depending on the situation).  

Using Powerclient, the new application would be:

C:\Users\user_name\AppData\Roaming\PBApps\Applications\localhost_app\app.exe and it does not appear we can specify any parameters.

I know you can specify parameters if you use Chrome to launch your application but that is not always feasible in our situation.

Does anyone have any suggestions of how to elegantly use parameters with PowerClient?

Thanks,

Brian

Alex Riofrio Accepted Answer Pending Moderation
  1. Thursday, 28 October 2021 17:03 PM UTC
  2. PowerBuilder
  3. # 1

Hi,

Allow me a contribution on a similar situation I've been seeing the last days. I found a way to call a secondary PowerClient application from another PowerClient application.
It works perfectly on my PC, even sending an argument (eg Company).

I don't use static arguments defined in "Run options" - "Commandline arguments".

From the open event of the application object I read the "commandline" argument.

 

What do you think of this way to call the application when it is already installed?, Would it be good practice to do it that way?

 

 

Attachments (1)
Comment
  1. Kai Zhao @Appeon
  2. Friday, 29 October 2021 04:58 AM UTC
Hi Alex,



You are working in the correct way. For an installed application, you can start it via running the EXE directly, same as running it using the icon on the desktop, it will check the application update on the web server according to the update strategy.



Regards,

ZhaoKai
  1. Helpful 1
  1. Alex Riofrio
  2. Friday, 29 October 2021 15:31 PM UTC
Thanks Kai.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 1 September 2021 18:03 PM UTC
  2. PowerBuilder
  3. # 2

Hi Brian;

  I just tested changing the dynamic variables and values therein and no issues ...

The App always starts with the latest assigned variables and values. Not sure why yours is not.  :-)

Regards ... Chris

Comment
There are no comments made yet.
Brian Greiman Accepted Answer Pending Moderation
  1. Wednesday, 1 September 2021 17:39 PM UTC
  2. PowerBuilder
  3. # 3

We were running build PB2019R3 2670.  

I updated this morning to R3 2728 and it appears to be working properly now.

The only side-effect is that if we change parameters, it seems to remember the old parameters.  

Ex.

Run C:\Users\user_name\AppData\Roaming\PBApps\Applications\localhost_app\app.exe "parm1 parm2 parm3" - system will launch with parm 1 parm2 parm3

We then update parameters on command line:
C:\Users\user_name\AppData\Roaming\PBApps\Applications\localhost_app\app.exe parm1

Application is still recognizing parm1 parm2 parm3.  Not sure if this is a bug or I am just not understanding of how this should work.  

Thanks again for your suggestion, we are getting closer.

Thanks,

Brian

Comment
  1. Kai Zhao @Appeon
  2. Thursday, 2 September 2021 00:08 AM UTC
I did not reproduce the issue, please make sure you had upload the launcher and deploy application again. If there is still the issue, please open a support ticket in the support portal and please provide a test case & the detailed steps to reproduce the issue, Many thanks in advance.

https://www.appeon.com/standardsupport/

  1. Helpful
There are no comments made yet.
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 1 September 2021 05:54 AM UTC
  2. PowerBuilder
  3. # 4

Hi Brian,

What’s the PowerBuilder version you are using? PowerBuilder 2019 R3 build 2728 and PowerBuilder 2021 support passing parameters to the EXE directly. Please download and install it to verify the issue and let us know if any problems.
You can get the installer from our Downloads portal at
https://account.appeon.com/download/2019 (login required).

Please note if there are multiple parameters, you need to put them between double quotation marks or replace the space between parameters with another character, for example:
C:\Users\user_name\AppData\Roaming\PBApps\Applications\localhost_app\app.exe "parm1 parm2 parm3"
C:\Users\user_name\AppData\Roaming\PBApps\Applications\localhost_app\app.exe parm1/parm/parm3

Regards,
ZhaoKai

Comment
There are no comments made yet.
Brian Greiman Accepted Answer Pending Moderation
  1. Tuesday, 31 August 2021 22:25 PM UTC
  2. PowerBuilder
  3. # 5

>>Run the Deployed App via it's shortcut value and then add any "dynamic" arguments under program control.

What do you mean by "under program control"?  

When I run this way, it is not working yet. 

C:\Users\Brian\AppData\Roaming\PBApps\Applications\localhost_test_application\test_application.exe test2

I must be missing something yet.

Thanks,

Brian

 

 

 

 

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 31 August 2021 23:05 PM UTC
Hi Brian;

I was thinking about using the PB built-in RUN() command, for example...

Run ( "C:\Users\Chris\AppData\Roaming\PBApps\Applications\localhost_OrderEntry_32_PC\OrderEntry_32_PC.exe " + ls_arg1 + ls_arg2 + ls_arg3 )

That should now pass the static & dynamic arguments to the PC Apps "Command line" argument of the Application object class. This is where my framework traps the passed values that you see in my screen capture of the App's log file. HTH

Regards ... Chris

  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 30 August 2021 20:46 PM UTC
  2. PowerBuilder
  3. # 6

Hi Brian;

  If you do not want to use the URL approach, you can use the App's short-cut. For example:

Hard Coded Argument (Project Painter)

Dynamic Argument

Run the Deployed App via it's shortcut value and then add any "dynamic" arguments under program control.

For example:

    C:\Users\Chris\AppData\Roaming\PBApps\Applications\localhost_OrderEntry_32_PC\OrderEntry_32_PC.exe Name=Chris

PowerClient App Runtime Result

HTH

Regards ... Chris

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 27 August 2021 17:26 PM UTC
  2. PowerBuilder
  3. # 7

Hi Brian;

   FWIW: What I have done with PowerCleint Apps since PB2019R2 and now PowerServer Apps in PB2021 to address this dynamic start-up set of variables is the following:

1) Create a PB Launcher App that "launches" the real PB App(s).

2) Have the Launcher PB App grab the MS-Windows WorkStation User ID (Windows API) and App Name of the App to be launched.

3) Using the User & App, proceed to a Launcher Database that returns the start-up parameters for the PC/PS App and User in question.

4) Launch the real PC/PS App via it's URL and provide the dynamic start-up parameters as required in the starting URL (as Armeen has mentioned).

5) To accomplish #4, use PB's INET Object Class and the HyperLinkToURL command to launch the App (as Armeen has mentioned).

6) To change the Start-Up parameters for any App - just update the "Launcher" DB for each App / User affected as required.

Food for thought.  ;-)

HTH

Regards ... Chris

Comment
  1. Brian Greiman
  2. Monday, 30 August 2021 19:12 PM UTC
>> 5) To accomplish #4, use PB's INET Object Class and the HyperLinkToURL command to launch the App (as Armeen has mentioned).

My struggle is I do not want chrome launching each time our application called. Is there a way to do this without the browser window invoking?



Our other use case for parameters is for a Report Viewer. Currently, our users can click on any .psr file and it will launch our application with the .psr file as the attachment. The application's open event will then be able to open this attachment correctly. I am not sure how to handle this with Powerclient.



Powerclient is a great feature and we are looking forward to using but concerned if we can't overcome these hurdles it may present an issue for us to use.



Let me know if you have any other thoughts or tips.



Is Appeon looking to support parameters natively in a future build?



Thanks,

Brian
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Thursday, 26 August 2021 21:35 PM UTC
  2. PowerBuilder
  3. # 8

Here is how command line parameters work in PowerClient/PowerServer:

If the parameter is fixed, specify it in the project config.

If the parameter is variable, you must specify in the URL.  For example, http://localhost/appname/?arg1=value1

If you want shortcut and parameter is variable, you will need to make one yourself that is pointing to the URL rather than .EXE.  You cannot use the system generated shortcut.  

Here is some documentation to read: https://docs.appeon.com/pb2019r3/pbug/ch07s03.html#defining_an_ica_project

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.