Share via


Deploy an Application in a CAB File by Using ActiveSync (Windows Embedded Compact 7)

On a device that runs Windows Embedded Compact 7, you can deploy an application in several ways. This article shows you how to use ActiveSync to deploy a CAB file from your development computer to your device by using a USB connection. With ActiveSync, you can transfer your application to a device without using Visual Studio or Platform Builder. By using a CAB file, which contains your application and its installation settings, you can customize installation by specifying registry settings, creating a shortcut on the desktop, and so on. However, if you want to debug your application, you need to use Visual Studio. For a description of one method that uses Visual Studio to deploy an application, see Debug an Application over Ethernet.

Important:
For hardware and software requirements that a device must meet to work with ActiveSync, see ActiveSync Requirements.

In this article:

Prerequisites and assumptions

Before you begin this procedure, verify that your setup meets the following audience, software, hardware, and network prerequisites.

  • Intended audience: Developers who have intermediate knowledge of Windows Embedded Compact. In this article, OEM refers to the OS designer. Application developer refers to a developer who did not design the OS, but who has been provided with a Windows Embedded Compact OS and an SDK with which to create applications for the OS.
  • Hardware/compatibility with ActiveSync: Your device has an Ethernet port and a USB port. (You could also use a serial connection, but this article describes how to do this task by using a USB connection.) For other important prerequisites, see ActiveSync Requirements.
  • Software: Your device runs Windows Embedded Compact 7. Your development computer has Visual Studio 2008 installed.
  • Windows Embedded Compact OS configuration: Your Windows Embedded Compact 7 OS is configured to support ActiveSync, CAB file installation, a console window, a USB drive, and a LAN connection. If you are an OEM, for information about how to configure your Windows Embedded Compact 7 OS, see Developing an Operating System Design.
  • Platform Builder settings: Your Windows Embedded Compact 7 OS does not have the kernel-independent transport layer (KITL) or the kernel debugger enabled. To disable KITL and the kernel debugger in the OS image, see How to Keep the OS Functioning When Disconnecting from Platform Builder.
  • Application is standalone: Your application is a stand-alone Visual Studio solution; it is not a subproject of an OS design solution in Platform Builder. You based your application on an SDK for the Windows Embedded Compact OS that is running on your device.
  • Network: Your development computer and your device are connected to the same LAN.
  • Setup: You created and built your application in Visual Studio and you have started the OS on your device. If you are an OEM and you downloaded the OS onto your device by using Platform Builder, make sure you detached Platform Builder after you downloaded the OS. If the OS does not operate correctly after you detached your device, KITL or the kernel debugger might be enabled in the OS. For more information, see How to Keep the OS Functioning When Disconnecting from Platform Builder.

Step 1: Package your application in a CAB file

You can package your application in a CAB file when you want to customize installation. Customizations could include installing the application to a specific directory, placing a shortcut on the desktop or on the Start menu, configuring registry settings, including other files such as DLLs, and so on. Windows Embedded Compact 7 supports CAB file installation if the OEM includes this support in the OS design. 

To package your application in a CAB file, you need to create an INF configuration file and then execute the CAB wizard (cabwiz.exe) by using the INF file as an input parameter. Optionally, you can include a Setup.dll file to perform actions before and after installation, but we do not use one in this article.

You can create a CAB file using the GUI in Visual Studio. To do this, in the New Project dialog box, in the Other Project Types section, click Setup and Deployment, and then click CAB Project. However, this article assumes you will simply run the CAB wizard at a command prompt. For OEMs who have Windows Embedded Compact installed on their development computer, Cabwiz.exe is located at %_WINCEROOT%\Public\Common\Oak\Bin\I386\ Application developers will find it at <Microsoft Visual Studio Directory>\SmartDevices\SDK\SDKTools.

To package your application in a CAB file

  1. Create and edit an INF file using a simple text editor. For what to include in the INF file, see CAB Wizard in the Windows Embedded Compact 7 reference documentation. Information (.inf) File Overview provides a sample INF file that you can use with little modification for a simple installation.
  2. At the command prompt, type cabwiz <Your INF File> to create the CAB file.

Step 2: Install ActiveSync on your development computer

You must install ActiveSync on your development computer and on your device. If you are an OEM, you should have included support for ActiveSync in the OS design by selecting the ActiveSync catalog item (SYSGEN_AS_BASE). If you are an application developer, the OS provided to you by the OEM must include support for ActiveSync for you to continue with this deployment method. If you are not sure if ActiveSync is supported by the OS, look for the ActiveSync shortcut on the home screen of your device running the OS, or for ActiveSync as an option by clicking the Start button, and then Programs.Before you connect your development computer to the device with a USB cable, install ActiveSync on your development computer:

Note:
The remainder of this article documents ActiveSync as it is installed in Windows Mobile Device Center.
Important:
If you do not install ActiveSync or Windows Mobile Device Center before you attach the USB cable, you can cause incorrect drivers to be installed on your development computer.

Step 3: Connect your development computer to your device

Using a USB cable, connect a USB port on your development computer to a USB port on your device. (Although this procedure documents the steps for a USB port, you can also use ActiveSync over a serial connection.)

Step 4: Transfer the CAB file to your device

When you connect a USB port on your development computer to a USB port on your device, your development computer automatically launches the ActiveSync application (on Windows XP) or Windows Mobile Device Center (on Windows Vista or Windows 7).

Windows Mobile Device Center displays a Connected notification when your development computer successfully connects to your device. After a connection is established, do the following in Windows Mobile Device Center on your development computer to browse the files on your device.

To transfer the CAB file to your device

  1. If Windows Mobile Device Center prompts you to register, click Don't Register.
  2. Click Connect without setting up your device.
  3. Click File Management.
  4. Click Browse the contents of your device. A Windows Explorer window opens and displays the contents of your device.
  5. Using Windows Explorer, copy the CAB file from your development computer to a folder on your device.

Step 5: Install your application on your device

After the CAB file is on your device, you need to open it on the device itself (not in Windows Explorer on your development computer using ActiveSync). To launch the CAB installer, double-click the CAB file. Alternatively, you can use the command-line program Wceload to open the CAB file. For more information about Wceload, see Wceload Tool in the Windows Embedded Compact 7 reference documentation.

To open a CAB file by using Wceload

  1. On your device, click the Start button, then click Programs, and then click Command Prompt.
  2. At the command prompt, type wceload <Your CAB file> to install your application.
  3. Verify that your application is installed on your device by looking for it in the location you specified when you created your INF file. 

You can now run your application on your device.


Community Resources

Windows Embedded Compact

Windows Embedded Compact 7 Reference Documentation

See Also

Windows Embedded Compact on the TechNet Wiki