Click here to Skip to main content
6,633,937 members and growing! (23,542 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Mobile Development » General     Intermediate

Automating the Installation of .NET Compact Framework applications

By Girish Nurani Sankaranarayanan

An article on automating the installation of .NET Compact Framework on Pocket PC devices.
C++, Windows, .NET CF, PocketPC 2002, Visual Studio, Dev
Posted:9 Aug 2003
Updated:31 Aug 2003
Views:54,416
Bookmarked:30 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
10 votes for this article.
Popularity: 2.30 Rating: 2.30 out of 5
3 votes, 30.0%
1
3 votes, 30.0%
2
2 votes, 20.0%
3
2 votes, 20.0%
4

5

Introduction

Currently when you install a .NET Compact Framework application in Pocket PC 2002 devices, you have to ascertain the hardware of the device, copy the .NET runtime and application cab files generated for that platform, execute those files. There is no utility like the Application Setup Wizard utility which we have in Embedded Visual tools. This article provides a solution to automate the installation of .NET Compact Framework applications without doing the above mentioned steps for installing .NET Compact Framework applications.

Before going in detail, let me give u an overview of the functionality of the Application Install wizard. It produces executables only for ARM and X86 platforms. The wizard takes the .ebp (EVB project file), .vb (file we get when we compile an EVB application), custom files to be included in the application like images, help files etc. as input. From the project file, it determines the COM objects and ActiveX controls used in the project and creates .cab files for ARM and X86 platforms, a setup.ini file and a setup.exe file. So all that we have to do is double click on the setup.exe file and your application is installed to device. How does the setup.exe identify the .cab files? - through setup.ini. Here is a template of setup.ini for your reference.

[General]
Component= Applicaton Name
Description=Application description
DefaultDirectory= Installation Directory (created under \program files) 
CabCount=Number of .cab files to process
Cab0=File1_PPC.ARM.cab
Cab1=File1_PPC.MIPS.cab
Cab1=File1_PPC.SH3.cab

The entries Component, Description, DefaultDirectory are self describing. The CabCount entry is set based on the number of platforms targeted and CabX entries where X is 1,2,3 and so on... will contain the names of the cab files for respective platforms. When you run the setup application, the application uses CEAppMgr.exe utility to ascertain the hardware platform and copy and install the cab file generated for that platform.

We can reuse the same setup.exe and setup.ini for deploying .NET Compact Framework applications. What we have to do is:

  • Generate the .cab files for the platforms through the build => build cab file option in Visual Studio .NET
  • Take the setup.exe and setup.ini generated by EVB application install wizard
  • Put the .cab files, setup.exe, setup.ini in a separate directory
  • Open the .ini file. Fill up the entries. Based on number of cab files generated for different platforms, set the CabCount and CabX entries where X can be 1,2,3.....so on.

The following listing is the setup.ini of the sample .NET Compact Framework application provided with this article:

[General]
Component=SampleApp
Description=SampleApp Build 1
DefaultDirectory=SampleApp
CabCount=6
Cab0=SampleApp_PPC.ARM.cab
Cab1=SampleApp_PPC.ARMV4.cab
Cab2=SampleApp_PPC.MIPS.cab
Cab3=SampleApp_PPC.SH3.cab
Cab4=SampleApp_PPC.WCE420X86.cab
Cab5=SampleApp_PPC.X86.cab

In this case cab files have been generated for 6 platforms. So CabCount is 6 and the CabX entries contain the names of the cab files for respective platforms. That's it. Your application is ready to be installed in the device.

Before that, if .NET compact framework runtime is not present in the device, your application cant run. The runtime libraries are distributed in the following files:

  • netcf.core.ppc3.xxx.cab
  • sql.ppc3.xxx.cab
  • sqlce.ppc3.xxx.cab
  • sqlce.dev.ppc3.xxx.cab

where xxx is the name of the platform like ARM, MIPS, SH3, x86, ARMv4, WCE4.x86. We may not need sqlce.dev.ppc3.xxx.cab for deployment as it is the SQLCE query analyzer application. To automate the installation of .NET compact framework runtime libraries the same set of steps described above can be used. For every library there will be one setup application. Currently I'm trying to write an application which will install all these libraries in a single go. When I finish that application, I will be sharing that with all of you guys.

Conclusion

This article discussed the automation of installation of .NET Compact Framework applications. There are still a lot of things we can do with application installation which I will discuss in future articles.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Girish Nurani Sankaranarayanan


Member

Occupation: Web Developer
Location: India India

Other popular Mobile Development articles:

  • Writing Your Own GPS Applications: Part 2
    In part two of the series, the author of "GPS.NET" teaches developers how to write GPS applications suitable for the real world by mastering GPS precision concepts. Source code includes a working NMEA interpreter and sample high-precision application in C# and VB.NET.
  • Writing Your Own GPS Applications: Part I
    What is it that GPS applications need to be good enough to use for in-car navigation? Also, how does the process of interpreting GPS data actually work? In this three-part series, I will cover both topics and give you the skills you need to write a commercial-grade GPS application.
  • Learn How to Find GPS Location on Any SmartPhone, and Then Make it Relevant
    A step by step tutorial for getting GPS from any SmartPhone, even without GPS built in, and then making location useful.
  • iPhone UI in Windows Mobile
    It's an interface that works with transparency effects. As a sample I used an interface just like the iPhone one. In this tutorial I am explaining how simple is working with transparency on Windows Mobile.
  • Pocket 1945 - A C# .NET CF Shooter
    An article on Pocket PC game development
Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 2 of 2 (Total in Forum: 2) (Refresh)FirstPrevNext
GeneralMy vote of 1 PinmemberMember 21913241:32 21 Jan '09  
GeneralAbout Windows Mobile Desktop Cab Installer Pinmemberpradeepsattikar1:20 31 Mar '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 31 Aug 2003
Editor: Smitha Vijayan
Copyright 2003 by Girish Nurani Sankaranarayanan
Everything else Copyright © CodeProject, 1999-2009
Web18 | Advertise on the Code Project