Packaging and deployment of PDA smart device Solutions

Source: Internet
Author: User
Walkthrough: Package smart device solutions for deployment Visual Studio 2008 This walkthrough demonstrates how to use Visual Studio to apply Program And its resources are packaged into a cab file so that they can be deployed on the smart device of the end user.
Note:

For some Visual Studio user interface elements used in the following instructions, your computer may display different names or locations. These elements depend on your Visual Studio version and settings. For more information, seeVisual Studio settings.

In this walkthrough, you can start with any smart device solution written in Visual Basic, Visual C #, or visual C ++. For more information, seeWalkthrough: Create a Windows form application for the device.

This walkthrough demonstrates how to perform the following operations:

    • Add a cab project to the solution.

    • Change the product name.

    • Change the output path.

    • Fill in the cab file with the main output of the application.

    • Add a dependency if needed.

    • The shortcut for creating an application.

    • Move this shortcut to the Start Menu or Programs folder.

    • Modify the registry key.

Prerequisites

An existing smart device solution. For this walkthrough, consider creating and generating a simple project, for example,Walkthrough: Create a Windows form application for the deviceProject.

Install the cab Project

Add a smart device cab project for the solution
    1. Open an existing smart device project and make sure thatSolution Resource Manager"Visible.

    2. In"File"Point"Add"And then click"Create a Project".

      Appears"Add new project"Dialog box.

    3. In"Project type"In the pane, expand"Other project type"And then click"Installation and deployment".

    4. In"Template"In the pane, click"Smart device cab Project".

      This is the only cab project type that can be used for smart devices. Other project types are only used for desktop solutions.

    5. In"Name"Box, typeCabprojectAnd then click"OK".

      The cab project is added to the solution and displayed inSolution Resource Manager". Show now"File System Editor".

Custom cab Project

Change product name and other project properties
  1. InSolution Resource Manager"Click"Cabproject"(If not selected ).

  2. In"View"Click"Property Window", Or open"Attribute"Window.

  3. In the attribute grid"Productname"Field, change the value"Myproduct".

    "Productname"The attribute value determines the folder name and"Add or delete programs"The name displayed in the dialog box.

    • You can also use this window to change the manufacturer name and specify the minimum and maximum versions of the operating system.

    • You can set"Osversionmin"Set the property to 4.21 to indicate that your Pocket PC application has the screen orientation awareness function. However, setting this attribute to 4.21 will prevent applications from being installed on Windows Mobile 2003 or earlier Pocket PCs. To allow installation on such devices and notify newer devices that the program has the screen orientation function, you must manually modify the. inf file"Buildmax"Attribute is set to one of the following values:

      0xa0000000, indicating that the application supports a square screen (240x240 pixels)

      0xc0000000, indicating that the application supports screen Rotation

      -Or-

      0xe0000000 indicates that the application supports square screen and screen rotation.

      For more information, seeArticleDeveloping screen orientation-aware applications (development of applications that recognize the screen direction ).

    • For Pocket PC solutions based on Windows Mobile 2003 se and earlier,"Compress"Attributes and"Nouninstall device deployment"The property must be false. Note that for devices with Compact Framework 2.0, this option can be setTrue. For more information, see"Smart device cab project"-> "properties" Window.

    • If you are using Windows CE Installer DLL, you can use this attribute grid to specify the file name and location. For more information about Windows CE Installer DLL, see the Pocket PC or smartphone SDK documentation.

Change the name of the cab file and add Authentication
    1. InSolution Resource Manager"Right-click"Cabproject"And then click"Attribute".

      The"Property page"Dialog box. In"Output file name"Box, change the name and path of the cab fileDebug \ MyApp. CabAnd then click"OK".

    2. You can also use this property page to add authentication for the project. Authentication is required for the smartphone solution, but authentication is not supported in Pocket PC solutions based on Windows Mobile 2003 se and earlier versions. For more information, seeSecurity in device Projects.

Add a device project application to the cab Project
    1. In the left pane of File System Editor , click "application folder" to specify that the files selected in subsequent steps will be installed in this folder on the target device.

      if you cannot see "File System Editor" , right-click the cab project name in Solution Explorer , click View , and then click File System .

    2. On the "operations" menu in Visual Studio, point to "add" , click "project output" .

    3. In the Add project output group dialog box, select your smart device project from the project drop-down list.

    4. select "main output" from the output list, click OK .

 Note:

