Adding Files to a Package Uncompressed & External to the MSI or MST
Updated: 04 Aug 2010
In Windows Installer Editor you can decide whether to have the files you add to the package compressed within the msi, compressed in an external cab with an mst, or uncompressed external to the msi / mst.
I can quite easily explain how to do this, but I can't easily explain why some of the steps are necessary or the reasons behind them. This is sometimes because I don't know, but where I think I know I will try. This is not a comprehensive article, but some detail on ideas I have used, and hopefully it will serve as a pointer to help you to find the information you need to use.
Creating a NEW package from Windows Installer Editor (generating new WSI file)
In order to enable it so that you can add files to the package externally to the msi and uncompressed, firstly you need to create an entry in the Media page in Installation Expert within Wise Installer Editor. Using this page you can decide which features, components or everything, will have their files uncompressed external to the msi.
Then, when you compile a wsi where you've added files to that feature or component, the files will be stored in their structure as per the file table, external to the msi, in the same folder as the compiled msi. This is very similar to what you see after you run an administrative install on an msi.
Amending an MSI installation by creating an MST transform
The normal thing that happens when you use Windows Installer Editor to add files to a transform is that a cab file gets auto-generated with WISETFRM or similar in the filename. The problem is that if, in the course of your package tweaking, you have to amend any of those files, when you recompile, Wise Installer Editor then creates another cab - it does not amend the cab it already created.
Therefore, if I only have a few files to add to my package, I prefer to leave the files outside of any cabs. I do not recommend this method for a great many files.
The Media page is unavailable to you when editing a transform in Windows Installer, so you have to be a bit more cunning and outwit the Wise Installer Editor default behaviour. Please Please Please practice and try this on a test package, or copy of a package, not that critical one that the boss wants by 9am.
- Firstly add your file(s) to the mst as normal. Then compile the mst. Obviously the files will be compacted into a Wise Transform cab file.
- If you haven't already, make a back-up copy of your mst file at this point.
- Next, go to the file table in Setup Editor and locate the files you added. Make a note of the Sequence numbers of all your files, they should all be in sequence together - if your files are not all sequential then I do not recommend continuing.
- In the Attributes column, the number should be larger or equal to 16384. Whatever value is in there for your files, subtract 16384 and add 8192 to the number. E.g. if 17408 is in there, change it to 9216. Only change the files that you have added that were compressed into the external cab.
- Now go to the Media table in Setup Editor.
- The highest Sequence number you have noted for the files you added, should equal exactly one of the LastSequence numbers in the Media table. On that row, Cabinet column should have the filename of the newly-created cab file. All the following instructions are for this row only. Do not edit any other rows.
- Delete the field with the cab name in it and leave it blank.
- Is the DiskPrompt field empty? If it is empty, type in 'LABEL'. If it is not empty, leave whatever is in there.
- Now delete the CAB file itself generated by the Wise Transform the first time around.
- Copy the files that were added to the mst into the same folder as the msi / mst. Do not put them into any subfolders, just all together, regardless of their destination on the target computer.
- Recompile the mst.
Now when you deliver the package, the mst will pick up the uncompressed files from the folder the mst is in. If you need to alter any of the files, then when you recompile, you'll have to redo the sequence above for the files you edited.
Further information
When you set a feature as uncompressed in a new wsi in the Media page from Installation Expert (this is not the Media table from 'Setup Editor', I mean the Media page from 'Installation Expert'), one of the effects is to change the 'Source Type' from 2 to 0 in the Summary section under the Product tab in Setup Editor [1]. This means that from now on *all* files added to the msi will, by default be uncompressed. So how does that work then, when you've just told the Media page the opposite: that you want all files compressed by default, except for the feature you've specified.
Wise Installer Editor then does some clever jiggery-pokery:
- any files you add that are not in the uncompressed feature you set in the Media page in Installation Expert do get compressed, but not by Windows Installer default: Wise Installer Editor automatically adds 16384 to the attributes field of the files in the file table to force them to be compressed.
- any files you add that are in the uncompressed feature you set in the Media page in Installation Expert do get stored uncompressed, externally to the msi, and the attributes field of the files in the file table will not have 8192 added to them, because they effectively are the Windows Installer default for the msi.
Why does Wise Installer Editor do it that way around? Can't it just leave compressed as default but add 8192 to uncompressed files' attributes in the file table, instead of making uncompressed the default and adding 16384 to compressed files' attributes in the file table?
Well no, it appears from my testing it can't. When compressed is the msi default ('Source Type' from the Summary set to 2) and you add a file to the file table and add 8192 to the attributes [2], the msi then, on installation, does not want to find the file in the folder structure similar to the directory table, it just wants the file in the same directory as the msi itself, not in any folder. On installation, the msi will still install it to the correct destination folder as per the directory table.
Regards,
Darren.
Darren Collins
Applications Packaging and Deployment for the ICT Support Team,
Oxford University, UK.
[using Wise Package Studio 7.0 SP3 - 7.3.0.385 - on Windows XP SP3]
[1] What this is actually doing is changing bit 1 in the Word Count Summary Property of the Summary Information Stream (http://msdn.microsoft.com/en-us/library/aa372045(VS.85).aspx) from a value of 2 to a value of 0.
[2] You actually can't do this with Wise Installer Editor, you need to compile, then add 8192 to the file table attributes manually, then delete the cab or binary of the stored file with the msi or mst to achieve this effect.
Special acknowledgment to 'EdT', from Symantec Connect (http://www.symantec.com/connect/forums/enable-mst-install-uncompressed-files#comment-4263521) for getting me on the right path with this.
Originally published: http://msistuff.daz.uk.net/adding-files-to-a-package-uncompressed-extern
Article Filed Under: