30
Smart Client Deployment in PowerBuilder 11 This article will first talk about what constitutes a .NET Smart Client, its attributes, its behaviors, and then we’ll talk about how the Intelligent Updater feature fits into PowerBuilder 11’s .NET Smart Client support initiative. Finally, we’ll walk through a detailed tutorial on how you may use the Intelligent Updater to easily install, publish and update your .NET Windows Form-deployed PowerBuilder applications. The .NET Smart Client Arguably, the biggest headache for application development has been…deployment. The initial and ongoing appeal of browser-based applications has always been about the update of application logic and interface in an automatic fashion for every single User. But this ease of deployment of so- called thin client application has come at a cost, hasn’t it? The lack of richness and the lack of functionality of browser-based user interfaces. PowerBuilder 11’s Intelligent Updater will give the User the rich user interface they deserve and it will give developers, administrators, anyone responsible for deploying PowerBuilder applications the advantageous ubiquity of the Web. Sybase will be delivering support for .NET Smart Client with the following attributes: A Smart Client needs to be “occasionally connected ”, that is, it must not require a persistent database connection. PowerBuilder 11 will have occasionally connected capabilities with its enhancement of its MobiLink database synchronization support first introduced in PowerBuilder 10.0. PowerBuilder 11 will also add the updateable Web Service Source DataWindow, which will utilize Web Service operations for full CRUD support rather than a persistent database connection. The Web Service Source DataWindow will also add to a .NET Smart Client’s need to communicate via Web Services. As a superset of Web Service utilization, a .NET Smart Client should also be able

PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

Embed Size (px)

Citation preview

Page 1: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

Smart Client Deployment in PowerBuilder 11

This article will first talk about what constitutes a .NET Smart Client, its attributes, its behaviors, and then we’ll talk about how the Intelligent Updater feature fits into PowerBuilder 11’s .NET Smart Client support initiative. Finally, we’ll walk through a detailed tutorial on how you may use the Intelligent Updater to easily install, publish and update your .NET Windows Form-deployed PowerBuilder applications.

The .NET Smart Client

Arguably, the biggest headache for application development has been…deployment. The initial and ongoing appeal of browser-based applications has always been about the update of application logic and interface in an automatic fashion for every single User. But this ease of deployment of so-called thin client application has come at a cost, hasn’t it? The lack of richness and the lack of functionality of browser-based user interfaces. PowerBuilder 11’s Intelligent Updater will give the User the rich user interface they deserve and it will give developers, administrators, anyone responsible for deploying PowerBuilder applications the advantageous ubiquity of the Web.

Sybase will be delivering support for .NET Smart Client with the following attributes: A Smart Client needs to be “occasionally connected”, that is, it must not require a persistent database connection. PowerBuilder 11 will have occasionally connected capabilities with its enhancement of its MobiLink database synchronization support first introduced in PowerBuilder 10.0. PowerBuilder 11 will also add the updateable Web Service Source DataWindow, which will utilize Web Service operations for full CRUD support rather than a persistent database connection. The Web Service Source DataWindow will also add to a .NET Smart Client’s need to communicate via Web Services. As a superset of Web Service utilization, a .NET Smart Client should also be able to implement network resources. Smart Clients should also maximize their performance using client resources. Isn’t that interesting, yes, the pendulum has swung back from thin client, especially for business users who’ve tired of waiting for rich user interface within the browser since approximately 1996 (note the change in spin of “fat client” to “rich client”). And most notably, a .NET Smart Client should have always-up-to-date applications via Smart Updates. PowerBuilder 11 will give you that powerful productivity with the Intelligent Updater feature, enabling you to install, publish and update your .NET WinForm-deployed PowerBuilder applications…automatically…to every single user…with not one additional line of code from you the Developer.

So what constitutes a .NET Smart Client? Simply put, any application that utilizes one or more of the attributes defined above. This leaves you and your teams to determine what subset of Smart Client attributes, which Smart Client techniques, are appropriate for your solution, for your enterprise.

The Intelligent Updater

Page 2: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