When creating a smart device cab project for applications written in C ++, If You Want To dynamically link to atl90.dll and mfc90u. DLL and/or msvcr. DLL and other dependencies, you must manually add these DLL to the cab project. However, we strongly recommend that you use static links to reduce the dependencies of the MFC/atl dll. If static links are used, you do not need to re-release the DLL along with the application. If dynamic links are used and the DLL must be redistributed in the cab, do not install these dll in the system directory (such as \ Windows) on the device, instead, install these DLL files in the local application directory. If you resend the application suite and all of the applications are dynamically linked to the ATL/mfc runtime, all applications and runtime dll should be installed in the same application directory, and provides shortcuts to these applications (these shortcuts can be placed in their respective folders ). This saves some space and avoids the risk of damaging the applications that dynamically link to these DLL due to the replacement of the dll in the system directory.

Add dependencies to the cab Project (C ++ projects only)
  1. InSolution Resource Manager"Right-click the cab project name and point"Add"And then click"File".

  2. GoVisual Studio installation folder\ Vc \ ce \ dll \Platform.

  3. Select the file to add.

    • For an MFC project, press Ctrl and then click mfc90u. dll, atl90.dll, and msvcr90.dll. If your application requires language-specific MFC Resources, you may have to click one or more language-specific DLL.

    • For the ATL Project, press Ctrl and then click atl90.dll and msvcr90.dll. If the ATL solution supports MFC, click mfc90u. dll.

    • For Win32 projects, click msvcr90.dll.

  4. In"Add file"In the dialog box, click"Open"To add the file to the cab project.

  5. In"File System Editor"Right-click"File System on the target computer".

  6. Click"Add special folder"And then click"Windows folder".

  7. In"File System Editor"In the left pane, click the folder that contains the main output. By default, dll has been added to the same folder as the main output. To move these DLL files to the Windows folder, go"File System Editor"Select these files in the middle pane, and drag them"Windows folder"Icon.

  8. Add other Dependencies required by the solution using the same process. You can add dependencies to any folder. You do not need to add them"Windows"Folder.

Create shortcuts for device project applications
    1. In"File System Editor"In the right pane, select"Main output of <Application Project Name>".

    2. In"Operation"Click"Create a shortcut for the master output of <Application Project Name>".

      This command will be"Output"Add"Shortcut".

    3. Right-click"Shortcut"Item, click"RENAME"And then rename the shortcut to the name suitable for the shortcut.

Move this shortcut to the Start Menu or Programs folder.
    1. In"File System Editor"Right-click"File System on the target computer", Pointing"Add special folder"And then click"Start Menu folder"Or"Programs folder".

    2. From"Application folder"Drag"Start Menu folder"Or"Programs folder".

Add registry key
    1. InSolution Resource Manager"Click the cab project.

    2. In"View"Point"Editor"And then click"Registry".

    3. InRegistry Editor", Right-click HKEY_CURRENT_USER, and then click"New item".

    4. WhenRegistry Editor"Show"New item"Item, rename it"Software".

    5. Right-click the new item and point"New"And then click"Item".

    6. WhenRegistry Editor"Show"New item"Item, rename it"Mycompany".

    7. Right-click"Mycompany"Item, and then click"Property Window".

      "Name"The value has been changed"Mycompany".

Generate and deploy the cab file

Generate a cab file
    1. In"Generate"Click"Generate cabproject".

      -Or-

      InSolution Resource Manager"Right-click"Cabproject"And then click"Generate".

    2. In"File"Click"Save all".

      The cab file of the smartphone solution must be digitally signed before being deployed to the end user's device. The Pocket PC Solution Based on Windows Mobile 2003 se and earlier does not support digital signatures. For more information, seeHow to: sign the cab file (device).

Deploy the cab file on the device
    1. In"Windows Resource Manager"Find the folder that stores this solution. You can find this cab file in the "cabproject \ release" folder of the solution.

    2. Copy the cab file to the device that is connected using ActiveSync 4.0 or later.

      When the user is on a device"Resource Manager"When you click the cab file name, Windows CE unlocks the cab and installs the application on the device.

      For more information, see the smartphone and Pocket pc sdk documentation.

Reference to: http://msdn.microsoft.com/zh-cn/library/zcebx8f8 (V = vs.90). aspx

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.