Friday, September 25, 2009

How to Add a File to MSI with ORCA without Cabbing

Some times you need to add external files to the MSI installer at the last moment.On this article I will explain how can you quickly add a new file to MSI using the ORCA MSI editor without cabbing it.This is particularly useful when you want to do some last minute change and you do not have the Microsoft Windows Software Development Kit (SDK) to make the cab files.

Before you start ,you need to download MSI ORCA Editor from technipages if you do not already have it.
Let us first look at the steps involved in adding a New File to MSI.
1.Open the MSI you want to add in ORCA Editor.
2.Add a row to the Component Table .
3.Add a row to the Feature Component Table.
4.Add a row to File Table.
5.Add a row to Media Table.

Let us look at each step in detail to understand more.

Add a row to the Component Table
You will need a guid generator to get ComponentId.
Directory Column here means the Target Directory where the files will be copied when users install the application.
Check the msdn article to decide the correct values for Attributes and keypath.In most of the cases you might use 68 for Attributes and can leave Keypath as blank.

Add a row to the Feature Component Table
The component column should point to the Component you created in step 2.

Add a row to File Table
Component column should have the new component you created in step 2.
File name should be same as the new file you want to add.It should be placed in the same directory as the MSI file.MSI will pick the file automatically from this directory.
File size is the size of file in bytes.
Attributes value should be 8192 ,which means the file is not cabbed/compressed.
Sequence should be the largest existing sequence+1 (Sort the column and check the largest value).

Add a row to Media Table
DiskId should be the largest existing DiskId+1 (Sort the column and check the largest value).
Last sequence should be same as you created in step 4.
Leave the Cabinet column blank since you are adding the file without cabbing it.
Now you are ready to use the component and the File anywhere in the MSI you want.

Let us assume your new component name is xyzComponent and your new file is xyzFile.To create a shortcut you will create a new row in Shortcut table and add the component as xyzComponent and target as [#xyzFile].

If you want to add a new cab file then you need to make some changes to the above steps.
1.Use Microsoft Windows Software Development Kit (SDK) to create your cab file.
2.You have to provide the cab file name inside Mediatable Cabinet column (step5).
3.Add the Attributes value as 16384 (step 4).

Save the MSI and you are ready to go.

About This Blog

This Blog is all about Technology , Web 2.0 ,WebApps.You can also contact the author for advertising on this blog.All the material presented here is the property of author and its reproduction in any form is strictly prohibited.

Contact Us

If you have any suggestions ,queries or comments and want to reach out to me ,then you can reach me here.