Making a Cab (installer) File

From AllShadow.com Wiki

Contents

The Easy Way

Before We Begin

The information listed in this section was originally written by IABovine over at XDA in this thread. This is simply a rehosting, so that this work can be shared. Please see the original thread for any questions.

Instructions

Like most people around here I enjoy customizing my phone. Problem is that copying files and applying a bunch of Registry tweaks by hand is tedious. I've built CAB files in the past but creating the INF files is an ugly process...not for the feint of heart.

So I created a utility called QuickCab that makes creating CAB files easy. It doesn't support every possible scenario, but if what you want to do is copy files or change the registry, it works quite well. This is perfect for Themes, Ringtones, Tweaks, and Mods.

Note, this Requires the .Net Framework 3.5 which can be found here.

Image:quickcab1.jpgImage:quickcab2.jpg

Changelog: 2.0

  • Rewrote GUI to allow for more options and fix selection errors
  • Fixed many button and selection errors
  • Added Shortcut support
  • Added support for Vista UAC
  • Added support for compressed cabs
  • Added ability to prevent uninstall
  • Removed support for Setup.dll (does anyone use this?)
  • Move from .Net 2.0 to .Net 3.5

Click here to download the Quick Cab 2.0

The More Technical Way

Before We Begin

This was originally posted by w411y, who states "Before I begin... all credit must go to GPCarreon[MVP] who passed his knowledge of cab creating on to lucky old me" in this original thread over at modaco. Below is a rehosting of this thread; nothing has been changed. Please, visit the original thread if you have further questions.

What this Tutorial is All About