PowerBuilder 11’s “Intelligent Updater” is a new application deployment technology that makes deploying PowerBuilder .NET Windows Forms applications as easy as deploying Web applications. This feature is based on the “ClickOnce” technology in the .NET Framework v2.0. “Intelligent Updater” is designed to address the pain of deploying and updating Client/Server applications as well as the client applications of n-tier solutions. A caveat…the Intelligent Updater is meant only to install/publish/update .NET WinForms-deployed PowerBuilder applications. It is not designed to will not function for Win32-compiled applications. As far as system requirements go, the Users’ workstations only need to have the .NET 2.0 redistributable framework installed and in the system path. (http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en)Similarly, your development workstation will also need the .NET redistributable framework. In addition, the design time requirements include the .NET 2.0 Framework SDK, the SDK’s %SDK%\bin directory should also be in PATH, and you need to verify that %PBNET_HOME% (the ..\DotNET subdirectory of your PowerBuilder 11 installation directory) has been set as a system environmental variable during the installation of PowerBuilder. You will also need to be able to access an instance of Internet Information Server (IIS) 5.0 or higher.

The Deployment Model

Your WinForm applications will be published to, and your users will install and update from, centralized IIS servers via HTTP, FTP or UNC (Universal Naming Convention if using Windows “share” resources). You may also optionally use CD-ROM or DVD-ROM for initial installations of your PowerBuilder WinForm application.

The Overall Working Process

A high level outline of the overall working process of the Intelligent Updater is as follows:

- Using an existing PowerBuilder application, the developer will, in a Windows Forms project, set the publish properties, deploy/compile as a .NET Windows Forms application, then publish to an instance of IIS.

- The Users will browse to the application’s publish Web page which will transparently request the deployment manifest then download, install and optionally execute the application.

- The developer will then modify and, once more, publish the application.- The Users will run the application, which will again request the deployment

manifest from the server, see that there is an updated version available, then download, install and execute the updated application.

- The developer or administrator may roll back the version of the application on the server, which will then cause a reversion on the Users’ workstations.

- The Users may also rollback to a previous version of the application from the Control Panel’s “Add or Remove Programs” feature, or uninstall the application from their workstations altogether.

Page 3: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

Nuts and Bolts: The Tutorial

Let’s look at this process in detail. We’ll start with an existing PowerBuilder application. For demonstration purposes, we’ll choose to perform the most simplistic of ongoing modifications. The background color of the static text control of the “About” window will initially be red. We’ll follow an RGB progression throughout this course of action.

This first sequence will have us use PowerBuilder 11 to deploy our application as a WinForm application, publish it, then have the User download and install it. We’ll then modify the application, publish it, and then have the Users’ client automatically detect the new version, download and install it.

Page 4: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

Basic Usage of the Intelligent Updater

First, we’ll open the workspace of an existing PowerBuilder application, in this case we’ll use a code example delivered with Beta2 of PowerBuilder 11 (MarketingSample). We’ll want to create a new .NET Windows Forms Application target.

In the “Create the application” wizard window, we’ll choose “Use the library list application object from an existing target”.

Page 5: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

In the next window, we’ll select the only target available “mss”, and we’ll accept the default name and location for the target file (*.pbt) in the next window. For the purposes of this illustration, we’ll choose not to create the Project object with this wizard, and then choose “Finish” on the last wizard window.

Page 6: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

Next, we’ll right mouse click on the new mss_winform target, choose “New…” from the popup menu and then choose “.NET Windows Forms Application Wizard” from the “Project” tabpage. Click “OK”.

We’ll click “Next>” on the initial “about” wizard window, then choose mss_main.pbl as the library in which we’ll want to store the eventual Project object. In the next window, we’ll accept the default Project name of p_mss_winform. Click “Next>”.

Page 7: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

In the next window, we’ll accept the default product name, the default executable file name and the default product version values. Click “Next>”.

Page 8: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

In the next window we’ll choose to support this WinForm application’s installation and update as a Smart Client by checking the “Publish as smart client application” checkbox. Click “Next>”.

Allow this application to be run online or offline by leaving the first radio button on the “Specify Application Running Mode” window selected. Click “Next>”.

Page 9: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

