Using the newly created project, you can now add the various components and files that you have been building in the past few sections. Right-click on the RSSReaderSetup
project in Solution Explorer, and select Add→File (see Figure 18-39).
Figure 18-39
Add the following files (see Figure 18-40):
□ SmartDeviceCab1\Release\RSSReader.CAB
□ RSSReaderInstaller\bin\Release\RSSReaderInstaller.dll
□ RSSReaderInstaller\setup.ini
Figure 18-40
These three files will be copied to the user's computer during the installation.
The next step is to configure the MSI installer to perform some custom actions during the installation stage. Right-click the RSSReaderSetup
project in Solution Explorer, and select View→Custom Actions (see Figure 18-41).
Figure 18-41
The Custom Actions tab displays. Right-click on Custom Actions, and select Add Custom Action (see Figure 18-42).
Figure 18-42
Select Application Folder, select the RSSReaderInstall.dll
file (see Figure 18-43), and click OK.
Figure 18-43
The Custom Actions tab should now look like Figure 18-44.
Figure 18-44
Set the various properties of the RSSReaderSetup
project as shown in the following table (see Figure 18-45).
Property |
Value |
Author |
Wei-Meng Lee |
Manufacturer |
Developer Learning Solutions |
ProductName |
RSSReader |
Figure 18-45
The last step is to build the project. Right-click on the RSSReaderSetup
project in Solution Explorer, and select Build.
The MSI installer is now in the \Release
subfolder of the folder containing the RSSReaderSetup
project (see Figure 18-46).
Figure 18-46
Testing the Setup
To test the MSI installer, ensure that your emulator (or real device) is connected to ActiveSync. Doubleclick the RSSReaderSetup.msi
application, and the installation process begins (see Figure 18-47).
Figure 18-47
Follow the instructions on the dialog. At the end, an Application Downloading Complete message displays (see Figure 18-48).
Figure 18-48
Check your emulator (or real device) to verify that the application is successfully installed (see Figure 18-49).
Figure 18-49
To uninstall the application, double-click the RSSReaderSetup.msi
application again. This time, you see the dialog shown in Figure 18-50.
Figure 18-50
If you choose to remove the application, the Windows CE Application Manager displays the list of programs that you have installed through ActiveSync (see Figure 18-51). To uninstall the RSS Reader application, uncheck the application and click OK. The application is removed.
Figure 18-51
Installing the Prerequisites — .NET Compact Framework 3.5
One problem you will likely face when deploying your application to real devices is that the target device does not have the required version of the .NET Compact Framework (version 3.5 is needed). Hence, you need to ensure that the user has a means to install the right version of the .NET Compact Framework. There are two ways of doing this:
□ Distribute a copy of the .NET Compact Framework 3.5 Redistributable to your client. You can download a copy from http://microsoft.com/downloads. Users can install the .NET Compact Framework before or after installing your application. This is the easiest approach, but requires the user to perform the extra step of installing the .NET Compact Framework.
□ Programmatically install the .NET Compact Framework during installation, using the custom installer. Earlier, you saw how you can invoke the Windows CE Application Manager from within the custom installer class by using the .ini
file. In this case, you simply need to create another .ini file, this time to install the CAB file containing the .NET Compact Framework. The various CAB files for the .NET Compact Framework 3.5 can be found on your local drive in the following directory: C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE
. Figure 18-52 shows the various CAB files for each processor type (ARM, MIPS, SH4, X86, and so on). To install the .NET Compact Framework 3.5 on Windows Mobile 6 Standard devices, you just need to add the NETCFv35.wm.armv4i.cab
file to the RSSReaderInstaller
project, together with its associated .ini
file.
Figure 18-52
This chapter explored developing applications for the Windows Mobile 6 platform, using the .NET Compact Framework. Using that framework, you can leverage your familiarity with the .NET Framework to develop compelling mobile applications. The RSS application is an example of a useful application that you can use on a daily basis. The chapter also explained how to package an application into a CAB file and then into a MSI package so that you can distribute it to your users easily.
Chapter 19
Developing Silverlight Applications
Over the years, we have all seen the proliferation of web applications. In the early days, web sites consisted of sets of static HTML pages with nice graphics and lots of information. Then, server- side technologies like CGI, ASP, and JSP made web applications possible, and suddenly users could do a lot of things on the web, including buying products and making reservations online. Client-side innovations such as JavaScript helped improve the user experience of web applications, making them feel much more responsive. Although AJAX's underlying technologies had been available for several years, it wasn't really until the last couple of years that people really started spending more time AJAX-enabling their web applications. All this boils down to one important goal of web developers — making web applications much more interactive and responsive.
Читать дальше