Deploying your applications to the Windows platform
There are a number of options for distributing your Windows based mobile application. This topic will look at three distribution methods (xcopy, ClickOnce and windows installer), providing an overview and information relevant to mobile applications deployment. For more in depth information on these deployment methods you should read the MSDN topic Deploying .NET Framework applications.
xcopy
The xcopy deployment method simply involves copying the application executable, the mobile SDK libraries and any other dependant files to a target directory on the target Windows based machine. The application is then run from the target directory. You must ensure the .NET 3.5 SP1 Framework is installed on the machine.
The other deployment methods are in reality smarter and more user friendly versions of the xcopy deployment and are recommended for enterprise environments where you have to install on a large number of machines.
ClickOnce
ClickOnce is a new deployment technology provided with the .NET Framework. It offers many advantages over the traditional windows installer including a choice of deploying mechanisms (web, file or media based), incremental updates and greater security. Visual Studio provides full support for publishing and updating applications deployed with ClickOnce. Like windows installer, ClickOnce creates a setup executable that the user runs via a web page or file location which in turn installs the application.
There are two requirements when creating Windows based Mobile SDK applications with ClickOnce. First, the applications must be granted full trust permissions. Second, you should sign the ClickOnce manifest with an appropriate certificate. During development, a temporary certificate is generated and assigned. However, for release applications you should obtain an appropriate certificate. The MSDN help topic referenced above contains more details on these requirements.
The following steps show you how to setup and publish a Windows based mobile application to a disk path via ClickOnce.
- Open your windows based mobile project in Visual Studio.
- Display the project properties for your application.
- In the Security Tab, check Enable ClickOnce Security Settings and set to This is a full trust application.
- Select the Publishing Tab.
- Enter a Publishing Folder Location file path. If you wish other to install from this location, this should be a shared path.
- For Install Mode and Settings, select The Application is available offline as well.
- Click Application Files and verify the required files are included.
- Click Prerequisites. Check all applicable prerequisite packages for your application. You can include a check for the .NET Framework.
- Click Options. Enter a Publisher name and Product name. These are used to create the program name under the start menu when installed.
- Click Publish Now to publish the application to the disk path.
Navigate to the published disk path and run the setup.exe file located there. This will install the application on your machine. You can run the application via the Windows Start > Programs menu item. Uninstall the application via Windows Add/Remove Programs.
Windows installer
The Windows installer allows you to create a deployment package consisting of a setup executable and supporting files. These are distributed to the user who then runs the executable and installs the application via a wizard. The deployment package is created via a setup project within Visual Studio.
The windows installer has no prerequisites other than those mentioned in the title page. You include the executable, the Mobile SDK libraries and any supporting files in your setup package.
The following steps show you how to create a deployment package for a Windows based mobile application using the windows installer.
- Open your windows based mobile project in Visual Studio.
- Right-click on your solution in the Solution Explorer . Click Add then New Project.
- In the Add New Project dialog box, in the Project Types pane, open the Other Project Types node, click Setup and Deployment Projects, then click Setup Wizard in the Templates pane.
- Click OK to close the dialog box. The Setup Wizard dialog box opens.
- Click Next when you have read the introduction screen.
- On the Choose Project Type panel, select Create a setup for a Windows application and click Next.
- On the Choose project outputs to include panel, check Primary output from... and click Next.
- On the Choose files to include panel, click Add, then navigate to the bin output directory for your compiled application. Select the native windows mobile library (ESRIMobile92.dll) and click Open. The file is added to the panel. Click Next.
- Review the Create Project panel and click Finish. The setup project is added to your solution.
- Examine the properties for the setup project. The Manufacturer and ProductName properties determine the program files menu and submenu items when the application is installed. Change these to meet your requirements.
- Build the solution, click Build > Build Solution.
The deployment package can be found under setup project output directory and usually consists of a setup.exe and setup.msi files. To install the application on this computer you can simply run the setup.exe file. These files can be deployed to other computers via shared directories or media.
Included with the ArcGIS Mobile SDK is a sample for deploying your own ArcGIS Mobile based application on the Windows platform. The Windows sample will build a MSI installer that includes a sample application and the ArcGIS Mobile runtime required to run ArcGIS Mobile based application on Windows platform. The instructions on how to build and use the sample are included in the SDK.