In the next window, we’ll choose how the User will install this application, from a Web site, via a shared UNC path, or from a CD-/DVD-ROM. Leave the default Website of http://localhost/mss selected. Click “Next>”.

Page 10: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

Now specify when the application will be updated. Leave the default value “Check for updates before application starts” selected. Click “Next>”, then click “Finish” on the final wizard window.

You now have a reusable Windows Forms Project object that will be able to deploy your PowerBuilder application as a .NET WinForm application and publish it using Smart Client techniques via the Intelligent Updater.

Deploying, Running and Publishing Your .NET Windows Forms Application

To deploy/compile your application as a .NET Windows Forms application, click on the “Deploy” toolbar button on the project’s painter bar.

Note the output messages in the output frame. To run the .NET WinForm application, click on the “Run Project” toolbar button on the project’s painter bar.

Page 11: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

Tour the functionality of your application as a WinForm application. If you’re using the Marketing code example project, open the window class w_mss_about in the window painter. Change the background color of the static text control to red in preparation for tracking the modifications we’ll publish using the Intelligent Updater.

The Windows Form Project Object

In the p_mss_winform project, select the Publish tabpage. Note the values in the “Publish location” groupbox and the “Publish version” groupbox which recapitulate the values from the “.NET Windows Forms Application Wizard”. Also note the default values for the properties in the “Publish page” groupbox. If you wish, PowerBuilder will generate a publish page with a hyperlink. This hyperlink is what you would give to your Users once the application is in production. While this will be very useful and productive for prototyping, of course we assume you’ll provide your own appropriate vehicle for disseminating the URL with which your Users will access the installation and update capabilities of this solution. Note that for this example, we’ll leave the value for the Certificate file blank. We recommend that as soon as possible, if you don’t already have one, apply for a certificate that will allow your Users to be assured that you are the valid, registered, originating source of what they will eventually install across a potentially open network.

Page 12: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

Select the Install/Update tabpage of the Project object. Note that the “Update mode” group box reflects the value you chose in the wizard. Also note that the values in the Install/Launch groupbox as well as the “Update location” groupbox default to the location value you selected in the wizard. Of special note is the “Mandatory update” groupbox, which gives you the ability to prevent the User from using the application if it is older than the specified minimum version.

Page 13: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

It’s time to publish your application. Click on the “Publish Project” toolbar icon on the project’s painter bar. In the output frame, note the “Publish version” value. An instance of the browser opens to the default publish.htm page unless you specified a non-default value. The version value displayed on the page matched what was displayed in the output frame.

Page 14: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

Now, put on your User hat. You’ll use this publish page as if you are the User of the application. Hover the mouse cursor over the word “Install” in the html button. The value displayed in the status bar is the URL you would disseminate to your Users.

Click on the “Install” button. The application will automatically download, install and run. Click in “Install” on the Security Warning page if you’ve entered no value for the certificate.

Page 15: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

Open the Windows Start menu and, if you’ve left these values as the default, you should see a program group of Sybase, Inc. with a cascading menu item/shortcut of “mss”. Open the Help>About… window of your application and note the static text control’s background color of red (if you’ve chosen the ongoing modification recommended for this tutorial). Close the application. If you haven’t already done so, close the browser instance displaying publish.htm. Return to the Window Painter, and then change the static text control’s background color to the green in our RGB modification sequence. Save and close the window class. If you wish change the company name and the product name values on the General tabpage of p_mss_winform. On the Publish tabpage, uncheck the “Generate publish page” checkbox. From this point on, our “virtual” user for this demonstration will access published updates to the application through means other than the URL that is provided in the prototypical “publish page”.

Click on the “Publish Project” toolbar button and if you keep your eye on the output frame you’ll notice the automatically incremented publish version value.

Page 16: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

Changing your perspective back to that of the User, use the Windows Start menu to run the example application again. Your application has transparently downloaded the application’s manifest and detected that there is a new version available. You, the User, see a notification window displaying that a new version of the application is available. Click OK to download and install the update.

