To ensure that your application can be successfully installed and run, you must first make sure that all components on which it depends are already installed on the target computer. For example, most applications have a dependency on the .NET Framework. The correct version of the common language runtime must be present on the destination computer before the application is installed. You can use tools to help you install the .NET Framework and other redistributable packages as a part of your installation, a practice often referred to as bootstrapping.
The bootstrapper is a simple setup packager that can be used to install application prerequisites such as the .NET Framework, MDAC, database drivers, or PowerBuilder runtime files. You specify what prerequisites your application has and where they can be found. The bootstrapper downloads and installs the prerequisites.
If you select one or more prerequisites on the Prerequisites page, PowerBuilder generates a Windows executable program named Setup.exe that installs these dependencies before your application runs. The packages are copied to a SupportFiles directory on the server.
If a Setup.exe is generated, the Publish.htm page contains a link to install just the application, and a button to install both the application and the bootstrapped components, as shown in Figure 10-2.
The bootstrapper lets you provide users with a simple, automated way to detect, download, and install an application and its prerequisites. It serves as a single installer that integrates the separate installers for all the components making up an application.
When the user clicks the Install button on the Publish.htm page, the bootstrapper downloads and installs the application and the prerequisites you specified if they are not already installed on the user’s computer.
For example, suppose you specified that the application required the .NET Framework and the PowerBuilder 11 runtime files. If neither of these components is already installed on the user’s computer, they both display in the Installation dialog box. If both are already installed, they do not display. If the user clicks the Advanced button on the Installation dialog box, the Components List dialog box displays. This dialog box shows that both components are already installed.
The bootstrapper also detects whether a component is supported on the target computer's operating system. If the component cannot run on the target platform, the bootstrapper notifies the user and ends the installation before downloading the component.
The selections available on the Prerequisites page can be customized by adding a new subdirectory to the PowerBuilder 11.0\DotNET\pbiu\BootStrapper\ Packages directory. To this subdirectory, you add the package you want to make available and an XML configuration file that specifies where to obtain the package and what to check on the user’s system to determine whether the package needs to be installed.
PowerBuilder 11 does not supply a tool to customize prerequisites. You can use the PowerBuilder Runtime Packager tool to build an MSI file that contains the database drivers and other PowerBuilder runtime files that your application needs, and use the configuration.xml file in the BootStrapper\Packages\ 1-PBRuntime directory as an example when creating your own configuration.xml file.
You can use the InstallerEditor (dotnetInstaller) open source tool to set up your own customizations. It is described on the DevAge Web site and can be downloaded from the dotnetInstaller project page on the SourceForge Web site. Read the instructions on the DevAge Web site to learn how to use the tool.
There are two packages available on the Prerequisites page: the .NET Framework 2.0 runtime files and the PowerBuilder 11 Runtime Library. If you look in the BootStrapper\Packages directory, you see two subdirectories, each of which contains a configuration.xml file.
To enable your application to deploy the .NET Framework 2.0 package, you need to copy the .NET Framework 2.0 redistributable package, dotnetfx.exe, to the 0-dotnetfx directory. This file can be downloaded from the Microsoft Web site. You also need to edit the configuration.xml file to ensure that the application name and locations specified in the file are correct for your installation. The file uses http://localhost/SampleApp as the source URL for the package.
The PowerBuilder 11 Runtime Library package is in the 1-PBRuntime subdirectory. The PBRuntime.msi file installs the same files as the PowerBuilder Runtime Packager (with .NET and all database interfaces and other options selected) into a directory on the target computer, and it installs the same .NET assemblies into the Global Assembly Cache (GAC). If you do not require all the files included in the package, you can create your own package. For more information, see “Customizing the Prerequisites page”.
For more information about the Runtime Packager, see the chapter on deployment in Application Techniques.
For more information about editing configuration.xml files, see the documentation for the available on the DevAge Web site.