Jump to content

Changing the Default Install Directory of .cab Files


Guest spv_dman

Recommended Posts

Guest spv_dman

I want to share something I've discovered which will let you alter the install directory of cab files in your smartphone. I'll leave this to the discretion of the mods on whether they'll find this thread appropriate.

Disclaimer:

This is purely for educational purpose only. To show that smartphone default installation directories can be user defined. The modified cabs therefore should be for each one's personal use only and not to be redistributed. I or modaco will not be held liable for any damage this may cause to your smartphone.

Here goes.

Normally, you'll be given two options on where to install programs on your smartphone: IPSM or Storage Card. What if the program default install is Storage TypeProgram FilesProgram Directory but I want to change it to My Documents? Would it be possible? Answer is yes. But then again, these are not included in the install options but rather some modifications on the cab files has to be made to make this possible.

.cab files for Smartphone and contents:

These are installers for our smartphone. Normally, software companies packaged these in an exe file but still the main installer is the .cab file which are pushed on our smartphone upon installation.

If you open a .cab file on your desktop PC using a decompress software like winzip (read only), you'll see a couple of files namely: files with .001, .999, etc extensions and a _setup.xml. The .001 etc, contains the main executable, dlls, images, etc (we'll not touch this). The _setup.xml on the other hand contains the install information and is present on all smartphone cab files. It looks something like this:

We'll tackle the ones highlighted in red first. "InstallDir" defines the install path. It is present on all _setup.xml. You'll notice the prefix "%CE1%" before the sub directory "Mydir". List below for the full definitions of these variables (thanks to Richie M for his very useful thread).

Directory Smartphone 2002 Directory

Identifier

%CE1% Program Files

%CE2% Windows

%CE4% WindowsStartUp

%CE5% My Documents

%CE11% WindowsStart MenuPrograms

%CE12% WindowsStart MenuProgramsAccessories

%CE14% WindowsStart MenuProgramsGames

%CE17% WindowsStart Menu

%CE18%

%CE19% Application Data

%CE1% therefore pertains to Storage TypeProgram Files. Storage type is user defined. Say I choose IPSM as storage type, then %CE1% becomes IPSMProgram Files.

What if I want to change install directory to "My Documents"? Simply edit _setup.xml then change all occurrence of %CE1% to %CE5%.

Similarly, you can modify on where the shortcut will be created, highlighted in blue. In this example the link will be created in WindowsStart MenuPrograms (%CE11). If you want this to be created in WindowsStart MenuAccessories, just change %CE11% to %CE12%

The drawback of having to edit the _setup.xml is that the commercial compress / decompress softwares like winzip won't let you compress it back to the .cab file. I've included in this post "ModifyCab.zip" (contains freeware makecab.exe from Microsoft and ModifyCab.bat) which will let you "repackage" all the files back to a smartphone .cab file.

Simple steps to modify a cab file:

1. Decompress the contents of the attached "ModifyCab.zip" along with all the contents of the cab file you wish to modify into one directory.

2. Modify the _setup.xml using the above-mentioned as example.

3. Run ModifyCab.bat. Note that this may return an error "File not found" caused by listing the .001 etc contents of the directory, in such case, just ignore it.

4. This will generate Output.cab and just rename this to the program name of your choice.

5. Install the program and see the difference.

That's all. :)

ModifyCab.zip

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.