How to create a desktop MSI installer for your Windows Mobile/CE application?

ImportantThe following article uses options that are available starting with the Professional edition and project type.

ImportantStarting with Advanced Installer version 7.2 a dedicated view which greatly simplifies registering your mobile applications with the Windows CE Application Manager was introduced. The below How To article serves mainly as an example in case you are using an older Advanced Installer version. Otherwise, using the ActiveSync page is strongly recommended.

Introduction

After creating a CAB package for your application using the Advanced Installer Windows Mobile CAB Project, you can create a desktop MSI installer package that installs the CAB through ActiveSync on a connected device. This is the most common delivery mechanism for Windows Mobile/CE CAB packages and it is also known as registering the application with the Windows CE Application Manager (a component of the Microsoft ActiveSync services).

Windows CE Application Manager

To install a CAB package onto a Windows Mobile/CE device from the desktop computer, the Windows CE Application Manager ("CeAppMgr.exe", installed with the Microsoft ActiveSync services) is used, passing an INI file as a command-line argument. The format of the INI file is described in this MSDN article and can be as simple as:

[CEAppManager]
Version = 1.0
Component = DeviceApp

[DeviceApp]
Description = My Company My Device Application
Uninstall = My Company My Device Application
CabFiles = MyDeviceApp.cab

Note the value for the "Component" key and the section name that describes the application - they are identical. The "Description" represents the full name of the application obtained by concatenation of the company name and application name (those of the Windows Mobile application).

Sample project

Download and unzip the Desktop (ActiveSync) installation example distribution to better understand how to configure your own package. The ZIP archive contains 2 Advanced Installer projects:

  • A Windows Mobile CAB Project that installs a simple executable which displays a message box, compiled for the StrongARM processor type (and compatible CPUs). The CAB package also adds a shortcut to this executable in the "\Windows\Start Menu\Programs" folder from the Files and Folders page. Depending on the target device type, the associated directory macro (%CE11%) will be translated into a specific standard Windows CE directory. See the %CEn% Directory Macros article for more details. A Professional or above edition of Advanced Installer is required in order to build this project.
  • A Professional MSI project that installs the CAB package obtained by building the Windows Mobile CAB project through ActiveSync on a connected device. A Professional or above edition of Advanced Installer is required in order to build and run this project.

Some notes regarding the desktop MSI sample project:

1. In the Install Parameters page are 3 Properties defined, which are used subsequently in the "setup.ini" file from the "Application Folder" (Files and Folders page). You only need to change the values of these Properties when creating the package for your mobile application. It is not necessary to change the "setup.ini" file from the Files and Folders page.

2. In the Search page a File Search for "CeAppMgr.exe" is defined specifying a registry value as its location.

3. In the Files and Folders page, the CAB package and the INI file (which will be passed as parameter to "CeAppMgr.exe") are added. The INI file is added as imported, not regular file. The structure for the INI file is the one mentioned above. As specified, you do not need to change any of its keys - just change the Property values in the Install Parameters page.

4. In the Custom Actions page a "Launch EXE with working directory" Custom Action is added which launches "CeAppMgr.exe" using the full path retrieved by the Search (CEAPPMGR Property). Notice how the "Full Path" and "Execution Condition" are set.

5. You can also create a Launch Condition in the Prerequisites page, "Custom Launch Conditions" tab making the setup application to quit if the "CeAppMgr.exe" file is not found (the user does not have ActiveSync installed).