Difference between revisions of "Building installation packages"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial revision)
 
(Added section for Windows patch sets)
Line 1: Line 1:
 +
==Installation packages==
 
The building of installation packages is the last step in building Apache OpenOffice.  It takes place in the main/instsetoo_native module.  It basically consists of collecting all files that are to be installed and putting them into an archive that can be installed on the targeted operating system.  The installation technique depends on the operating system:
 
The building of installation packages is the last step in building Apache OpenOffice.  It takes place in the main/instsetoo_native module.  It basically consists of collecting all files that are to be installed and putting them into an archive that can be installed on the targeted operating system.  The installation technique depends on the operating system:
 
;Windows:An msi that is wrapped by an NSIS installer.
 
;Windows:An msi that is wrapped by an NSIS installer.
 
;Linux:A set of RPM or DEB packages that are installed by distribution specific package managers.
 
;Linux:A set of RPM or DEB packages that are installed by distribution specific package managers.
 
;MacOSX:A dmg archive that is (can be?) copied into the <code>/Application</code> directory.
 
;MacOSX:A dmg archive that is (can be?) copied into the <code>/Application</code> directory.
 +
 +
Installation packages are created by Perl script <code>main/solenv/bin/make_installer.pl</code> and a larger number of Perl modules in <code>main/solenv/bin/modules/installer/</code>.  The <code>make_installer.pl</code> script is run by the makefile <code>main/instsetoo_native/util/makefile.mk</code>.
 +
 +
==Patch sets==
 +
 +
The content of patch sets depends on the operating system.
 +
 +
===Windows===
 +
On Windows there are Windows Installer patches (or .msp files) similar to installation packages (or .msi files).  These are self-contained packages that, for example on double-click from the file explorer, perform the update automatically and without the need for further applications or libraries.
 +
 +
Msi and msp files are COM Structured Storages (http://en.wikipedia.org/wiki/COM_Structured_Storage) and (at least in the case of AOO) contain at least two streams.  One contains the files to install or update, and the other contains a relational database whose tables contain information about the installation or update process.
 +
 +
Current version of the Windows Installer is 5.0 (for Windows 7).
 +
 +
The msi and msp databases can be read or modified in three different ways, each of which depends on the Windows Installer SDK which is contained in the MS Windows SDK:
 +
 +
# Through a set of executables that can read and modify msi and msp files.  Msidb.exe (http://msdn.microsoft.com/en-us/library/windows/desktop/aa370083%28v=vs.85%29.aspx) gives read and write access to the database stream.  Msimsp.exe creates the msp patch file.
 +
# By using the Windows Script Host together with the WiRunSQL.vbs script to access the database stream via SQL commands.
 +
# A custom program that uses the Patchwiz.dll to get access to the database stream.
 +
 +
Tables can not be deleted from the database stream with method 1 but with method 2.  Never tried method 3.
 +
 +
 +
Windows MSP updates can have three different types (see http://msdn.microsoft.com/en-us/library/windows/desktop/aa370579%28v=vs.85%29.aspx for more details):
 +
 +
;Small Updates:Changes to the msi file and application files. No change of either ProductCode nor ProductVersion
 +
;Minor Upgrades:No Change to ProductCode.<br/>Change of the ProductVersion
 +
;Major Upgrades:Change the installation into a different product.<br/>Change of the ProduceCode.
 +
 +
So, minor upgrades is the one best suited for Apache OpenOffice updates.
 +
 +
Creating a msp patch is basically quite simple:
 +
# Take two msi files, the old version that is to be patched, and the new target version.  Lets call them msi_o and msi_t.
 +
# Check the product codes in both msi files ("ProductCode" in the "Property" table).  They have to be the same.  Modify the product code in msi_t if they are not.
 +
# Create a local pcp file that controls the patch creation process:
 +
## Copy the template.pcp provided by the Windows Installer SDK to aoo_update.pcp.
 +
## Update the properies in its "PatchMetadata" table (basically metadata that describe who updates what and when).
 +
## Update some values in the "Properties" table:
 +
##* Set PatchOutputPath to the name of the resulting msp patch file.
 +
##* Set PatchGUID to a newly created UUID.
 +
## Add a row to the "ImageFamilies" table with generic data for the msi that is to be patched.
 +
## Add a row to the "UpgradedImages" table with generic data for the patch target.
 +
## Remove the "PatchSequence".
 +
# Run MsiMsp.exe on the aoo_update.pcp file.  It creates the msp patch file and log data.
 +
# The log data can be converted to human readable form (HTML pages) with the wilogutl.exe command.
 +
 +
 +
The resulting msp patch file can be run from the Windows file explorer and will turn a previously installed msi_o into a what installation of msi_t would result in.  Well, almost.  Experiments have shown that there are some subtle differences.  One is that the about box still read Apache  OpenOffice 3.4.0 instead of 3.4.1.  But that may be a "feature" of the update mode.
 +
 +
Some random notes:
 +
 +
The currently used product codes can be found in instsetoo_native/inc_openoffice/windows/msi_templates.

Revision as of 06:57, 9 October 2012

Installation packages

The building of installation packages is the last step in building Apache OpenOffice. It takes place in the main/instsetoo_native module. It basically consists of collecting all files that are to be installed and putting them into an archive that can be installed on the targeted operating system. The installation technique depends on the operating system:

Windows
An msi that is wrapped by an NSIS installer.
Linux
A set of RPM or DEB packages that are installed by distribution specific package managers.
MacOSX
A dmg archive that is (can be?) copied into the /Application directory.

Installation packages are created by Perl script main/solenv/bin/make_installer.pl and a larger number of Perl modules in main/solenv/bin/modules/installer/. The make_installer.pl script is run by the makefile main/instsetoo_native/util/makefile.mk.

Patch sets

The content of patch sets depends on the operating system.

Windows

On Windows there are Windows Installer patches (or .msp files) similar to installation packages (or .msi files). These are self-contained packages that, for example on double-click from the file explorer, perform the update automatically and without the need for further applications or libraries.

Msi and msp files are COM Structured Storages (http://en.wikipedia.org/wiki/COM_Structured_Storage) and (at least in the case of AOO) contain at least two streams. One contains the files to install or update, and the other contains a relational database whose tables contain information about the installation or update process.

Current version of the Windows Installer is 5.0 (for Windows 7).

The msi and msp databases can be read or modified in three different ways, each of which depends on the Windows Installer SDK which is contained in the MS Windows SDK:

  1. Through a set of executables that can read and modify msi and msp files. Msidb.exe (http://msdn.microsoft.com/en-us/library/windows/desktop/aa370083%28v=vs.85%29.aspx) gives read and write access to the database stream. Msimsp.exe creates the msp patch file.
  2. By using the Windows Script Host together with the WiRunSQL.vbs script to access the database stream via SQL commands.
  3. A custom program that uses the Patchwiz.dll to get access to the database stream.

Tables can not be deleted from the database stream with method 1 but with method 2. Never tried method 3.


Windows MSP updates can have three different types (see http://msdn.microsoft.com/en-us/library/windows/desktop/aa370579%28v=vs.85%29.aspx for more details):

Small Updates
Changes to the msi file and application files. No change of either ProductCode nor ProductVersion
Minor Upgrades
No Change to ProductCode.
Change of the ProductVersion
Major Upgrades
Change the installation into a different product.
Change of the ProduceCode.

So, minor upgrades is the one best suited for Apache OpenOffice updates.

Creating a msp patch is basically quite simple:

  1. Take two msi files, the old version that is to be patched, and the new target version. Lets call them msi_o and msi_t.
  2. Check the product codes in both msi files ("ProductCode" in the "Property" table). They have to be the same. Modify the product code in msi_t if they are not.
  3. Create a local pcp file that controls the patch creation process:
    1. Copy the template.pcp provided by the Windows Installer SDK to aoo_update.pcp.
    2. Update the properies in its "PatchMetadata" table (basically metadata that describe who updates what and when).
    3. Update some values in the "Properties" table:
      • Set PatchOutputPath to the name of the resulting msp patch file.
      • Set PatchGUID to a newly created UUID.
    4. Add a row to the "ImageFamilies" table with generic data for the msi that is to be patched.
    5. Add a row to the "UpgradedImages" table with generic data for the patch target.
    6. Remove the "PatchSequence".
  4. Run MsiMsp.exe on the aoo_update.pcp file. It creates the msp patch file and log data.
  5. The log data can be converted to human readable form (HTML pages) with the wilogutl.exe command.


The resulting msp patch file can be run from the Windows file explorer and will turn a previously installed msi_o into a what installation of msi_t would result in. Well, almost. Experiments have shown that there are some subtle differences. One is that the about box still read Apache OpenOffice 3.4.0 instead of 3.4.1. But that may be a "feature" of the update mode.

Some random notes:

The currently used product codes can be found in instsetoo_native/inc_openoffice/windows/msi_templates.

Personal tools