1. Olan Knight
  2. PowerBuilder
  3. Tuesday, 23 October 2018 15:15 PM UTC

PowerBuilder v12.5.1, b7055


I have inherited a utility that I want to create as a stand-alone EXE.
I selected the FULL REBUILD and MACHINE CODE options, but after deployment the utility was asking for specific DLLs.

Is what I want to do even possible, or will even this type of executable require DLLs to be deployed?


I know this is a basic question and I've been using PB since v4, but I have never created a machine code EXE before!


Thanks,

Olan

Olan Knight Accepted Answer Pending Moderation
  1. Tuesday, 23 October 2018 18:35 PM UTC
  2. PowerBuilder
  3. # 1

Thank you for the great answers, Chris and Shenn!

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 23 October 2018 16:08 PM UTC
  2. PowerBuilder
  3. # 2

Hi Olan;

   App's compiled to M-Code vs P-Code require the same PB run-time DLL's. Like the current Appeon PB, just run the PB Packager utility that comes with PB 12.5.x to create the run-time MSI installation. Then run that MSI on the PC's where you are deploying your M-Code compiled App.

   Note that you do not need to install the PB Run-time if it already exists on the target PC's because there are existing P-Code compiled Apps already resident there. The same PB Run-time handles both P-Code and M-Code execution.

   I always compile to M-Code as it can run your App's up to 50 - 1,000x faster. This is mainly for Apps that I build for use as Batch, System Tray or Windows Service.

HTH

Regards ... Chris

Comment
  1. Shenn Sellers
  2. Wednesday, 24 October 2018 16:03 PM UTC
Does that 50-1,000x faster speed apply to all applications? I used to compile to M-Code when I first started using PB, but over the years I heard that there was basically no difference in speed when compiling to P-Code. (The only exception being if your app included lots of math processing. Then M-Code would be ideal). Plus P-Code had a lot fewer issues than M-Code.



From the Help File...



Advantages of Pcode include its size, reliability, and portability.

The key advantage of machine code is speed of execution.

If your application does intensive script processing, you might want to consider using machine code. It will perform better than Pcode if your code makes heavy use of looping constructs, floating point or integer arithmetic, or function calls. If your application does not have these characteristics, machine code does not perform noticeably better than Pcode. If you think your application might benefit from the use of machine code, perform some benchmark testing to find out.

  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 24 October 2018 16:37 PM UTC
Hi Shenn;

The App performance improvement will all depend on what PB features you are using and how your PowerScript code is working on the processing issue. Again, the M-Code approach is the way to go for "Batch" apps that loop thru 1K's or even 1M's of rows of data performing intensive operations on the datum. I'll be talking about this aspect in one of my Elevate2018 presentations (multi-Threading).

Each App should be assessed on its merit for P-Code vs M-Code compilation and then followed through by some substantiated testing of the two to determine if its right for your IT application..

Yes, M-Code is much more intolerant of sloppy PowerScript coding. So if you do not write "tight" code - your going to see the C++ Compiler and/or Linkage Editor complain. However FWIW, I always unit test my frameworks via M-Code compilation (even though I release them in P-Code format) as it proves that the code compiles and runs as it should in a much more discerning environment. Once proven under M-Code, I can release the P-Code version with much more confidence. Food for thought.

Regards ... Chris

  1. Helpful
There are no comments made yet.
Shenn Sellers Accepted Answer Pending Moderation
  1. Tuesday, 23 October 2018 15:41 PM UTC
  2. PowerBuilder
  3. # 3

You will still need to deploy the PB runtime DLL's and drivers.  You can, however, make your executable contain all your code by unchecking the DLL checkbox for all your pibbles.

Attachments (1)
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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.