Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Distributing WebView2 Runtime – PB Docs 2022 – PowerBuilder Library

Distributing WebView2 Runtime – PB Docs 2022

Distributing WebView2 Runtime

The underlying engine of the WebBrowesr control is Microsoft
Edge WebView2
. When the WebBrowser control is used in your
PowerBuilder application, you need to distribute the WebView2 Runtime
with your application. WebView2 Runtime supports two distribution modes:
Evergreen Runtime and Fixed Version.

Which distribution mode to
use

For the detailed information about the pros and cons of the
WebView2 Evergreen Runtime and Fixed Version distribution modes, refer
to Microsoft documentation Distribute
your app and the WebView2 Runtime
. This section highlights the
main factors that shall be considered.

  • Evergreen Runtime

    1. The Evergreen Runtime distribution mode ensures that
      WebView2 Runtime is taking advantage of the latest features
      and security updates.

    2. The Evergreen Runtime requires persistent Internet
      connection for automatic installation and updates.

    3. In Windows 11 or later, the Evergreen Runtime is
      included as part of the Windows operating system; and it is
      updated automatically (when Internet connection is
      available). In Windows 10 or earlier, the Evergreen Runtime
      should be first installed using an online bootstrapper or an
      offline installer and then it will get updated automatically
      when Internet connection is available.

  • Fixed Version Runtime

    1. The Fixed Version Runtime will not be automatically
      updated. It requires you to manage the update: either keep
      using the existing version or periodically update the
      version that is packaged and installed with the PowerBuilder
      application

    2. To distribute a fixed version of the runtime, because
      the Fixed Version runtime cannot be installed by using an
      installer, you will need to download and install the latest
      available version of the Fixed Version to the specified
      location so that it can be automatically packaged with the
      PowerBuilder application

How to configure the distribution
mode

To configure how to distribute the WebView2 Runtime with the
application, use one of the following ways:

  • Method #1: Configure the distribution mode in the application
    script.

  • Method #2: Configure the distribution mode in the PowerBuilder
    IDE.

The runtime mode specified in the application script has
precedence over the runtime mode selected in the PowerBuilder IDE

Method #1: Configure the WebView2 Runtime
distribution mode in the application script

In the application Open event, call the WebBrowserSet function to set the
distribution mode:

Method #2: Configure the WebView2 Runtime
distribution mode in the PowerBuilder IDE

In the Application painter, click Additional Properties on the
General tab page in the Properties view; and then in the Application
properties dialog box that displays, select the WebBrowser tab.

WebBrowser1.png

  • Always use the Evergreen Runtime at the
    client

    This option is selected by default. When this option is
    selected, the Evergreen Runtime that is installed and updated on
    Windows will be used. If the client has no Evergreen Runtime
    installed, the client will be prompted to install the Evergreen
    Runtime from the URL which is specified in the “WebView2 Runtime Download URL” field.

  • Always use the Fixed Version at the
    client

    When this option is selected, the Fixed Version must be
    packaged with your PowerBuilder application and then installed to
    the client.

    You will need to download and install a version of the
    WebView2 Runtime (from this
    website
    ) to the location specified in the “WebView2 Runtime Fixed Version” group, so
    that it will be automatically packaged and installed with the
    PowerBuilder application.

  • Use the Evergreen Runtime by default; if
    it does not exist, use the Fixed Version

    The Evergreen WebView2 Runtime will be used by default, but if
    it does not exist, the Fixed Version Runtime will be used.

Packaging and distributing WebView2
Runtime

For how to package and distribute WebView2 Runtime in PowerBuilder
WebBrowser control, refer to the section called Packaging WebBrowser.

Where to get the WebView2 Runtime Fixed
Version at the client

Applications that use the WebView2 Runtime Fixed Version will
search for the WebView2 runtime files in the following precedence
order.

  • The precedence order in the development environment

    1. The path specified in FixedVersionRuntimePath of the
      WebBrowserSet function.

    2. The directory where the application executable file is
      located.

    3. The PowerBuilder Runtime directory under the build number
      selected in the PowerBuilder IDE > Tools menu > System
      Options dialog.

  • The precedence order in the production environment

    1. The path specified in FixedVersionRuntimePath of the
      WebBrowserSet function.

    2. The directory where the application executable file is
      located.

    3. The PowerBuilder Runtime directory specified in the
      configuration file
      (executable-name.xml).

    4. The PowerBuilder Runtime directory stored in the system
      registry.

    5. The PowerBuilder Runtime directory specified in the PATH
      environment variable (if any)

How to write PowerScripts to check if
Evergreen Runtime is installed

You can add the following scripts to the Application Open event to
check if the WebView2 Evergreen Runtime has been installed on the
client.

If Evergreen Runtime is not installed, the end user will be
prompted and the Web browser will be open to display the download
page.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x