The Kinetic Jump site navigation header requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

 
Solution Lab
Articles, demos and examples that help AppLife users get the most out of their software.
Examples and usage information for AppLife products
AppLife Update Labs

Msi + Update Application Deployment Solution

Date: July 8th, 2008
Product: AppLife Update
Version: 1.3.0.10
Downloads
Lab Description
Combining the installation features of the Windows Installer (msi) with the updating features of AppLife Update provides software publishers with a sound application deployment and maintenance strategy for Winforms and WPF client applications.
Example Solution

This lab uses a Visual Studio Setup & Deployment project to deploy an example Windows forms application and AppLife Update to build, discover, download and apply updates. At the end of the lab, we will be able to create installation packages for new application versions and publish updates that deployed clients use to automatically update to new versions.

Creating the Installer

The Visual Studio Setup & Deployment project is a very powerful and straightforward mechanism to create a Windows Installer package for applications. Using the File System view we can add the primary output of our example application project to the Application Folder. When we add the output of the example application, all referenced assemblies will be included automatically. Windows Installer Configuration We also include a shortcut to the user’s start menu by selecting User’s Programs Menu and adding a shortcut to the primary executable in the Application Folder. Adding an application shortcut

Deploying the .Net Framework

Using the Visual Studio Setup & Deployment project, the .Net Framework can be deployed by selecting from the Prerequisites menu. This menu is opened by clicking the Prerequisites button on the project properties dialog. .Net Framework Reference With this box checked, a Setup.exe is created when this project is built that deploys the .Net framework.

Checking for updates

With an installer ready to go, we want our example application to be able to discover, download, and apply updates that will be published as changes are made to the application. For this example, we want to check for updates without requiring user action, but do want to require user confirmation before proceeding with an update. To accomplish this, we initiate an asynchronous (background) update check when the application launches. If an update is discovered, we ask the user for confirmation. If no updates are available, the user is not bothered.

The AppLife Update Controller is very flexible. Deciding when to check for updates, when to download, when to interrupt the user, and when to apply an update is entirely up to the integrator.

Integrating AppLife Update is simple. We include a reference to the Update Controller assembly and then place an Update Controller control onto the main form of our application. Then we create an AppLife Update project file (aup) and synchronize the project with the Update Controller in our application. Follow the instructions displayed in the AppLife Update new project wizard. Updater project types With the update controller in place, we check for updates during the initialization of the main form in the application. .Net Updater API Because we are using the asynchronous event, we subscribe to the CheckForUpdateCompleted event and continue the process within the event handler. Using the application updater control

Versioning

For update versioning, we are using the assembly version of the example application. The Update Controller provides functionality for synchronizing the update version to the assembly version. This feature is enabled by setting the UseHostAssemblyVersion property of the Update Controller to true.

Building Updates

With our example application ready for updates, we can create and publish updates as the application is extended. Updates for this example application will primarily involve replacing assemblies, though in the future we may need to do more. For assembly replacement, we are using the Add & Replace files by comparison action. This action compares a baseline folder with a current folder to determine which files in the current folder is new or has been updated. The baseline folder should represent what the application directory includes for a previous version of the application. We have created a baseline folder for version 1.0.0.0. Building an application update package For the current folder, we are using the Visual Studio build folder (bin). This folder will have files that we don’t want to include such as pdb files, config files, and code comment files. We can exclude these files with the action filter property. Comparing updater files With this action set up, we are ready to build and publish updates whenever we build the example solution. The updates we build for this application will target all previously released versions.

Publishing an Update

With version 2.0 ready for deployment, we build the Installer project to create a new installer. With the new version built, we can publish an update using AppLife Update. We set the new version number, what previous versions can apply this update, and include any update comments. Publishing application updates Update control With the update published, previous versions can discover, download and apply the update to version 2.0.

Visual Studio is a registered trademark of the Microsoft Corporation.

Download AppLife Update Here

Customer testimonials "AppLife Update has saved us countless hours and provides the exact functionality we needed to provide automatic updates to our existing applications. We initially had looked into developing an updating system in house and after testing AppLife Update we decided it wasn’t possible for us to build anything as feature rich as AppLife Update."