Wednesday, February 1, 2012

Working with PBR file


When you create or build an application, sometimes you need to add external resource like image, sound or even non standard font.

In Powerbuilder, you have 2 options when you have external resource files.


  1. You always have to copy all the external resource files (*.bmp, *.jpg, *.wav etc) into the client computer, as well as concurrent when you copy your application (*.exe , *.dll files).
  2. You combine all the necessary external files into your application, so you no longer need to copy the files.


The first option has some minus points, example: user can delete by themself the external files. The application may still running, but in some parts, the image will blank.

The second option is not without value minus. The consequence is the application file will be very large. But it would be safer because at least the user can not arbitrarily remove its files.

To implement the second option, Sybase has provided a facility to handle this problem. By using the PBR (Powerbuilder Resource) file, we can put all the file names, along with a complete path, into the application.

Make a PBR file using the Edit menu, and save the file name with extention PBR.

Do not forget to include it in the PBR file in your project, in the Resource file name.

Put your PBR file in your project


All files listed in the PBR list, will automatically be compiled and incorporated into the application file, so you no longer need to copy it to every computer user.

2 comments :

  1. How can we extract these resource (.bmp, .jpeg, .* from) .pbr files if we want to see the raw files.

    ReplyDelete
  2. PBR file is simply a text file that tells the PowerBuilder compiler to include external files into EXE or DLL files. If you want to extract, please google the PB Decompiler as the key

    ReplyDelete