.cab files are installer files. The can install graphics, registry edits and what-have-you and make installing a theme easy (also allows for easy un-installing too!) Below explains the different parts that comprise a .cab file and how to make one. Take the time to read each section completely. (Note: this is basically explaining how to use this previously listed cab making application.

Instructions: Making the .inf (your edits)

Image:HomerSimpsonScreenshot211.gif

Code

[Version]
Signature="$Windows NT$"
CESignature="$Windows CE$"
Provider="w411y"
[CEStrings]
Appname="w411y-HomerSimpsonWM5"
[CEDevice]
ProcessorType=0
  • Everything under [Version] is simple enough. Just change the 'Provider'
  • [CE Strings] is what will be said when asked to install. So when running it will say "Do you want to install w411y - HomerSimpson?" and of course you click YES.



Code

[SourceDisksNames]
1=,Source1,,"Homer"
2=,Source2,,"Sounds"
3=,Source3,,"WMP Skin"
  • [Source Disk Names] ... these are the names of folders in the Cab Creating Tools folder. So in the folder you just downloaded (including cabwizSP etc" there are also folders named 'Homer' which includes the images and XML. A folder for 'Sounds' and for files to do with the 'WMP Skin'



Code

[SourceDisksFiles]
"w411y-HomerSimpson.home.xml"=1
"HomerSimpson-Background.jpg"=1
"HomerSimpson-Message.jpg"=1
"HomerSimpson-Profile.jpg"=1
"HomerSimpson-Error.gif"=1
"HomerSimpson-Warning.gif"=1
"HomerSimpson-Info.gif"=1
"HomerSimpson-Question.gif"=1
"HomerSimpson-Volume.gif"=1
"HomerSimpson-Menu.gif"=1
"HomerSimpson-Startup1.gif"=1
"HomerSimpson-Startup2.gif"=1
"HomerSimpson-Shutdown1.gif"=1
"HomerSimpson-Shutdown2.gif"=1
"HomerSimpson-Multimedia.gif"=1
"HomerSimpson-Background(Non Orange).jpg"=1
"w411y-HomerSimpson(Non Orange Phones).home.xml"=1
"HomerSimpson-Banner.gif"=1
"HomerSimpson-CanIGoNow.wav"=2
"HomerSimpson-Fail.wav"=2
"HomerSimpson-MailIsHere.wav"=2
"HomerSimpson-Squeel.wav"=2
"The Simpsons Theme Tune.wav"=2
"HomerBackground.jpg"=3
"HomerDisabled.jpg"=3
"HomerPushed.jpg"=3
"HomerWMP.skn"=3
  • [Source Disc Files] ... here you list all the files involved in the cab and then give them a number. (as later on in the inf you will say Copy all files = 1 to the following folder...")



Code

[CopyFiles1]
"w411y-HomerSimpson.home.xml"
"HomerSimpson-Background.jpg"
"HomerSimpson-Message.jpg"
"HomerSimpson-Profile.jpg"
"HomerSimpson-Error.gif"
"HomerSimpson-Warning.gif"
"HomerSimpson-Info.gif"
"HomerSimpson-Question.gif"
"HomerSimpson-Volume.gif"
"HomerSimpson-Menu.gif"
"HomerSimpson-Startup1.gif"
"HomerSimpson-Startup2.gif"
"HomerSimpson-Shutdown1.gif"
"HomerSimpson-Shutdown2.gif"
"HomerSimpson-Multimedia.gif"
"HomerSimpson-Background(Non Orange).jpg"
"w411y-HomerSimpson(Non Orange Phones).home.xml"
"HomerSimpson-Banner.gif"
[CopyFiles2]
"HomerSimpson-CanIGoNow.wav"
"HomerSimpson-Fail.wav"
"HomerSimpson-MailIsHere.wav"
"HomerSimpson-Squeel.wav"
"The Simpsons Theme Tune.wav"
[CopyFiles3]
"HomerBackground.jpg"
"HomerDisabled.jpg"
"HomerPushed.jpg"
"HomerWMP.skn"
  • [CopyFiles1] ... these are all the files that are =1 (Same applies for [CopyFiles2] and [CopyFiles3])



Code

[DestinationDirs]
CopyFiles1=0,"\Application Data\Home"
CopyFiles2=0,"\Application Data\Sounds"
CopyFiles3=0,"\Application Data\Microsoft\Media Player"
  • [DestinationDirs] ... these are where your files are copied. So [CopyFiles1] will end up in "Application Data\Home"



Code

[RegData]
HKLM,Software\Microsoft\Splash Screen, CarrierBitmap,, \Application Data\Home\HomerSimpson-Startup1.gif
HKLM,Software\Microsoft\Splash Screen, CarrierShutdownBitmap,, \Application Data\Home\HomerSimpson-Shutdown2.gif
HKLM,Software\Microsoft\Splash Screen, MSBitmap,, \Application Data\Home\HomerSimpson-Startup2.gif
HKLM,Software\Microsoft\Splash Screen, MSShutdownBitmap,, \Application Data\Home\HomerSimpson-Shutdown1.gif
HKLM,Software\Microsoft\Shell\Rai\:ErrorBox, BKBitmapFile,, \Application Data\Home\HomerSimpson-Error.gif
HKLM,Software\Microsoft\Shell\Rai\:ExclamationBox, BKBitmapFile,, \Application Data\Home\HomerSimpson-Warning.gif
HKLM,Software\Microsoft\Shell\Rai\:InformationBox, BKBitmapFile,, \Application Data\Home\HomerSimpson-Info.gif
HKLM,Software\Microsoft\Shell\Rai\:QuestionBox, BKBitmapFile,, \Application Data\Home\HomerSimpson-Question.gif
HKLM,Software\Microsoft\Shell\Rai\:VolDlg, BKBitmapFile,, \Application Data\Home\HomerSimpson-Volume.gif
HKCU,ControlPanel\Sounds\Shutdown, Sound,, \Application Data\Sounds\HomerSimpson-CanIGoNow.wav
HKCU,ControlPanel\Sounds\SystemStart, Script,, ap
HKLM,Software\HTC\Album, AudioBK,, \Application Data\Home\HomerSimpson-Multimedia.gif
  • [RegData] ... these are the Reg tweaks I am including (for system screens)



Code

[DefaultInstall]
CopyFiles=CopyFiles1, CopyFiles2, CopyFiles3
AddReg=RegData
  • [Default Install] .. this is what the cab does. So it will put the files from 'CopyFiles1/2/3' into their chosen 'DestinationDirs' and will apply the 'RegData'

Instructions: Finalizing the inf file

  • Now save the file (from Notepad or your chosen text editor) as *.inf and make sure file type is set to 'all files'
  • Now drag your .inf file onto CabWizSP in the Cab Creating Tools folder and your Cab should appearin the folder. And that's it.

Final Words

  • One word of warning.... the paths on WM5 are different to WM2003... ie there is no Storage part to the WM5 OS
  • Fingers crossed this will get pinned so that everyone can see and none of you have an excuse as to why you havn't included extra screens in your homescreens wink.gif
  • More info here...http://www.gpcarreon.com/?p=93
  • Hope this helps. Good luck!!!
  • Note: Dont forget to post any outcomes which have been helped by this tutorial here.