Tech Note 30:
Distributing your Application

April 30, 2009

© NSB Corporation. All rights reserved.

Overview

If you cannot use NS Basic's built in ability to create installers, creating proper installation procedures for Windows CE devices is not a simple task. NS Basic/CE programs need to use the some installation procedures as other applications. In this document, we'll try to make it as easy as possible for you.

The steps to creating an installer are as follows:

  1. Get the Installer files
  2. Create your .inf file
  3. Create your .ini file
  4. Compile them using cabwiz.exe (included in any Windows Mobile SDK from Microsoft)
  5. Package them using EZSetup.exe
  6. Test them.

Third Party Tools

There are some third party tools that can be used to help build installers.

How to create an installer from scratch

1. Get the Installer files

The installer files are in a folder named \installer the NS Basic/CE Release CD. After installing them on a device, you can copy them back onto your system into a directory that will be accessed by your installer.

2. Create your .inf file

The .inf file contains the information about the files to be installed on your CE device. It contains the pathnames where the files are to be found on your desktop, and where the files should be places on your CE device. Constructing this file properly is the most complex part of creating your installer.

Here is a sample .inf file:

Other resources:

  1. .inf File Format Documentation
  2. Microsoft's CabWiz documentation

3. Create your .ini file

The .ini file describes which CAB files are to be included in the installer. Here is a sample .ini file to create the runtime installer for Runtime.ppc.exe.

[CEAppManager]
Version = 1.0
Component = App

[App]
Description = App
CabFiles = App.WM.cab

4. Compile using cabwiz.exe

Cabwiz.exe is a program supplied by Microsoft. You can download it as part of any of the current Windows Mobile SDKs. It reads your .ini file and outputs one or more .CAB files. A CAB file is produced for each platform (WM, 2577, 4000 etc) and CPU type that you plan to support.

Here is a sample script to start Cabwiz.exe. Save this as a .bat file so you don't have to type it all in each time.

del *.CAB
cabwiz App.inf /err err.log /cpu WM /compress

5. Package them using EZSetup.exe

EZSetup.exe is a handy utility from Scott Ludwig. It uses your .ini file to get the list of .CAB files that Cabwiz.exe produced and makes a single compressed file out of them. EZSetup.exe should be in the current folder.

Here is a sample script to start EZSetup. Save this as a .bat file so you don't have to type it all in each time. You can combine this with the Cabwiz .bat file to build your installer with a single command.

ezsetup -i App.ini -r ReadMe.txt -e EULA.txt -o Project1.Installer.exe

6. A Script to do it all

del /Q App.Installer.exe App.WM.cab

cabwiz App.inf /err err.log /cpu WM /compress
copy "C:\Program Files\NSBasic\CE\ezsetup.exe" .

ezsetup -i App.ini -r ReadMe.txt -e EULA.txt -o Project1.Installer.exe

del /Q *.tmp *.DAT ezsetup.exe
move /Y App.WM.CAB Project1.Installer.cab

7. CECabMgr

submitted by Shimoe

I first bought WinCE CAB Manager from http://www.ocpsoftware.com/products.php?nm=cecabmgr It cost me $150, but it was cheap for me if considering analyzing the inf file.

  1. Installed Runtime.ppc.exe
  2. Copied all CAB files in "C:\Program Files\Microsoft ActiveSync\Runtime" to a folder.
  3. In WinCE CAB Manage, ADDed the program I developed.
  4. Referred to "Setup.ini" in "C:\Program Files\Microsoft ActiveSync\Runtime" and modified for my program.
  5. Used EzSetup.exe to create an installation program. Because EzSetup.exe in NS Basic's CD-ROM was English version, I downloaded EzSetup v2.1 Japanese from http://wince.tripod.co.jp/
It works on my iPAQ but I am not sure if it does on all devices. Here is the installation program that was created: http://www.sabot.co.jp/nstoday/downloads/NSTodaySetup.exe

8. Auto Installation

Certain Windows CE devices store the installed NS Basic program in RAM. When power to the device is lost, the RAM is wiped out and NS Basic needs to be installed again. There are a couple of techniques to have this happen automatically when the power comes back on.

9. If you have questions

We'd like to be able to provide the same level of support for installation issues as we for for NS Basic/CE itself, but not all the sofware comes from us. We can offer tips based on our own experience and act as a central point for keeping track of good ideas our users have on creating installers.

If you have questions, post them on our web board. If we can't answer them ourselves, perhaps another user can.

We will add to this document with new information and suggestions you submit. Hopefully, we'll develop this into something that is easily usable for all!