http://agent021.wordpress.com/category/windows-cemobile-platform/build-system/
Once your driver or application is ready (or for debugging), you can use the CAB Wizard to create cabinet (.cab) files to test the installation of your driver or application on the device. This cab file acts like a container, holding all necessary device driver or application files. ensures that these files are present at installation.
How ??
1. Make the *.cab file and *.inf by using the any text editor (UTF-8 encoded). You can use the Cabwiz.exe which is available on your SDK Tools. The Syntax is available on
BATCH FILE
——————MyCabFile.bat————–START———————————————————————————————–
set _WINCEROOT=C:/WMXXX :: AKU Path
set WORK_ROOT=C:/ARUN/CabMaker :: Where your *.inf file is plcaced & cab file is made
set TEMP_PROJ_DEBUG=”E:/WMXXXX/release/BSP/WPC” :: Where you keep the files to make it as Cab File
set TEMP_TRGT_DEBUG=”E:/WMXXXX/PUBLIC/SHELLW/OAK/TARGET/CPUVERSION/DEBUG” :: A Temp Debug Dir
:: Change Dir to C
C:
:: Copying Dll,exe,*.AnyExtn Files From Project Folder To Target Folder
copy %TEMP_PROJ_DEBUG%/File1.dll %TEMP_TRGT_DEBUG%/File1.dll
copy %TEMP_PROJ_DEBUG%/File2.exe %TEMP_TRGT_DEBUG%/File2.exe
:: Where you have CabWiz tool installed along with SDK
cd “C:/SDK_Tools_PATH/CabWiz”
::cabwiz %WORK_ROOT%/MyCabFile.inf ALL the Details about Cab is wrtten in this inf file
cabwiz %WORK_ROOT%/MyCabFile.inf
E:
:: Chage path to singing tool
cd “Singing tool path”
::signing the cab
signing_command %WORK_ROOT%/MyCABFile.cab
C:
:: back to the home Dir
cd C:/ARUN/CabMaker/
——————MyCabFile.bat————–END————————————————————————————————
INFORMATION FILE
INF File (Information File) uses the Microsoft Win32® Setup format with Windows CE–specific modifications.
The most common operations for installing an application like copying files and setting registry keys are done thru this. Details like where the files should be placed and which registry keys should be created or modified can be inputed in .inf file. .inf file is text based.
——————MyCabFile.inf————–START———————————————————————————————–
;The following are some imp required Sections in an .inf file (in [])
[Version]
Signature = “$Windows NT$” ;Signature name (of the OS), which must have a value of either “$Windows NT$”, or “$Windows 95$”.
Provider = “LinkinPark_Corp” ;Company which makes
CESignature = “$Windows CE$”
;Describes the creator and version of the application.
;NOTE: Windows CE file system reserved characters are //:*?” < >|&.
[CEStrings]
AppName = TestAppFromArun
;Contains string substi for application and directory names.
[CEDevice]
VersionMin = minor_version
VersionMax = major_version
BuildMax = 0xE0000000 ;Supports both square screens and screen rotation.
[DefaultInstall] ;Describes the default method used to install the application.
CopyFiles = Files.Common
AddReg = Registry.Common
[Strings]
_WONCEROOT = “E:/WMXXXX”
WONCEDEBUG = “DEBUG_???_FDLR”
;String definitions for one or more strings.
;Edit these first two strings to match the environment settings of the same name
[Files.Common]
File1.dll,,,0 ; destination_filename,[source_filename],[,flags]
File2.exe,,,0
[SourceDisksNames]
1 = ,,,%_WONCEROOT%/PUBLIC/SHELLW/OAK/TARGET/CPUVERSION/%WONCEDEBUG%
2 = ,,,.
;Contains the name and path of the directories on the hard disk where the application files reside.
[SourceDisksFiles]
File1.dll = 1
File2.exe = 1
; Contains the source filenames of the files which comprise the application.
[DestinationDirs]
Files.Common = 0,%CE2%
; Contains the names and paths of the destination directories for the application on the target device.
;Installation Macro Strings for Mobile Applications
Macro string | Pocket PC directory |
---|---|
%CE1% | /Program Files |
%CE2% | /Windows |
%CE4% | /Windows/StartUp |
%CE5% | /My Documents |
%CE8% | /Program Files/Games |
%CE11% | /Windows/Start Menu/Programs |
%CE14% | /Windows/Start Menu/Programs/Games |
%CE15% | /Windows/Fonts |
%CE17% | /Windows/Start Menu |
[Registry.Common]
HKLM, _PATH_, KEY_Name, 0×00010001, 1
——————MyCabFile.inf————–END————————————————————————————————
How to make Cab file
1. First make a MakeCabFile.bat file. (which manages the process)
2. Then make apprpriate MakeCabFile.inf file (which has MS Specific syntax and modifications)
3. Go to Command promt and set needed evironment variables if needed.
4. execute the bat file
Here the important thing is that proper signing should be done for each items which you are puting in the cabinet.
5. Cab file will be created.
6. Copy the cab file to the device and execute.
Device may ask to reboot if any contents of the cab is already there in the device.
Ref:
Courtesy: Microsoft