1. Rajaram Palanisamy
  2. PowerServer
  3. Tuesday, 26 July 2022 20:52 PM UTC

Hello,

 

How to include external .EXE file created in C++ as part of PowerServer Client files download and launch it from PowerBuilder application with a link?

 

In PowerServer project -> External Files tab, I couldn't select .EXE file in "Add Files...".

 

I can include DLLs, OCXs, INI but not EXE.

 

Thanks.

Accepted Answer
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 27 July 2022 02:30 AM UTC
  2. PowerServer
  3. # Permalink

Hi Rajaram,

I can add the exe and run it successfully. Can you give us more details about the issue on your end?

To select the .EXE file, please make sure all these files are placed in the same folder or sub-folder of the application target (.pbt) file, otherwise, you cannot select it.
Please note that the external files cannot contain any file that has the same name as the application or the PBD or p-code file to be generated, otherwise, the duplicate name error occurs. For example, [appname].exe.

You can find the above information in the online document below.
https://docs.appeon.com/ps2021/Define_the_PowerServer_projects.html

 

To run the .EXE file, you can run it via the Run function (might need administrator permission) in PowerBuilder application, for example:
run(GetCurrentDirectory ( ) + '\' + %file name%)

Or you can run it via a command in preload event, the commands in Preload event can be any Windows commands or user-defined commands, you can do any custom operations by running a batch file in Preload event.

Please refer to the articles below for details.
https://docs.appeon.com/ps2021/Define_the_PowerServer_projects.html (refer to the section of "Preload event")
https://community.appeon.com/index.php/qna/q-a/power-client-installation-of-batch-file (a practical example on the usage of external files and Preload event, though it is about PowerClient, it applies to PowerServer 2021 as well.)


Regards,
Kai

Comment
There are no comments made yet.
Rajaram Palanisamy Accepted Answer Pending Moderation
  1. Wednesday, 27 July 2022 19:56 PM UTC
  2. PowerServer
  3. # 1

MigueIL,

 

Thank you for your answer. 

Comment
There are no comments made yet.
Rajaram Palanisamy Accepted Answer Pending Moderation
  1. Wednesday, 27 July 2022 19:54 PM UTC
  2. PowerServer
  3. # 2

Hello Kai,

 

Thank you for detailed reply.  I am able to include EXE file as per the instructions and it is working fine now.

Comment
  1. Kai Zhao @Appeon
  2. Thursday, 28 July 2022 00:07 AM UTC
Glad to hear that!
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 26 July 2022 23:46 PM UTC
  2. PowerServer
  3. # 3

I'm not sure how to include an EXE (can't run PB right now), but just wanted to state that when adding DLLs, "EXE" is also a valid extension for a DLL, so it should be included. I think the same thing happens with the DLL importer tool: You cannot choose a DLL with an file extension of EXE. (you have to rename it to DLL and then you can use the importer tool).

Maybe a solution for deploying your EXE file is to write a script / batch file. You can specify scripts somewhere in the powerclient project settings if I remember well.

regards,

MiguelL

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.