<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Spike</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Spike"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Spike"/>
	<updated>2026-10-18T20:35:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Windows_Installer_Hacking&amp;diff=20621</id>
		<title>Windows Installer Hacking</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Windows_Installer_Hacking&amp;diff=20621"/>
		<updated>2006-11-22T11:30:48Z</updated>

		<summary type="html">&lt;p&gt;Spike: /* Component.idt */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains how to modify a Windows installer EXE (the big, &amp;gt;70 MB one which contains everything).&lt;br /&gt;
&lt;br /&gt;
== Why? ==&lt;br /&gt;
&lt;br /&gt;
Normally this is a bad idea, and it is better to build OOo from scratch&lt;br /&gt;
yourself.  However, this may not be possible for various reasons, e.g. if:&lt;br /&gt;
&lt;br /&gt;
* You don&amp;#039;t have the (non-Free) toolchain available to build OOo.&lt;br /&gt;
* You&amp;#039;re modifying a non-Free OOo derivative and don&amp;#039;t have the source.&lt;br /&gt;
* You don&amp;#039;t have the time and resources available to build OOo&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
== OOo_2.0_Windows_install_en-US.exe ==&lt;br /&gt;
&lt;br /&gt;
This is an NSIS self-extracting installer.  It contains the following&lt;br /&gt;
structure:&lt;br /&gt;
&lt;br /&gt;
    openofficeorg1.cab&lt;br /&gt;
    openofficeorg2.cab&lt;br /&gt;
    openofficeorg3.cab&lt;br /&gt;
    openofficeorg4.cab&lt;br /&gt;
    openofficeorg20.msi&lt;br /&gt;
    instmsia.exe&lt;br /&gt;
    instmsiw.exe&lt;br /&gt;
    licenses/&lt;br /&gt;
    readmes/&lt;br /&gt;
    setup.exe&lt;br /&gt;
    setup.ini&lt;br /&gt;
&lt;br /&gt;
In the OOo 2.0 build process it is built from its contents using a command&lt;br /&gt;
(at &amp;quot;call_nsis&amp;quot; in solenv/bin/modules/installer/download.pm) which does&lt;br /&gt;
something like the following:&lt;br /&gt;
&lt;br /&gt;
    /cygdrive/c/Program\ Files/NSIS/makensis.exe c:/ooo2/ooo-build/build/ooo680-m3/instsetoo_native/wntmsci10.pro/OpenOffice/nsis/en-US/downloadtemplate.nsi&lt;br /&gt;
&lt;br /&gt;
The file&lt;br /&gt;
&lt;br /&gt;
    downloadtemplate.nsi&lt;br /&gt;
&lt;br /&gt;
contains instructions for building the .exe.  Its directory also contains&lt;br /&gt;
&lt;br /&gt;
    English_pack.nsh&lt;br /&gt;
    English_pack.nlf&lt;br /&gt;
&lt;br /&gt;
which both consist of text strings in the installer language and are&lt;br /&gt;
referenced from downloadtemplate.nsi.  (Various .ico and .bmp files, located&lt;br /&gt;
outside the directory, are also referenced).&lt;br /&gt;
&lt;br /&gt;
== CAB files ==&lt;br /&gt;
&lt;br /&gt;
These contain the actual files which get extracted.  Although CAB files can&lt;br /&gt;
apparently store a directory tree structure, these ones are flat.  The&lt;br /&gt;
filenames inside the CAB are often, but not always, the same as the names&lt;br /&gt;
when installed.&lt;br /&gt;
&lt;br /&gt;
N.B.  &amp;#039;&amp;#039;&amp;#039;The order in which files are stored is very important!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
    cabextract -l # lists the contents of a cab file.&lt;br /&gt;
    makecab.exe /F blah.ddf # Create CAB from blah.ddf, a spec+filelist&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;blah.ddf&amp;quot; file can be generated with a perl script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/perl -w&lt;br /&gt;
# &lt;br /&gt;
# Files to pack: c:\msi\files&lt;br /&gt;
# Output file path is relative to that directory&lt;br /&gt;
# Temporary work space: c:\msi\makecabtemp&lt;br /&gt;
# Usage: perl make-ddf.pl (list of names of files to pack, in order, without path)&lt;br /&gt;
# &lt;br /&gt;
print &amp;lt;&amp;lt;EOF;&lt;br /&gt;
.Set CabinetName1=../out.cab&lt;br /&gt;
.Set ReservePerCabinetSize=128&lt;br /&gt;
.Set MaxDiskSize=CDROM&lt;br /&gt;
.Set CompressionType=LZX&lt;br /&gt;
.Set Compress=ON&lt;br /&gt;
.Set CompressionLevel=2&lt;br /&gt;
.Set Cabinet=ON&lt;br /&gt;
.Set DiskDirectoryTemplate=c:/msi/makecabtemp&lt;br /&gt;
EOF&lt;br /&gt;
for my $file (@ARGV) {&lt;br /&gt;
    print qq(&amp;quot;c:\\msi\\files\\$file&amp;quot; $file\n);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some files in the CABs may not actually get installed: See Component.idt&lt;br /&gt;
below.&lt;br /&gt;
&lt;br /&gt;
== MSI file ==&lt;br /&gt;
&lt;br /&gt;
This is a relational database which controls the installation process.  It&lt;br /&gt;
can be dumped into tab-separated text files (*.idt), one per table, using&lt;br /&gt;
&lt;br /&gt;
    MsiDb.Exe -e -d blah.msi -f c:\text_file_dest *&lt;br /&gt;
&lt;br /&gt;
The text files can be dumped back into a new MSI like this:&lt;br /&gt;
&lt;br /&gt;
    MsiDb.Exe -i -d blah_new.msi -f c:\text_file_dest *.idt&lt;br /&gt;
&lt;br /&gt;
(N.B. In both cases, be sure to surround the * in quotes if you&amp;#039;re using a&lt;br /&gt;
UNIX shell)&lt;br /&gt;
&lt;br /&gt;
If you edit these text files, you have to be pretty careful, because there&lt;br /&gt;
is all sorts of referrential integrity to preserve between tables.  To&lt;br /&gt;
modify the install, some tables are particularly important:&lt;br /&gt;
&lt;br /&gt;
=== File.idt ===&lt;br /&gt;
&lt;br /&gt;
This is a list of files which *potentially* can be installed.&lt;br /&gt;
&lt;br /&gt;
* File is the name of the file in the archive.&lt;br /&gt;
&lt;br /&gt;
* Each file is part of a Component.&lt;br /&gt;
&lt;br /&gt;
* FileSize speaks for itself.&lt;br /&gt;
&lt;br /&gt;
* Sequence is the order in which the files appear in the CABs, and the&lt;br /&gt;
installer will *fail* if it is not correct.  (The Sequence is across all CAB&lt;br /&gt;
files, so for instance the first file in CAB 3 has the Sequence number one&lt;br /&gt;
higher than the last file in CAB 2).&lt;br /&gt;
&lt;br /&gt;
=== Directory.idt ===&lt;br /&gt;
&lt;br /&gt;
Defines directories per feature component&lt;br /&gt;
&lt;br /&gt;
=== Media.idt ===&lt;br /&gt;
&lt;br /&gt;
Specifies the CABs from which to obtain files.  Crucially, this specifies&lt;br /&gt;
the file number ranges contained within each CAB, so if you add any files&lt;br /&gt;
you will probably have to alter this.&lt;br /&gt;
&lt;br /&gt;
=== Feature.idt ===&lt;br /&gt;
&lt;br /&gt;
Defines Features, i.e. groupings of functionality which can be selected in&lt;br /&gt;
the installer.&lt;br /&gt;
&lt;br /&gt;
=== FeatureComponent.idt ===&lt;br /&gt;
&lt;br /&gt;
Each Feature is a set of components.&lt;br /&gt;
&lt;br /&gt;
=== Component.idt ===&lt;br /&gt;
&lt;br /&gt;
Specifies into which directory a component is installed (relative to Directory.idt), etc.  &lt;br /&gt;
KeyPath is the First file in the component (in Sequence order) (?)&lt;br /&gt;
&lt;br /&gt;
== Full paths of executables ==&lt;br /&gt;
&lt;br /&gt;
* C:\Program Files\Microsoft Platform SDK\Bin\MsiDb.Exe&lt;br /&gt;
* C:\WINDOWS\system32\makecab.exe (on Windows XP)&lt;br /&gt;
* cabextract - UNIX (or cygwin) program&lt;/div&gt;</summary>
		<author><name>Spike</name></author>
	</entry>
</feed>