isual Studio 2005 has great support for building Windows Mobile applications such as Pocket PC and Smartphone applications. But what happens after an application is completed and ready to be deployed onto the user's device? In Visual Studio 2005, deploying an application to a device is simply a matter of connecting that device to the development machine using ActiveSync and then pressing the F5 key. However, this method of deployment is not acceptable to end users. End users are accustomed to GUI setup applications that hide the details of the installation process.
In this article, you will learn how to build CAB files for your Windows Mobile applications so that they can be deployed to your Windows Mobile devices. You will also learn how to build a custom installer so that end users can deploy applications to a Windows Mobile device through a set up application on their desktop computers.
The following is an overview of the steps that you need to perform in order to create an installation package for a Windows Mobile application:
- Create the Windows Mobile application.
- Package the Windows Mobile application into a CAB file.
- Create a custom installer to install the Windows Mobile application.
- Create a setup.ini file to describe the Windows Mobile application as its associated CAB file.
- Create a Setup project to package the CAB file, custom installer, and setup.ini files.
Creating the Application
|Figure 1. Hello World! This simple Pocket PC application is what I will use to demonstrate the deployment capabilities.|
For this article, I will create a simple Windows Mobile 5.0 application using Visual Studio 2005, which I will use to demonstrate the deployment functionality. If you want to follow along with my demo, create a new Device Application Project in Visual Studio and name it C:\SampleApp
(see Figure 1
For simplicity, this application will just contain a Button control that displays a "Hello Pocket PC World!" message when clicked (see Figure 1). The content of this application is not important; I just want to show how you can deploy this application.