Feb 4 2010

Windows Phone Deployment Patterns - Part 0 of n

Category: MobileJoel Ivory Johnson @ 17:29

I come from a C++ (and now C#) background. In both languages the index of the first item in a list is zero, so I like to stay consistent to that when working with other list (including blog post). In this series of blog post I'll be walking through different solutions for deployment scenarios for Windows Phones. This first solution is the "Hello World" of deployments. It will get your files copied to the programs folder and will create an icon in your start menu. I'll be ignoring all of the other considerations that one might give for a deployment such as including prerequisites, performing custom actions, or setting up the PNG icon for Windows Mobile 6.5.

Let's say that you've already written your Windows Phone program and want to get it packaged into a deployment. You first need to add a new deployment project to your solution.  Right-click on the project and select "Add New"->"Project". In your new projct dialog ind the "Setup and Deployment" category and the "Smart Device CAB Project" project type. Double-check tomake sure you'veselected the "Smart Device Cab Project" and not the "CAB Project." Type in a name for your project ad click on "OK."

 Once the project is created you can begin adding your files to it. Firt let's add te project that contains your application code to the project. right-click on your deploymnt project and select "Add"->"Project Output." In the dialog that appears make sure the name of the project that contains your codeis selected from the top drop-down. Select "Primary Output" and "Content Files" from the listbox and select "OK". Right-click on the deployment project again and select "View"->"File System." You will not be able to select where on the device's file system that your program will be installed.

The File System's view contains two folders:"Application Folder" and "Programs Folder." Hightlight and erase the "Programs Folder." We won't be using it for this walkthrough.  When you select the "Application Folder" you'll see that your program and it's resources are referenced. Right-click on the Primary Output item and select "Create Shortcut to Primary Output." A shortcut will be create with its name highlighted. Enter in a name for the shortcut.  Now you need to ensure that the shortcut will show up in the user's start menu.

In the file system editor right-click on "File System on Target Machine" and select "Add Special Folder"->"Start Menu Folder." Once the Smart Menu Folder is selected go back to the "Primary Output" foler. Click-and-drag the shortcut you made in the earlier steps into this folder.  Once you've done that if you right-click on the deployment  project nd select "Rebuild" it will produce a cab that you can use to share and install applications.

That is all that is required for a simple deployment. The next time I post on this topic I'll go through a more complex deployment scenario.

 

Tags: ,

Comments

1.
trackback J2i.Net says:

Windows Phone Deployment Patterns Part 1 of n

Windows Phone Deployment Patterns Part 1 of n

Comments are closed