Using InstallAware 7 To Publish Web Updates

Protected by Copyscape Unique Content Check
Published: 17th September 2008
Views: N/A

Overview



This whitepaper describes how to use InstallAware for publishing software updates on the web. The software lifecycle has evolved to the point where updates are still expected to be delivered after a product's original release to manufacturing. To accommodate this requirement, developers are often tasked with building web update clients from scratch. These home-brewed web update clients consume significant development resources to build and maintain over time. InstallAware provides out-of-the-box web update capability to address this requirement at absolutely no effort or cost to you; whilst maintaining full customizability and extensibility in the good InstallAware tradition.



Unlike other web update mechanisms, InstallAware does not install an update service which constantly consumes system resources and memory, and increases the attack surface on the client machine. InstallAware does not force its branding or impose other limitations on the web update user experience either. While some web update mechanisms can be customized only through HTML templates, InstallAware lets you take full control over the entire update process - including not only the update user interface, but also the workflow. Updates may be shipped selectively to a subset of your user base, decided according to any custom set of parameters you may have.



InstallAware's out-of-the-box web update functionality is modeled after Windows Update to ensure optimal user experience and confidence. The web update client has been implemented entirely in InstallAware, and not a separate third party programming environment; which is a testament to the capabilities of InstallAware's MSIcode scripting and dialog design capabilities. This also makes the entire update process fully customizable and transparent. Since the full source codes for the update client are provided, it is very easy to inject custom behavior, or completely overhaul the update mechanism as necessary; whilst having pre-built code-blocks and update dialogs on hand to avoid costly re-engineering of common web update behavior.



Additionally, since the web update functionality is compiled into the main setup file, a separate update client does not need to be installed on target systems, saving space both on end-user machines and inside the setup file thanks to reduced payload.



Finally, just like Windows Update, InstallAware schedules web updates to be run on a date and time chosen by the end-user. The update client never consumes memory or other system resources in the background, since it runs only at this chosen time. The update download and installation process is very un-intrusive (again, just like Windows Update), with message balloons in the system tray providing helpful indicators as to the availability of updates and the progress of the download/installation. Again, all these out-of-the-box aspects of the update client may be easily customized simply by editing the existing MSIcode script and dialogs.



These advantages make InstallAware web updates the ideal technology to push updates to end-user systems after your product has been released to manufacturing, delivering you maximum cost savings without losing the ability to customize the web update process for your business processes and customer requirements.



Enabling the Web Update Client



To enable web updates for products you are installing with InstallAware, perform the following steps.



1. Launch the InstallAware IDE using the Windows Start Menu, and open the setup project for the product that you wish to enable the web update client for.



2. On the Design tab, in the Views group, click the Product Details button. Choose the Project Properties design view under the Application Information heading.



3. Check the Receive Application Updates check-box. InstallAware suggests a starting URL for the Monitor URL field automatically. Revise the URL as necessary to point to your web server. Don't worry about the updates.ini file for now.






* Custom Programs: Alternately, an update may be a completely custom program file that carries out any sequence of actions as required by your update scenario. It does not have to be a setup or a patch, it does not have to be an InstallAware built file; nor does it need to update any files, registry keys, and so on. You have complete freedom in running any executable program you wish, as long as it performs the update operation you desire.



Continue to the next section once you have a couple of updates available for your application. For the purposes of completing this guide, you may simply rebuild your existing setup project a few times without changes, just to have several setup.exe files that serve as mock product updates. Before each rebuild, just make sure to increment the Product Version field in your project, so InstallAware can keep track of the changed "new version" numbers.



Update Packs



Each available product update is treated atomically in InstallAware and referred to as an "Update Pack". Follow these steps to define update packs for your product:



1. On the Design tab, in the Views group, click the Web Updates button. Choose the Update Packs design view under the Web Updates heading.



2. Click the New button to begin authoring a new Update Pack definition. The Update Pack dialog box appears.



Application Data.exe" REMOVE=TRUE MODIFY=FALSE



Parse this string in your application to remove the command line parameters REMOVE=TRUE MODIFY=FALSE as well as the double quotes surrounding the main string. The final string that indicates the location of the update client (as well as your setup program) should be of this form:



