I have Firefox msi created by FrontMotion. I want to add a custom file and followed this guide
 using insted for creating the mst transform.
I didn't want to mess up the directory table so I decided to use an existing entry with the correct destination path, but that way I was forced to create a directory structure for the source path. In fact watching the file table with Insted it adds two calculated columns with target_path and source_path. The target path what was I wanted so I conformed to the source path Program Files\Mozilla Firefox\defaults\pref.

My shared folder content was:

Firefox.msi
transform.mst
Program Files\Mozilla Firefox\defaults\pref\custom.js

The installation failed because msiinstaller complains it cannot find custom.js in the root of the shared folder

I added a second custom.js at the root of the shared folder:

Firefox.msi
transform.mst
Program Files\Mozilla Firefox\defaults\pref\custom.js
custom.js

It works but I would like to understand better what is happening. Why Had I to add the file twice ? Which is the correct source path for it ? What can I do when the added files reside in deeply nested directories ?

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

0
You should examine the windows installer SDK help file - MSI.CHM with an example directory table open in your preferred editor to use as an example.
The key starting point is this:
DefaultDir

The DefaultDir column contains the directory's name (localizable)under the parent directory. By default, this is the name of both the target and source directories. To specify different source and target directory names, separate the target and source names with a colon as follows: [targetname]:[sourcename].

You need to understand how the target and source folders are defined and how the addition of a . in the source field means the parent folder, or one step up the folder tree towards the root folder (SOURCEDIR).  Use of this technique allows you to have the source destination in the same folder as the MSI without having to duplicate the folder structure of the destination (target) folder tree. 

Answered 08/20/2014 by: EdT
Red Belt

Please log in to comment
0
Hi Setecastronomy,
    as far as I know there is no need to place the file in both locations. Source file location is specified by 'Attibutes' filed in the 'File' table and 'Image type' a.k.a. 'Word Count' in Summary Inforamtion Steram.
    There are following relations between these two:
Image Type - External Tree. Long filenames.
  • File Attibute - 0x0000 (none) - File has to reside in folder structure specified in Insted source_path field (nested folder structure next to the MSI file)
  • File Attibute - 0x2000 (Noncompressed)  - as above, because if compression attribute is not set, the compression state of the file is specified by the 'Word Count' Summary Property (In this scenaio 0x0000 and 0x2000 means Uncompressed).
  • File Attibute - 0x4000 (Compressed) - File has to reside in Cabinet file (external or embedded), otherwise validation will throw ICE35 Error and installation will be aborted when will try to install this file.
Image Type - Compressed. Long filenames.
  • File Attibute - 0x0000 (none) - File has to reside in Cabinet file (external or embedded), otherwise validation will throw ICE35 Error and installation will be aborted when will try to install this file.
  • File Attibute - 0x2000 (Noncompressed) - File has to be present in the root folder (next to the MSI).
  • File Attibute - 0x4000 (Compressed) - same as 0x0000 because if compression attribute is not set, the compression state of the file is specified by the 'Word Count' Summary Property (In this scenaio 0x4000 and 0x0000 means Compressed).
Image Type - Admin External. Long filenames.
    No matter of file 'Attributes', source has to be present in folder tree next to the MSI.
For 'Short filenames' source files have to follow 8.3 naming convention.
I hope it answers your questions,

Best regards.
Image Type - External Tree. Long filenames.

Refereneces:
MSI File Table (especially Attributes field):
    http://msdn.microsoft.com/en-us/library/aa368596%28v=vs.85%29.aspx
Word Count Summary:
    http://msdn.microsoft.com/en-us/library/aa372870%28v=vs.85%29.aspx
8.3 filename:
    http://en.wikipedia.org/wiki/8.3_filename

EDIT:
And I forgot about described above by EdT modifications in 'DefaultDir' column in 'Directory' table (as he said - by modifying[targetname]:[sourcename] you may avoid nested directories).
Answered 08/20/2014 by: rad33k
Orange Senior Belt

Please log in to comment
Answer this question or Comment on this question for clarity