Cinema Premiere online movie manager / DVD organizer. Import, organize, search, sort and play your movies on all types of media.

How to Distribute a Program on the Internet (Part 2)


<< Previous | Next >>

How to create an install program:

I spent a lot of time trying to figure out how to create an install program for the Pocket PC. Finding a Windows installer program was much easier. I started of with a free program called Inno Setup. It was fairly easy to use and has wizard to help you get started. The wizard creates a script file which you can edit to your own specifications.


Example of the Inno Setup Script File


Once I got the Windows installer working correctly, I started looking for a Pocket PC installer program. I searched and searched and finally found a free installer program called Nullsoft Scriptable Install System (NSIS) that not only works for the Pocket PC, but also for Windows. I found out about the installer program by reading this article: I downloaded the program from here and installed it. I then downloaded the HS NIS Edit to create and edit the installer script from here and installed it. I also downloaded the zip file containing a sample script of a Pocket PC installer from here. I started HS NIS Edit > File > New script from Wizard and created a Windows install script. It was pretty straight forward especially since the WordPal Vocabulary Builder doesn't modify the register or do anything difficult. You should have a license file and a readme file. There is an example of a license file (eula.txt) in the zip file that had the sample script. I saved my license file as .rtf (rich text format) so I could keep my font formats such as bold.


I set up a release directory (MindPal Release) off of my root directory.

All the files that are shared between the Windows and Pocket PC WordPal application are in the WordPal directory.

Only the .exe file is different between the Windows and Pocket PC WordPal application.


For the Windows application, I wanted to install the WordPal.exe and its required files in C:\Program Files\MindPal\WordPal Windows. The following is the NSI script I created for the WordPal Windows installation using HM NIS Edit:


 Example of the HM NIS Edit Script File for Windows Install ( WordPal_Windows_Script.nsi )

To create the install program, I just had to compile the script (NSIS > Compile with profile > Default).

Once the Windows installer was working, I decided to tackle the Pocket PC installer. However, before I could begin on the script I had to build a .cab file. The .cab file contains all the files I want to install on the Pocket PC. To create a cab file, I needed a .inf file. I created one in notepad. The hardest problem I had was getting the sub folders (directories) to work correctly.


Example of the WordPal_Setup.inf File

Once I had the .inf file, I had to create the cab file. Visual Studio comes with a program called cabwiz which will create a cab file. I moved all the cabwiz files (Cabwiz.exe, makecab.exe, cabwiz.ddf) to my release directory just so I had all my release stuff in one place. Cabwiz is a command line program so I opened up the Command Prompt (Start > Program > Accessories > Command Prompt) to run it. If Cabwiz was in a different directory or if the .inf was in a different directory, I would have to type in the path as shown in the first line of the example, but since all the files are in my release directory, I only have to type in the program names as in the second line of the example.

Example of running Cabwiz

After Cabwiz runs, it creates a .CAB file and a .DAT file.


This is what the WordPal_Setup.CAB file looks like


The next file that is required to be able to install the cab file on the Pocket PC is an install.ini file. I created one in notepad.


Example of the install.ini File

Now that I had all the components I needed to create the install, I started the HM NIS Edit program and opened the MultipleInstallerExample.nsi that was in the zip file that I had previously downloaded. This example file showed me how to write the script to install a program on to the Pocket PC. However, this example was written for multiple programs to be installed so I opened my WordPal_Windows_Script.nsi and saved it as WordPal_PocketPC_Script.nsi. I then modified it for the Pocket PC and cut and pasted the parts I needed from the MultipleInstallerExample.nsi. This is what I ended up with.


 Example of the HM NIS Edit Script File for Pocket PC Install ( WordPal_PocketPC_Script.nsi )

To create the install program, I just had to compile the script (NSIS > Compile with profile > Default). So finally I had my WordPal Pocket PC installer (WordPal Setup X.xxC.exe where X.xxC is my version number). When the WordPal Setup is run, it installs the following files on C:\Program Files\MindPal\WordPal Pocket PC.


It then uses the install.ini and installs the files in the cab file on to the Pocket PC that is attached to the user's Windows PC.


In case a user has a Pocket PC, but does not have a Windows PC, it may be appropriate to allow the user to download only the cab file. the cab file can be placed on the SD card. When the user clicks on the cab file on the Pocket PC, the program files will be installed. The drawback here is the the user will not see the license agreement or the readme file. However, before downloading the cab file, one could require the user to agree to the license and display the readme as a html file after the download completes.


NOTE: When a file contained in the cab file is modified, the cab file must be rebuilt and the install script must be recompiled.


Next, I will cover how I set up my web site to allow users to purchase and download the WordPal Setup programs I just created.

<< Previous | Next >>