Open the “About” window and there you are. You’ll see that the static text control’s background color is now green, the “G” or second in our RGB sequence. You’ll also note that the application’s Start menu shortcut’s values have changed if you’d taken advantage of that option. For the sake of the next section of this article, leave the application running and return to the PowerBuilder IDE.

The Update Notifier Feature

In my estimation this feature is quite nifty. I don’t get to say the word “nifty” all that often let alone “gee whiz” so I rather enjoy talking about this feature…especially since it requires absolutely no code from the developer in order for it to be implemented. How this feature manifests itself to the User is two fold. At runtime it consists of a popup window originating from the system tray, which notifies the User of various application update status conditions, as well as a popup menu, which enables the User to take certain actions and modify certain options that concern updates to their application.

Page 17: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

In the PowerBuilder 11 IDE, change the background color of the static text control on w_mss_about to the blue in our RGB sequence. Save and close w_mss_about. I’ll also navigate to the Notify tabpage of my WinForm project and choose to use a non-default background image for my Notifier window. When you choose to use non-default values, the display size of Notifier’s icon is 16x16,and the display size of background image I’ve used is 148x120. I’ll also change the Notifier window’s title value to “MSS”. Publish your application once more, and then activate the running instance of it once the Publish is complete.

In the System Tray, right mouse button click on the application’s icon. Select “Check for Update” from the popup menu. The Notifier window appears informing you, the User,

Page 18: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

that there is an update available. Right mouse click on the icon again and select “Retrieve Update” from the popup menu. The Notifier window announces that the update has been downloaded and installed. Click on the icon again one more time and select “Restart with New Version” which indeed happens.

At this point you may want to say “…well gee Beav…is there more?” Yes indeed. Open the Notifier’s popup menu. Notice the User may turn polling on and off. Choosing “Options”, you’ll see the two options the User may modify. The popup window’s title and, more usefully, the interval the Notifier uses to poll for extant updates. Finally, if you’re curious, have the Notifier check one last time for updates. While there are none at this point, it’ll give you a chance to view your non-default Notifier background image, if indeed you’ve chosen one. Open the “About” window and verify that your modification to blue in our RGB progression has occurred.

Rolling Back Versions

Let’s talk about how the User or the Administrator may revert the published application to earlier versions. Let’s assume that for some reason, the currently published version of the application has some flaw and an earlier version is needed. There are historic versions of the application stored on the Users’ workstations as well as on the server. So let’s now perform three tasks. As the User, I’ll revert to the previous version. Then as the Administrator, I’ll revert to any previous version, then again as the User, I’ll perform an uninstall on the client, completely removing the application from the workstation.

So what I’ll do now is use my Start menu to navigate to Settings> Control Panel. I’ll select the “Add or Remove Programs” item, and then I’ll scroll down to my “MSS” marketing application. Click on the Change/Remove” button and with the “Restore application to its previous state” radiobutton selected, click “OK”. After the restoration confirmation message is displayed, run the application, open the “About” window, and note that yes, the static text control has reverted to its green or second state in our RGB sequence.

Page 19: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

Now as the Administrator, I wish to revert the application to one of any of its historic versions. If you have a default installation location for IIS, use Windows Explorer to navigate to the example application’s virtual directory at C:\Inetpub\wwwroot\mss. Note the folders, named, “1.0.0.0”, “1.0.0.1”, etc.

Page 20: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

These folders contain the historic and current versions of the application. The file “mss.application” is the manifest file whose contents (XML by the way) indicate which of the multiple stored versions is the active one published to the client workstations. Let’s cause an historic manifest to become the active manifest. Rename “mss.application” as “mss_application.OLD”. Let’s make a copy of the “mss_1_0_0_0.application” file and rename it to “mss.application”. This designates this file as the manifest of the active/current version rather than an historic version of the application. Its contents point to the historic 1.0.0.0 version of your application.

As the User, run the application from the Start menu and you’ll be notified there is an application update available. Accept the download, run the application, and note that the “About” window now has its first, red value in our RGB modification sequence. Whether you have 5 or 5000 users, they will all automatically receive this restoration.

Page 21: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

To complete this section, return to the “Add or Remove Programs” portion of the Control Panel and, as the User, completely uninstall this application from the workstation.

