Книга: C# 2008 Programmer

Creating a CAB File

Creating a CAB File

An easy way to package your Windows Mobile application is to create a CAB file so that you can transfer it onto the end user's device (using emails, web browser, memory card, and so on). The following steps show you how:

1. Add a new project to the current solution in Visual Studio 2008 (see Figure 18-21).


Figure 18-21

2. Choose the Setup and Deployment project type, and select the Smart Device CAB Project template (see Figure 18-22). Use the default name of SmartDeviceCab1, and click OK.


Figure 18-22

3. In the File System tab, right-click on Application Folder, and select Add?Project Output (see Figure 18-23).


Figure 18-23

4. Select the RSSReader project, and click Primary output (see Figure 18-24). Click OK. This adds the output of the RSSReader project (which is your executable application) to the current project.


Figure 18-24 

5. Right-click on the output item shown on the right-side of the File System tab, and create a shortcut to it (see Figure 18-25). Name the shortcut RSSReader.


Figure 18-25

6. Right-click the File System on Target Machine item, and select Add Special Folder?Start Menu Folder (see Figure 18-26).


Figure 18-26

7. Drag and drop the RSSReader shortcut onto the newly added Start Menu Folder (see Figure 18-27). This ensures that when the CAB file is installed on the device, a shortcut named RSS Reader appears in the Start menu.


Figure 18-27

8. Right-click on the SmartDeviceCab1 project name in Solution Explorer, and select Properties. Change the Configuration from Debug to Release. Also, name the output file ReleaseRSSReader.cab (see Figure 18-28).


Figure 18-28 

9. In Visual Studio 2008, change the configuration from Debug to Release (see Figure 18-29).


Figure 18-29 

10. Finally, set the properties of the SmartDeviceCab1 project as shown in the following table (see Figure 18-30).

Property Value
Manufacturer Developer Learning Solutions
ProductName RSS Reader v1.0

Figure 18-30

That's it! Right-click on the SmartDeviceCab1 project name in Solution Explorer and select Build. You can find the CAB file located in the Release folder of the SmartDeviceCab1 project (see Figure 18-31).


Figure 18-31

Now you can distribute the CAB file to your customers using various media such as FTP, web hosting, email, and so on. When the user clicks on the RSSReader CAB file in File Explorer (on the device; see Figure 18-32), the application will ask if he wants to install it onto the device, or onto the storage card (if available).


Figure 18-32

When the application is installed, the RSS Reader shortcut is in the Start menu (see Figure 18-33).


Figure 18-33

Оглавление книги

Оглавление статьи/книги

Генерация: 1.106. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз