Help - Search - Members - Calendar
Full Version: Tutorial: Creating Cab Files
MoDaCo > Smartphone / Windows Mobile Standard (non Touchscreen) > Smartphone Customisation > Smartphone Customisation - General Discussion
w411y
Before I begin... all credit must go to GPCarreon[MVP] who passed his knowledge of cab creating on to lucky old me biggrin.gif


Unpack the attatched file and put the folder "Cab Creating Tools" somewhere.
Now you got to create an inf file which tells the cab what to do. So lets look at the one for my Homer Screen....

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 ovcourse you click YES wink.gif

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'

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 thats it. 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 smile.gif Good luck

Note: Dont forget to post any outcomes which have been helped by this tutorial tongue.gif
pbrown
Darn you, man! Now I will be up past my bedtime for a week again adding more stuff to my theme. I'm going to have to blame you when I can't stay awake in meetings!
w411y
QUOTE(pbrown @ Jan 31 2006, 19:01)
Darn you, man! Now I will be up past my bedtime for a week again adding more stuff to my theme. I'm going to have to blame you when I can't stay awake in meetings!
*


laugh.gif Can you stay awake in them anyway?
Looking forward to seeing your outcome biggrin.gif
pbrown
Hey W-

You say "Unpack the attatched file and put the folder "Cab Creating Tools" somewhere." in your post, but I don't see an attachment... am I missing something?
w411y
D'oh ! I'm sure I put it there. Unless its been removed?
Thanks for pointing out Ill upload now.
laia
Thank you for this useful post.
I would like to know if it's possible to install different files with the same name. That is, I have a subdirectory with files that have the same name as other files in another subdirectory. Then I want to add them in a CAB file and then extract them in different subdirectories, so it should be possible to have repeated names because the files will never share the same directory. But I suppose that the CAB application is copying all the files at once in some temporary directory because when I extract the CAB file, though the subdirectories and files are created correctly, all the files with the same name have the same content. I mean, the files with the same name are overwritten in some phase of the CAB creation or extraction, so all of them are the same file at the end.
gpcarreon (MVP)
Hi there. smile.gif

The sample INF codes below will install 'Sample File.txt' on 2 different sub-directories: '\Storage\1' and '\Storage\2'

CODE
[Version]
Signature="$Windows NT$"
CESignature="$Windows CE$"
Provider="Your Name Here"

[CEStrings]
AppName="Your App Name Here"

[CEDevice]
ProcessorType=0

[SourceDisksNames]
2=,Folder2,,"2"
1=,Folder1,,"1"

[SourceDisksFiles]
"Sample File.txt"=2
"Sample File.txt"=1

[2]
"Sample File.txt"

[1]
"Sample File.txt"

[DestinationDirs]
2=0,"\Storage\2"
1=0,"\Storage\1"

[DefaultInstall]
CopyFiles=1, 2
gpcarreon (MVP)
Here is another sample. smile.gif

CODE
;;            Generated using
;;   Y.A.I.C. Maker for Windows XP
;;       Build 022407. Freeware!
;;         www.gpcarreon.com

[Version]
Signature="$Windows NT$"
CESignature="$Windows CE$"
Provider="laia"

[CEStrings]
AppName="laia's App"

[CEDevice]
ProcessorType=0

[SourceDisksNames]
5=,Folder5,,"SubB"
4=,Folder4,,"SubA"
3=,Folder3,,"Sub3"
2=,Folder2,,"Sub2"
1=,Folder1,,"Sub1"

[SourceDisksFiles]
"Sample File.txt"=5
"Sample File.txt"=4
"Sample File.txt"=3
"Sample File.txt"=2
"Sample File.txt"=1

[SubB]
"Sample File.txt"

[SubA]
"Sample File.txt"

[Sub3]
"Sample File.txt"

[Sub2]
"Sample File.txt"

[Sub1]
"Sample File.txt"

[DestinationDirs]
SubB=0,"\Storage\Folder2\SubB"
SubA=0,"\Storage\Folder2\SubA"
Sub3=0,"\Storage\Folder1\Sub3"
Sub2=0,"\Storage\Folder1\Sub2"
Sub1=0,"\Storage\Folder1\Sub1"

[DefaultInstall]
CopyFiles=Sub1, Sub2, Sub3, SubA, SubB

;;;  Yet Another Inf and Cab Maker
;;;         Chamba lang po;-)
laia
Thank you for your fast answer! You're right, all the folders and files are created correctly, but if you open the txt files you'll see that all of them have the same content. What I wanted to do is to work with different files with the same name. I am quite sure that when the files are taken from its subdirectories to be added, they are copied to a temp file without any information about their source, so the last file to be copied overwrites all other files. But this seems a very strange behaviour because it forces you to have all your files with different names! ohmy.gif
gpcarreon (MVP)
QUOTE(laia @ Jun 19 2007, 19:32) *
but if you open the txt files you'll see that all of them have the same content.

Noticed that one too. I'll try to find a work around for such a strange problem.
gpcarreon (MVP)
Hi laia smile.gif

I hope you'll find this guide helpful. I think you can also use the 'makecab.exe' from here.
chucky.egg
@GP
I was thinking about this topic last night whilst trying to work something out.
You'll probably know the answer...

How do I set a Registry string value to null/blank?
What would I put in the INF file to do that?

This is what I want to CAB:
http://www.modaco.com/index.php?s=&sho...st&p=820126
gpcarreon (MVP)
@chucky

1) I'm assuming the 'DLL' on that thread is a string so kindly try this XML code
CODE
<wap-provisioningdoc>
    <characteristic type="Registry">
        <characteristic type="HKLM\System\Startup\1">
            <parm name="Dll" value="" datatype="string" />
        </characteristic>
        <characteristic type="HKLM\System\Shutdown\1">
            <parm name="Dll" value="" datatype="string" />
        </characteristic>        
    </characteristic>
</wap-provisioningdoc>


2) Save code as _setup.xml , open makecab.exe, type makecab _setup.xml chucky.cab (You can use this utility for command prompt concerns)

3) Test install the CAB file. Copy over to your Temp folder then run it from there. Note that the CAB file will only tweak your target reg keys. No file will be installed.

I tried it on my C500 and the keys were created just fine. Unit is app and registry unlocked (full) smile.gif
aj76
This was great. I have just used it to help me create a cab for a project at work and scored major brownie points. It provided an excellent starting point Thank you.

AJ
Jay Robb
I did it! I made a theme and and a cab.
Thank you w411y.. I did have 3 errors show up when creating the cab

QUOTE
Windows CE CAB Wizard
Warning: Section [DestinationDirs] key "CopyFiles1" is not using the string "%InstallDir%"
Warning: Section [RegData] has no data
Warning: Section [DefaultInstall] key "AddReg" - there are no section entries to process

of course I am using linux and a windows emulator to run the cab wizard
it is true my regdata has no data because I am not making any reg changes, as for the copyfile1 dont know.

CODE
[Version]
Signature="$Windows NT$"
CESignature="$Windows CE$"
Provider="Jay"

[CEStrings]
Appname="LCARS-theme"

[CEDevice]
ProcessorType=0

[SourceDisksNames]
1=,Source1,,"LCARS"

[SourceDisksFiles]
"LCARS.home.xml"=1
"LCARS_background.jpg"=1
"LCARS_alert.jpg"=1

[CopyFiles1]
"LCARS.home.xml"
"LCARS_background.jpg"
"LCARS_alert.jpg"

[DestinationDirs]
CopyFiles1=0,"\Application Data\Home"

[RegData]

[DefaultInstall]
CopyFiles=CopyFiles1
AddReg=RegData


then when installing to phone it warned that it may not look right because it is for WM5 and my phone is MW6

but it works and look good

Click to view attachment
Click to view attachment

let me know what you think.

Jay

p.s. the status will show your profile, I did a manual edit of them..
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.