Locations, Locations, Locations: Publish, Install and Update

Let’s visit the concept of locations for .NET Smart Client deployment, three of them in fact. The Publish location is from the Developer’s perspective. To where does the Developer (or perhaps an Administrator) wish to publish the application’s executables? The Developer may also choose how to publish the application; via HTTP, FTP or even using Universal Naming Convention (UNC) to publish to a Windows shared resource/directory. The Install location is in fact, a matter of perspective of the User. From where does the User access the executables for initial installation purposes? For the User, the installation can be performed via HTTP, UNC or even CD-/DVD-ROM if you and your team wish. Thirdly, the Update location is from the User’s or indeed the application’s perspective. From where will the application transparently get the manifest file as it checks for, and then pulls down updated versions of the application? The Update location is usually the same as the Install location. The hard exception to this convention is if you’ve chosen to have the installation be performed using removable media, a CD- or DVD-ROM. So let’s see this in action. Let’s walk through, as a Developer, using an

Page 22: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

FTP site for our Publish location and let’s have the User access installation and updates through a syntactic UNC Update location.

In preparation for this next recipe sequence, you may want to peruse these resources:- “How to: Create and Configure FTP Sites in IIS” http://msdn2.microsoft.com/en-

us/library/6ws081sa.aspx- “How to configure file sharing in Windows XP”

http://support.microsoft.com/kb/304040- “Windows XP Networking: Sharing in the Home Office”

http://www.microsoft.com/windowsxp/using/networking/expert/honeycutt_august13.mspx

Open the project object p_mss_winform if you haven’t already done so. Select the Publish tabpage and rather than “Web site” choose the “FTP site” radio button. For the server value enter ftp://localhost and for the “Directory” value I’ll enter the name of a folder I’ve already set up, “mss” (in fact my C:\mss directory that I’ve created for this tutorial). For my FTP site, I’ve enabled anonymous logins, so do check the “Anonymous Login” checkbox. In the “Publish page” groupbox, ensure that the “Generate publish page” and the “Open publish page after publishing” checkboxes are checked.

Select the Project’s “Install/Update” tabpage and select the “From file share” radiobutton in the “How application will be installed or launched” groupbox. For my syntactic UNC location will be \\stranojwxp\mss2 (which also points to C:\mss).

Page 23: PowerBuilder 11 - SYS-CON Mediares.sys-con.com/story/jan07/319612/PowerBuilder_11_S…  · Web viewThis article will first talk about what constitutes a .NET Smart Client, its attributes,

I’m publishing via FTP to the same physical directory (C:\mss) that is shared for updating, but I’ve named the share resource “mss2” to sidestep naming collision issues. The rights for sharing on this directory only need to be “Read”.

In the PowerBuilder 11 IDE, click on the “Publish Project” toolbar button. Note that your FTP location is displayed in the notification window as well as in the output frame. The publish page should automatically open in the browser. Note that the URL in the browser’s address bar is syntactically a UNC location. As your mouse cursor hovers over the “Install” button, note that the location displayed in the Status Bar is the manifest file’s fully qualified path as UNC. As the User, click the “Install” button, and then click “Install” on the Security Warning window that appears if you’ve not used a certificate file. A caveat here…Windows Networking may not allow sharing to be active for your shared directory if you do not have an active TCP/IP stack during your prototyping. If so, plug into a LAN, or log into a wireless network, or if you’re on the road with no connectivity for your demo, invest in a pocket WiFi access point or router or hub (of course this caveat is moot in production as all points are assumed to have connectivity). As the User, you should see your application automatically execute. Go ahead and experiment with different publish/install/update location permutations at your leisure.

PowerBuilder Easing Your Way Into .NET

PowerBuilder does not just take advantage of .NET, but strives to remove the drudgery of the default framework so that you may concentrate on your architecture, your business rules, your enterprise solution rather than low-level plumbing. After all, that’s what PowerBuilder’s always been about…taking what’s available in the Windows environment, abstracting you from the needless detail of its implementation, and making you the most productive business developer on the block. We trust you’ll like the Intelligent Updater. Thank you for your attention.