setupexe.gif (7322 bytes)

This article explains how easy it is to turn your CE application or game into a professionally presented setup.exe program. 
This article was originally written in 2000 
and was updated in 2002 due to it's popularity

Assuming you have installed various packages onto your PocketPC or other CE device from your PC you will be aware that there is a PC based application capable of copying files over to CE and running a program installation. Although it's not obvious, you can actually use these same features together with utilities supplied by Microsoft and others to create your own program installations.

The simplest form of install is a straightforward manual copy using activesync. As soon as you go beyond a single app file this becomes unwieldy so what you really want to do is create a CAB file. You will be aware that M$ Windows  installations consist of various cab files. M$ provides a program as part of the CE development kit to create CAB files. This program is the CAB Wizard ( cabwiz.exe ). The wizard runs on a big PC and uses a .inf file you prepare to create a CAB. The output file can be used directly on a CE device to perform an installation or can be bundled up in a setup program to be run from a PC.

The main reason for using a CAB file on it's own is so that people can download straight onto their CE device. The CAB file is downloaded and when double clicked starts an installation on CE. Once installed the CAB file deletes itself. You can of course copy a CAB manually from PC to Pocket PC and run the install.

Firstly a few words about CuteInstall. It's a nice easy to use install program for simple applications. There's not much support from the author ( none really in my experience) but it's a point & click install creator which does all the work of creating the .inf & cab files and turns out a very pretty installation program. The main problem is that it does not work in all situations ( eg: it does not handle multiple source directories ).

The advice I was given was to forget CuteInstall & create my own .inf file manually for use with the Wizard. A very complex .inf with lots of files in it takes less that 1 hour to create so this seems like good advice.

.inf file creation

Using a regular text editor you create a file which defines all your source components and all the CE setups required. There are sections to handle your application, help file/s support files, registry entries and shortcut menu entry. A very simple .inf file is reproduced below and a detailed listing of Microsoft assistance on .inf files is available by clicking on this link
  MSDN CAB file Information

In the following example the green text is the actual inf file. Text in white are my comments yel.gif (847 bytes)

;==================================================
; sample.inf
;==================================================

[Version]

Signature = "$Windows NT$"
always the same, don't change
Provider = "FreeForAll_Software"
your company name
CESignature = "$Windows CE$"

[CEStrings]

AppName = "MyGame"
name of your program
InstallDir = %CE1%\%AppName%
where your applet goes

[Strings]

;==================================================

[DefaultInstall]

CopyFiles = Exefiles, Helpfiles, Bmpfiles, Wavfiles
CEShortcuts = Startmenu
Addreg = Regkeys

;==================================================

[SourceDisksNames]

1 =, "Common Files",, C:\install
first source directory location
2 =, "graphics",,C:\install\images
second source directory location
You can have as many source directories as you want
[SourceDisksFiles]

mygame.exe = 1
files in source dir 1
database.txt = 1
mygame.htp = 1
splash.bmp = 2
files in source dir 2
logo.bmp = 2

;==================================================

; Ouput directories for files & shortcuts

[DestinationDirs]

Exefiles = 0, %InstallDir%
where label Exefiles points to on CE
Bmpfiles = 0, %InstallDir%\images
where label Bmpfiles points to on CE
Helpfiles = 0, %CE2%
where label Helpfiles points to on CE
Startmenu = 0,  %CE11%
DefaultDestDir = 0, %InstallDir%


[Exefiles]

"mygame.exe"
names of files which go to Exefiles
"database.txt"

[Bmpfiles]

"splash.bmp"
names of files which go to Bmpfiles
"logo.bmp"

[Helpfiles]

"mygame.htp"
names of help files which go to /windows

[Startmenu]

"My Game", 0, "mygame.exe"
start menu entry ( if any )

[Regkeys]
registry keys if there were any

Each of the sections above is explained fully in the M$ Docs. It's pretty clear though that all that's needed to get a valid .inf file is to follow the layout shown. You can group your source files together in one or more PC folders and define where these files go on the CE machine. Note that various strings such as %CE1% are substituded with actual folder names during the install. Examples are

%CE1% = \Program Files    and %CE2% = \Windows

Running CABWIZ.exe

You need to have the cab wizard files contained in the zip file all in the same folder ( cabwiz.exe cabwiz.ddf & makecab.exe )

Once your .inf file is ready run the cabwiz.exe file with your .inf file eg:
C:\install\Cabwiz.exe myprogram.inf

Note: I suggest creating a shortcut to cabwiz.exe with the inf file as a parameter in the run line. This makes it easier to re-run after fixing all those mistakes you will make in the .inf

The output from cabwiz.exe will be a file called 'myprogram'.cab which is a fully functional Pocket PC install file. Why stop there, you can now use the cab file with EZSetup to create a setup.exe, but there's a catch: You need XP, NT or Windows 2000 to run it. Sorry but the program just does not work on Win 98 & Win95. The good news is that the setup.exe file it creates does work on all Windows PC operating systems.

The inputs to EZSetup are your cab file, a readme file and a license file plus a small .ini file which you need to create for the purpose. Here is a sample .ini file yel.gif (847 bytes)
[CEAppManager]
Version = 1.0      
don't change this version number !
Component = myprogram

[MyApplet]
Description = myprogram
CabFiles = Myprogram.CAB

The command line for EZetup.exe looks something like this yel.gif (847 bytes)
ezsetup -i myprogram.ini -r readme.txt -e eula.txt -o setup.exe
The parameters are -i ini file -r readme -e end use license agreement and -o output name for your setup program.

The readme and license file are incorporated into text windows in the setup program so you can put really important info here for the user to read. Note that EZinstall is a freeware program from Scott Ludwig and he has also made the source code available to anyone who wants it.

Note: It is also possible to create a .ini file for use with the activesync application installer. Some Information on this feature is contained in the cab file information linked above and more can be found in the msdn docs.

The cabwiz.exe, cabwiz.ddf & makecab.exe are available as a downloadable zip file here yel.gif (847 bytes)

cabwiz.gif (677 bytes)

EZSetup is available from Scott Ludwig's site yel.gif (847 bytes)

EZSetup

CuteInstall is available from the link opposite yel.gif (847 bytes)

CuteInstall

This article is the work of Ian Ferguson and is copyright SundialSoft 2002. 
No part of this work may be reproduced in any other form without prior consent from the author.
Thanks to Guy Sprackland for his assistance wih this subject!