C:Documents and SettingsApplication Data.exe



Programmatically Scheduling Updates



The command line switch to put setup.exe into update scheduling mode is /updatesetup. This command line switch may also be re-used after updates have already been scheduled to change the existing update schedule and preferences.



Note that the update scheduling process also determines what to do when updates are found - end-users choose between automatically downloading/installing available updates, or manually approving the download and installation of each individual update that is found. Even if you do not intend to offer updates for your end-users on a pre-set schedule, you should still run setup.exe at least once with the /updatesetup command line parameter to ensure that these important update installation preferences are initialized. Running the update client to download and install updates without this pre-initialization may result in runtime errors due to un-initialized update script variables, which are initialized during the update scheduling step.



You may force such a pre-initialization directly from your main setup script, right after your product installation completes, by following the steps below:



1. In the InstallAware IDE, switch to the MSIcode tab.



2. In the MSIcode editor, choose your main setup script, which is the page immediately to the right of the Welcome Page.



3. In the left code navigation drop-down, located directly above your MSIcode script, choose the Comments category.



4. In the right code navigation drop-down, choose the TO-DO: Insert command that starts your application here comment. This navigates the MSIcode editor to the part of your script that runs after a successful application installation (and never after a cancelled installation, or an uninstallation; which is not what we would want).



5. Drag-and-drop or type the Run Program MSIcode command into the highlighted region of the MSIcode script, and configure the Run Program dialog as in the screenshot below:






It is also important to note that the update client does not check for the exit codes returned by the actual update installer (the actual full setup, patch, or custom program applying your update on the system). You may want to return specific exit codes from the update installer itself, and check for those return codes right after Run Program finishes running the update installer in the MSIcode updates script.



Implementing Custom Update Filters



You may wish to serve updates only to qualified users - for instance, users who are on a subscription plan with your company. Alternately, you may have multiple editions of your product, and you may need to qualify the availability of updates not only based on the product version, but also on additional parameters, such as the language of the product. InstallAware makes it easy to add custom update filters to the standard update client, since you already have the full sources of the MSIcode update script.



In this section, we'll implement a language-based filter to illustrate how to fine-tune the delivery of your product updates using the pre-built InstallAware update client. Based on this example, you may add any further custom qualifiers to your update process, such as serial validation, subscription validation, and so on.



Extending Update Pack Definitions



Follow these steps to add a custom qualifier to the existing Update Pack definitions:



1. Open the updates.ini file created in the first part of this document using Windows Notepad. This INI file is found in your setup project folder.



2. Locate the INI file section created for the first update pack. This INI file section begins with the line [Recommended Update for Version 1.0]. Add a new INI file entry under this section: Languages=English.



3. Locate the INI file section created for the second update pack. This INI file section begins with the line [Recommended Update for Version 1.1]. Add a new INI file entry under this section: Languages=German.



4. Locate the INI file section created for the last update pack. This INI file section begins with the line [Cumulative Updates for 1.0 and 1.1]. Add a new INI file entry under this section: Languages=English,German.



5. Save the changes to your INI file and upload to your web server.



You have now added a new Languages qualifier to each Update Pack declaration. The update client can now be extended to access this information when reading and parsing the updates.ini file.



Extending the Update Client



To extend the update client, customize the MSIcode sources of the updates script, adding filtering logic into the pre-built script. To keep this document simple, the changes made below skip installing updates that aren't qualified, warning the end-user with a message box. A more advanced implementation can hide unqualified updates from the list of available updates altogether.



1. In the InstallAware IDE, switch to the MSIcode tab. Choose the updates script.



2. On the MSIcode tab, in the Edit group, click the Find button. Search for the text Run Program $SUPPORTDIR$. This is the part of the update script which runs the update installer.



3. Drag-and-drop or type the Get INI File Settings MSIcode command into the highlighted region of the MSIcode script, and configure the Get INI File Settings dialog as in the screenshot below:



http://www.installaware.com/home/publications.asp



Whitepapers providing an in-depth analysis of InstallAware's scripting and web deployment technologies, as well as a Reviewer's Guide, are available at the above URL.

This article is copyright


Report this article Ask About This Article


Loading...
More to Explore