This question has come up a number of times recently - You've built your Windows CE 5.0 operating system, you've written the worlds coolest Windows CE application in eMbedded Visual C++ or Visual Studio .NET 2003 and now want to include the applicaiton and a bunch of support files into the final operating system image - but how to make this happen ?

There are a number of steps needed to add a new file or application to the operating system.

First, the file(s) need to be in your _FLATRELEASEDIR, this is the build release directory - typically C:\Wince500\PBWorkspaces\<Your_Workspace>\RelDir\ - you would normally expect to find a Debug and Release subfolder here - so you need some way to copy your files into this folder.

Second, you *may* have registry information associated with your application or driver, so you need to be able to add your own .REG file or modify the existing project.reg

Next, you might want to have specific O/S dependencies for your application - what if your application is a C# .NET Compact Framework application, in this case you would want to set dependencies on SYSGEN_DOTNET - and possibly other O/S dependencies - you could add these dependencies through the Platform | Setitngs menu option, but this would set the dependencies for this build of the O/S - if you generate another platform that also included this application then you would also need to remember to set the environment variables for the new platform.

And what about setting the startup location of the application - by default all application binaries for the O/S are in the \windows folder, you might want to auto-start your application at boot time, in this case you can either add a [HKLM\Init] key to the registry or map the application to the \Windows\Startup folder - and this needs modifications to a .DAT file.

So, right now you need to modify .BIB, .REG, .DAT files, set SYSGEN dependencies through Platform | Settings, and also somehow copy your applicaiton and support files to the _FLATRELEASEDIR - sounds like a ton of work to accomplish what would appear to be a simple task, right ?

Wouldn't it be SO much easier to have an 'atomic' stand-alone component that contained it's own BIB, REG, DAT, DB files, that also contained the set of O/S dependencies needed on the O/S, and lived in the catalog so it was portable between operating system platforms ? (and could be shared with other developers). You Bet !

As mentioned earlier, I had a number of questions about adding an application to a Windows CE 5.0 O/S image that I decided to write an FAQ around this process - I got about 30 minutes into the process and then decided to give up ! - Was this because I'd not had my Grande Vanilla Latte for the day ? - no, it's because I decided the best way to do would be to create a tool that makes this process simple.

Introducing CEFileWiz - a "Skunk" development project that will hopefully save you a ton of time when adding files or applications to a Windows CE 5.0 O/S image.

Here's how the UI looks...

Simply add your files (notice how the application will automatically show the files/applications in FILES or MODULES sections) - Also note how, when you add a .NET Compact Framework application that the application is added to the FILES section - this is needed for the .NET Compact Framework application to run correctly on the Windows CE device.

That's the files added to the "component" - what about setting dependencies on the O/S ? - simple, click the "Add SYSGEN's" button and start adding SYSGEN variables - what ? - you don't know what the SYSGEN is that you need ? - go take a look at the catalog in Platform Builder - right click on a component and hit the SYSGEN tab - here's the SYSGEN information for the .NET Compact Framework

The CEFileWiz application detects that an application is .NET Compact Framework and automatically adds the appropriate SYSGEN's to the project, like so - you can see that SYSGEN_DOTNET, DOTNET_SUPPORT, and VS_SD_AUTH (the Visual Studio .NET 2003 Smart Device Authentication Utilities) have all been added to the project - you can also add your own SYSGEN's to the project, for example adding SYSGEN_HTTPD would add the HTTP Web Server to your O/S image.

So, that leaves three items to complete.

Component Name - This is the, errr, ummm, name of the component as you want it to appear in the Windows CE 5.0 Catalog.

Platform - Select the Windows CE 5.0 Platform you want to add this project folder to

Device Folder - Where you want the files to be mapped in the O/S image (by default this is the \Windows folder) - if you want your application in the \Windows\Startup Folder then simply change the text to be \Windows\Startup - the project will create any folders that don't exist in the O/S image.

and now, hit Build... That's it ! - your component is now created... Here's how the output folder looks.

Notice the list of files that have been created in the output folder.

Foo.bib - the files to be added to the O/S image
Foo.cec - the .CEC file to be added to Platform Builder
Foo.dat - Folders to be created in the O/S
Foo.db - Database (normally empty)
Foo.pbpxml - the workspace file (pointed to by the .CEC file)
Foo.reg - the registry file (add your custom registry information here)
makefile - Makefile
postlink.bat - This batch file is called in the build process and copies all the files in this component to the _FLATRELEASEDIR
prelink.bat - Empty (dummy) batch file
projsysgen.bat - the projsysgen.bat file adds the O/S dependencies to the O/S (through the SYSGEN variables)
readme.txt - a list of what's been added to this component.
sources - makefile for the component

All we need to do now is add the .CEC file that's been created to Platform Builder - in Platform builder, go to File | Manage Catalog Items, add the .CEC file you've just created, then, under Third Party Components either drag your new component over to your platform workspace or right click and "add".

Now build your platform - that's it ! - A couple of clicks, add some dependency information and you're all set to have a stand-alone component that exposes it's own set of registry information, folders, BIB, etc...

Let me know if this tool is at all useful...

- Mike