Windows Phone Deployment Patterns - Part 0 of n





0/5 (0 vote)
In this series of blog posts, I'll be walking through different solutions for deployment scenarios for Windows Phones.
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 lists (including blog posts). In this series of blog posts, 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 project dialog in the "Setup and Deployment" category and the "Smart Device CAB Project" project type, double-check to make sure you've selected the "Smart Device Cab Project" and not the "CAB Project." Type in a name for your project and click on "OK."
Once the project is created, you can begin adding your files to it. First let's add the project that contains your application code to the project. Right-click on your deployment project and select "Add"->"Project Output." In the dialog that appears, make sure the name of the project that contains your code is 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 your program will be installed.
The File System's view contains two folders: "Application Folder" and "Programs Folder." Highlight 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 its resources are referenced. Right-click on the Primary Output item and select "Create Shortcut to Primary Output." A shortcut will be created 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" folder. 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 and 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.