Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Windows CE and Mobile SetupDll with unzip support

0.00/5 (No votes)
28 Apr 2010 1  
Create Windows CE cab files which install a complete directory structure onto a device

Introduction

Create Windows CE cab files which install a complete directory structure onto a device. I created this small tool as I needed an easy to use tool to create a pseudo installation cab.

The DLL will unzip an archive file with all dirs onto a device. To build a new cab, use the directory structure you will find below cabdir.

Create Your Own Install

First cleanup all files below cabdir\source. Then place all files into this directory as they should be unpacked onto the device. For example, for an application called barcodegame, I created the following structure below the source:

source
	+---Program Files
	¦   +---barcodegame
	¦       +---de
	¦       +---en
	+---Temp
	+---windows
		+---Start Menu
			+---Programs

Then let cabbuild.bat create a new archive with all files and then a cab with this packed file. For example, change to the cabdir (cd cabdir) and then launch:

Buildcab.bat "BarcodeGame3"

The batch file will patch an INF file needed for cabwiz and zip all files below the source. The batch will also patch the file SetupDll_zip2.ini.tmpl which is used to specify the install location and the zip filename:

;SetupDll_zip2.ini
;directory values have to end with a \

[unzip]
basedir=\
reboot=0
zipfile=!APPNAME!.zip

The unzip directory could also be controlled by the registry but the INI file is looked up first.

If you like to control the unzip by the registry, you have to change the template file “cabtemplate.inf” and use these settings:

"HKLM\Software\SetupDll_ZIP2"
	registry entries (all REG_SZ):
	unzipbasedir: "\"
	zipfilename: "install.zip"
	doreboot:"0"|"1"

Currently the batch and everything is adjusted to work with the INI template file “SetupDll_zip2.ini.tmpl”.

Dependencies

  • The INI and INF template files are patched using the GNU tool sed.
  • The zip file is created with 7za
  • The cab is created with the Microsoft SDK tool cabwiz.
  • The setupdll is written with the help of iniutil.cpp/h and unzip.cpp/h

Coding Techniques

  • Windows native API
  • CreateWindow from DLL
  • Read INI files on Windows CE
  • Unzip file on Windows Mobile
  • Update window from thread

Advantages and Disadvantages

  • No national windows support. No shellfolders :-(
  • Very easy to use 8-)
<!-- Social Bookmarks BEGIN --> <!-- Social Bookmarks END -->

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