Wednesday 18 April 2007

Signing Windows Mobile Application Code using Miicrosoft Visual Studio 2005

This post deals with signing code against the Windows Mobile SDK developers certificates. If you have not already installed the SDK certificates on your device see this post. The first step is to install the SDK certificates on your development machine:

  • Navigate to C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 SDk\Tools
  • Double-click on the SDKSamplePrivDeveloper.pfx file
  • Press the "Next" button on the "Welcome to the Certificate Import Wizard" dialogue
  • Press the "Next" button on the "File to Import" dialogue
  • Press the "Next" button on the "Password" dialogue
  • Press the "Next" button on the "Certificate Store" dialogue
  • Press the "Finish" button on the "Completing the Certificate Import Wizard" dialogue
  • Press "Ok" on "Completed" dialogue
  • Repeat the process for the SDKSampleUnprovDeveoper.pfx file

Having installed the certificates you will now need to sign your CAB's, DLL's and EXE's against them. This is done as follows:

  • Open your Microsoft Visual Studio project solution
  • Select from the menu Project->Properties
  • Expand the "Configuration Properties" tree in the left-hand pane
  • Expand the "Authenticode Signing" in the "Configuration Properties" tree
  • Select "General"
  • In the right-hand pane change the "Authenticode Signature" selection to "Yes"
  • Select the "Certificate" field and press the "browse" ellipse to the left
  • Select the certificate you wish to sign against marked "TEST USE ONLY - Sample Privileged Root for Windows Mobile SDK" or "TEST USE ONLY - Sample UnPrivileged Root for Windows Mobile SDK" and hit OK
  • Select "OK" to properties dialogue

On your next build Visual Studio will now automatically sign your executable.

No comments: