NL/TipsEnTrucs/Meerdere versies van OOo uitvoeren

From Apache OpenOffice Wiki
< NL
Revision as of 16:39, 17 April 2008 by DiGro (Talk | contribs)

Jump to: navigation, search

Hoe kan ik meerdere versies van OpenOffice.org naast elkaar uitvoeren?

Om deel te nemen aan OpenOffice.org hoeft u geen programmeur te zijn: u kunt helpen om bugs in OpenOffice.org zo snel mogelijk op te lossen door eenvoudigweg een developer snapshot te installeren en die te gebruiken zoals u normaal ook doet.

Gewoonlijk wordt elke versie geleverd via een installatiebestand dat zich installeert in dezelfde map als eerdere versies: bijvoorbeeld een stabiele versie, zeg OpenOffice.org 2.3.1, zal zich installeren in een map zoals /opt/openoffice.org2.3/ (*nix systems) en C:\Program Files\OpenOffice.org 2.3\ (Windows, waar de map "Program Files" gewoonlijk een gelokaliseerde naam heeft), terwijl een developer snapshot zich zal installeren in /opt/ooo-dev2.3/ (*nix systems) en C:\Program Files\OOo-dev 2.3\ (Windows).

Dit heeft enige nadelen: u zou misschien meerdere verschillende developer snapshots willen installeren of ook uw "oude" stabiele versie van OpenOffice.org willen behouden. Een nieuwe stabiele of developer versie zal zich installeren in de corresponderende map en daarbij de huidige versie vervangen (op Windows zal het installatieprogramma dit doen, op *nix systemen moet u eerst de oude versie deïnstalleren vóórdat u de nieuwe installeert).

Om dit te vermijden zullen we uitleggen hoe u verschillende versies van OpenOffice.org installeert en die naast elkaar kunt uitvoeren.


Linux

In dit gedeelte willen we u laten zien hoe u een OpenOffice.org versie, gedistribueerd in een RPM of DEB pakket, "installeert". In feite zullen we het niet installeren maar in plaats daarvan de bestanden in de pakketten uitpakken.

Merk op dat u met deze methode een RPM- of een DEB-pakket kunt gebruiken ongeacht het formaat van uw distributiepakket (hetgeen betekent dat u een RPM-pakket in Debian kunt uitpakken, of een DEB-pakket in Mandriva).

Installeren van 2.* versies

RPM-pakketten

Zorg er voor dat u, vóórdat u begint, GNU tar (http://www.gnu.org/software/tar/), rpm2cpio (http://www.rpm.org/) en GNU cpio (http://www.gnu.org/software/cpio/cpio.html) heeft.

In het volgende voorbeeld zullen we "installeren"

OOo_2.4.0_LinuxIntel_install_en-US.tar.gz

die is gedownload in de map

/home/user/download/ooo/

# cd naar de map waar u het *.tar.gz bestand heeft gedownload
# in dit voorbeeld hebben we het bestand 
# OOo_2.4.0_LinuxIntel_install_en-US.tar.gz 
# gedownload in de map /home/user/download/ooo/
 
~> cd download/ooo/
 
# maak een tijdelijke map (temp) om de bestandsinhoud uit te pakken
# in dit voorbeeld noemen we die TEMP_INST
 
~/download/ooo> mkdir TEMP_INST 
 
# cd naar die ttijdelijke map
 
~/download/ooo> cd TEMP_INST/ 
 
# pak de bestandsinhoud uit
 
~/download/ooo/TEMP_INST> tar -zxvf ../OOo_2.4.0_LinuxIntel_install_en-US.tar.gz

Met deze opdrachten hebben de inhoud van de tarball uitgepakt in de tijdelijke map. Let er op dat de mappenstructuur die we aantreffen kan verschillen in verschillende OpenOffice.org-versies; oudere versies pakten de RPMS-map uit in de root-map (in dit voorbeeld download/ooo/TEMP_INST/RPMS/).

Recente versies hebben een root-map waarvan de naam overeenkomt met het build-nummer; in ons voorbeeld is de root-map OOH680_m12_native_packed-1_en-US.9286.

We moeten cd-en naar RPMS binnen deze root, waar alle rpms zijn opgeslagen.

# nu moeten we een andere temp-map maken om alle RPM-bestanden in uit te pakken
# die zijn opgenomen in de RPMS-map
# Sommige oudere versies maakten alleen een RPMS-map in de map
# waar we uitpakten, bijvoorbeeld download/ooo/TEMP_INST/RPMS/
# In dit voorbeeld begint de root-map met de build-naam
 
~/download/ooo/TEMP_INST> cd OOH680_m12_native_packed-1_en-US.9286/RPMS/ 
 
# in het volgende gedeelte zullen we de mapnaam verkleinen
# in plaats van ~/download/ooo/TEMP_INST/OOH680_m12_native_packed-2_en-US.9276/RPMS>
# zullen we schrijven ~/download/ooo/TEMP_INST/OOH680_m12 .../RPMS>
 
# maak een temp-map waar de OpenOffice.org installatie-root-map moet worden uitgepakt
 
~/download/ooo/TEMP_INST/OOH680_m12.../RPMS> mkdir TEMP_ROOT 
~/download/ooo/TEMP_INST/OOH680_m12.../RPMS> cd TEMP_ROOT/ 
 
# pak de RPM's uit
 
~/download/ooo/TEMP_INST/OOH680_m12.../RPMS/TEMP_ROOT> for i in ../openoffice.org*.rpm; do rpm2cpio $i | cpio -id; done

Met deze procedure vinden we in

/home/user/download/ooo/TEMP_INST/OOH680_m12_native_packed-1_en-US.9286/RPMS/TEMP_ROOT

al de root-map:

~/download/ooo/TEMP_INST/OOH680_m12_native_packed-1_en-US.9286/RPMS/TEMP_ROOT/opt/openoffice.org2.4/

Nu hoeft u alleen nog maar die root-map te kopiëren of te verplaatsen naar waar u dat wilt.

~/download/ooo/TEMP_INST/OOH680_m12.../RPMS/TEMP_ROOT>cd opt
 
# zorg er voor dat u "opt" niet laat voorafgaan door een slash, zoals in /opt
# omdat dat zal verwijzen naar de map waar de hoofdinstallatie zich bevindt
# in /opt/openoffice.org2.4/
 
# in dit voorbeeld "installeren" we de nieuwe versie in home/user/openoffice.org2.4
 
~/download/ooo/TEMP_INST/OOH680_m12.../RPMS/TEMP_ROOT/opt> mv openoffice.org2.4 ~

En tenslotte verwijderen we alle tijdelijke bestanden

~/download/ooo/TEMP_INST/OOH680_m12.../RPMS/TEMP_ROOT/opt> cd ~/download/ooo/
~download/ooo> rm -rf TEMP_INST/

DEB-pakketten

In het volgende voorbeeld zullen we "installeren"

OOo_2.4.0_LinuxIntel_install_en-US_deb.tar.gz

dat is gedownload in de map

/home/user/download/ooo/

# cd to the folder where you downloaded the *.tar.gz file
# in this example we downloaded
# the file OOo_2.4.0_LinuxIntel_install_en-US_deb.tar.gz
# in the folder /home/user/download/ooo/
 
~> cd download/ooo/
 
# make a temp dir to extract the file content
# in this example we name it TEMP_INST
 
~/download/ooo> mkdir TEMP_INST 
 
# cd to that temp folder
 
~/download/ooo> cd TEMP_INST/ 
 
# extract the file content
 
~/download/ooo/TEMP_INST> tar -zxvf ../OOo_2.4.0_LinuxIntel_install_en-US_deb.tar.gz

With this commands we have unpacked the content of the tarball in the temporal directory. Note that the directory structure we may find varies in different OpenOffice.org versions; older versions unpacked the DEBS directory in the root (in this example download/ooo/TEMP_INST/DEBS/).

Recent versions have a root directory named according to the build number; in our example the root directory is OOH680_m12_native_packed-1_en-US.9286.

We need to cd the DEBS inside this root, where all the debs are located.

# now we have to create another temp dir to extract all the DEBs files
# contained in the DEBS folder
 
~/download/ooo/TEMP_INST> cd OOH680_m12_native_packed-1_en-US.9286/DEBS/ 
 
# in the following we will shorten the dir name
# instead of ~/download/ooo/TEMP_INST/OOH680_m12_native_packed-2_en-US.9276/DEBS>
# we will write ~/download/ooo/TEMP_INST/OOH680_m12 .../DEBS>
 
# make a temp dir where to extract OpenOffice.org installation root directory
 
~/download/ooo/TEMP_INST/OOH680_m12.../DEBS> mkdir TEMP_ROOT 
~/download/ooo/TEMP_INST/OOH680_m12.../DEBS> cd TEMP_ROOT/ 
 
# extract the DEBs 
 
~/download/ooo/TEMP_INST/OOH680_m12.../DEBS/TEMP_ROOT> for i in ../openoffice.org*.deb; do dpkg-deb -x $i . ; done

With this procedure we will find in

/home/user/download/ooo/TEMP_INST/OOH680_m12_native_packed-1_en-US.9286/DEBS/TEMP_ROOT

all the root directory:

~/download/ooo/TEMP_INST/OOH680_m12_native_packed-1_en-US.9286/DEBS/TEMP_ROOT/opt/openoffice.org2.4/

Now you just have to copy or move that root directory wherever you want.

~/download/ooo/TEMP_INST/OOH680_m12.../DEBS/TEMP_ROOT>cd opt
 
# make sure not to precede "opt" with a slash, as in /opt
# because this will point to the folder where resides the main installation
# in /opt/openoffice.org2.4/
 
# in this example we "install" the new version on home/user/openoffice.org2.4
 
~/download/ooo/TEMP_INST/OOH680_m12.../DEBS/TEMP_ROOT/opt> mv openoffice.org2.4 ~

And finally remove all the temporary files

~/download/ooo/TEMP_INST/OOH680_m12.../DEBS/TEMP_ROOT/opt> cd ~/download/ooo/
~download/ooo> rm -rf TEMP_INST/

User directory configuration for 2.* versions

Before running this new version, we have to make some changes in the configuration. The procedure is the same for RPM and DEB packages.

By default, an OpenOffice.org version will read and write in the corresponding user directory (for example, a stable OpenOffice.org 2.N version in /home/user/.openoffice.org2/, a developer snapshot in /home/user/.ooo-dev2/). This means that you can not run in parallel two versions that install as openoffice.orgN, or two as ooo-devN, because this could lead to inconsistencies.

To avoid this we must change OpenOffice.org configuration to look for the user's directory somewhere else: we will indicate the same installation root directory, this way we will have all together, being easier to deinstall later.

To do this we must edit the configuration file located in $OO_INST_ROOT_DIR/program/bootstraprc

As this file does not have write permission, change this first

~> cd openoffice.org2.4/program/
~/openoffice.org2.4/program> chmod +w bootstraprc

Now you can open this file with your text editor and change the line starting with UserInstallation= as follows:

UserInstallation=$ORIGIN/..

The whole file may look then as follows:

[Bootstrap]
BaseInstallation=$ORIGIN/..
InstallMode=<installmode>
ProductKey=OpenOffice.org 2.4
UserInstallation=$ORIGIN/..
[ErrorReport]
ErrorReportPort=80
ErrorReportServer=report.services.openoffice.org

This way the user directory will be in the root directory of OpenOffice.org, and you can run several version in parallel.


Installing 3.* versions (three layer OpenOffice.org)

Starting with DEV300m4, OpenOffice.org has three layers (see Three-Layer OOo). This means that when we extract the RPM/DEB packages, we will find two directories:

  1. opt/openoffice.org (contains the lowest and the middle layers: ure and basis)
  2. opt/ooo-dev3.0 (contains the top layer)

where you have to replace ooo-dev3.0 with the product name, for example openoffice.org3.0.

As we want to create a completely self-contained installation (without any system/desktop integration, and with its own user directory), we only need to extract the packages and then rename this opt directory so that the three layers are kept together.

RPM packages

In the following example we will "install"

OOo-Dev_DEV300_m7_LinuxIntel_install_en-US.tar.gz

that has been downloaded in the directory

/home/user/download/ooo/

# cd to the folder where you downloaded the *.tar.gz file
# in this example we downloaded 
# the file OOo-Dev_DEV300_m7_LinuxIntel_install_en-US.tar.gz 
# in the folder /home/user/download/ooo/
 
~> cd download/ooo/
 
# make a temp dir to extract the file content
# in this example we name it TEMP_INST
 
~/download/ooo> mkdir TEMP_INST 
 
# cd to that temp folder
 
~/download/ooo> cd TEMP_INST/ 
 
# extract the file content
 
~/download/ooo/TEMP_INST> tar -zxvf ../OOo-Dev_DEV300_m7_LinuxIntel_install_en-US.tar.gz

With this commands we have unpacked the content of the tarball in the temporal directory.

We need now to cd the RPMS inside this root, where all the rpms are located.

# now we have to create another temp dir to extract all the RPMs files
# contained in the RPMS folder
 
~/download/ooo/TEMP_INST> cd DEV300_m7_native_packed-1_en-US.9293/RPMS/ 
 
# in the following we will shorten the dir name 
# instead of ~/download/ooo/TEMP_INST/DEV300_m7_native_packed-1_en-US.9293/RPMS>
# we will write ~/download/ooo/TEMP_INST/ DEV300_m7.../RPMS>
 
# make a temp dir where to extract OpenOffice.org installation root directory
 
~/download/ooo/TEMP_INST/DEV300_m7.../RPMS> mkdir TEMP_ROOT 
~/download/ooo/TEMP_INST/DEV300_m7.../RPMS> cd TEMP_ROOT/

Notice that depending on the version, you may find two different naming schemes:

  1. openoffice.org-*.rpm for the lowest and middle layers
  2. ooo-dev-*.rpm for the top layer

So you can extract the RPMs in one or two steps:

# extract the RPMs in one step
 
~/download/ooo/TEMP_INST/DEV300_m7.../RPMS/TEMP_ROOT> for i in ../o*.rpm; do rpm2cpio $i | cpio -id; done

Note that we do not use the wildcard for i in ../*.rpm, because the package may include the rpm for Java Runtime Environment (in this example, the package comes with jre-6u4-linux-i586.rpm), so using the wildcard ../o*.rpm we make sure that only the rpms sarting with "o" are extracted.

# extract the RPMs in two steps
# the lowest and middle layers
 
~/download/ooo/TEMP_INST/DEV300_m7.../RPMS/TEMP_ROOT> for i in ../openoffice.org*.rpm; do rpm2cpio $i | cpio -id; done 
 
# extract the top layer
 
~/download/ooo/TEMP_INST/DEV300_m7.../RPMS/TEMP_ROOT> for i in ../ooo-dev*.rpm; do rpm2cpio $i | cpio -id; done

With this procedures we will find in

/home/user/download/ooo/TEMP_INST/DEV300_m7_native_packed-1_en-US.9293/RPMS/TEMP_ROOT

an opt folder that contains two directories:

  1. /TEMP_ROOT/opt/ooo-dev3.0
  2. /TEMP_ROOT/opt/openoffice.org

this last folder contains in turn other two directories: basis3.0 and ure.

Now you just have to copy or move that opt directory wherever you want.

# in this example we "install" the new version on home/user/OOo_DEV300_m7
 
~/download/ooo/TEMP_INST/DEV300_m7.../RPMS/TEMP_ROOT> mv opt ~/OOo_DEV300_m7

And finally remove all the temporary files

~/download/ooo/TEMP_INST/DEV300_m7.../RPMS/TEMP_ROOT> cd ~/download/ooo/
~download/ooo> rm -rf TEMP_INST/

DEB packages

In the following example we will "install"

OOo-Dev_DEV300_m7_LinuxIntel_install_en-US_deb.tar.gz

that has been downloaded in the directory

/home/user/download/ooo/

# cd to the folder where you downloaded the *.tar.gz file
# in this example we downloaded 
# the file OOo-Dev_DEV300_m7_LinuxIntel_install_en-US_deb.tar.gz 
# in the folder /home/user/download/ooo/
 
~> cd download/ooo/
 
# make a temp dir to extract the file content
# in this example we name it TEMP_INST
 
~/download/ooo> mkdir TEMP_INST 
 
# cd to that temp folder
 
~/download/ooo> cd TEMP_INST/ 
 
# extract the file content
 
~/download/ooo/TEMP_INST> tar -zxvf ../OOo-Dev_DEV300_m7_LinuxIntel_install_en-US_deb.tar.gz

With this commands we have unpacked the content of the tarball in the temporal directory.

We need now to cd the DEBS inside this root, where all the debs are located.

# now we have to create another temp dir to extract all the DEBs files
# contained in the DEBS folder
 
~/download/ooo/TEMP_INST> cd DEV300_m7_native_packed-1_en-US.9293/DEBS/ 
 
# in the following we will shorten the dir name 
# instead of ~/download/ooo/TEMP_INST/DEV300_m7_native_packed-1_en-US.9293/DEBS>
# we will write ~/download/ooo/TEMP_INST/DEV300_m7.../DEBS>
 
# make a temp dir where to extract OpenOffice.org installation root directory
 
~/download/ooo/TEMP_INST/DEV300_m7.../DEBS> mkdir TEMP_ROOT 
~/download/ooo/TEMP_INST/DEV300_m7 .../DEBS> cd TEMP_ROOT/

Notice that depending on the version, you may find two different naming schemes:

  1. openoffice.org-*.rpm for the lowest and middle layers
  2. ooo-dev-*.rpm for the top layer

So you can extract the DEBs in one or two steps:

# extract the DEBs in one step
 
~/download/ooo/TEMP_INST/DEV300_m7.../DEBS/TEMP_ROOT> for i in ../*.deb; do dpkg-deb -x $i . ; done
# extract the DEBs in two steps
# the lowest and middle layers
 
~/download/ooo/TEMP_INST/DEV300_m7.../DEBS/TEMP_ROOT> for i in ../openoffice.org*.deb; do dpkg-deb -x $i . ; done 
 
# extract the top layer
~/download/ooo/TEMP_INST/DEV300_m7.../DEBS/TEMP_ROOT> for i in ../ooo-dev*.deb; do dpkg-deb -x $i . ; done

With this procedure we will find in

/home/user/download/ooo/TEMP_INST/DEV300_m7_native_packed-1_en-US.9293/DEBS/TEMP_ROOT

an opt folder that contains two directories:

  1. /TEMP_ROOT/opt/ooo-dev3.0
  2. /TEMP_ROOT/opt/openoffice.org

this last folder contains in turn other two directories: basis3.0 and ure.

Now you just have to copy or move that opt directory wherever you want.

# in this example we "install" the new version on home/user/OOo_DEV300_m7
 
~/download/ooo/TEMP_INST/DEV300_m7.../DEBS/TEMP_ROOT> mv opt ~/OOo_DEV300_m7

And finally remove all the temporary files

~/download/ooo/TEMP_INST/DEV300_m7.../DEBS/TEMP_ROOT> cd ~/download/ooo/
~download/ooo> rm -rf TEMP_INST/


User directory configuration for 3.* versions

Before running this new version, we have to make some changes in the configuration. The procedure is the same for RPM and DEB packages.

By default, an OpenOffice.org version will read and write in the corresponding user directory (for example, a stable OpenOffice.org 2.N version in /home/user/.openoffice.org2/, a developer snapshot in /home/user/.ooo-dev2/). This means that you can not run in parallel two versions that install as openoffice.orgN, or two as ooo-devN, because this could lead to inconsistencies.

To avoid this we must change OpenOffice.org configuration to look for the user's directory somewhere else: we will indicate the same installation root directory, this way we will have all together, being easier to deinstall later.

To do this we must edit the configuration file bootstraprc located in the program directory inside the top layer, in this example:

/home/user/OOo_DEV300_m7/ooo-dev3.0/program

As this file does not have write permission, change this first

~> cd OOo_DEV300_m7/ooo-dev3.0/program
~/OOo_DEV300_m7/ooo-dev3.0/program> chmod +w bootstraprc

Now you can open this file with your text editor and change the line starting with UserInstallation= as follows:

UserInstallation=$ORIGIN/..

The whole file may look then as follows:

[Bootstrap]
BaseInstallation=${OOO_BASE_DIR}
InstallMode=<installmode>
ProductKey=OOo-dev 3.0
UserInstallation=$ORIGIN/..
[ErrorReport]
ErrorReportPort=80
ErrorReportServer=report.services.openoffice.org

This way the user directory will be in the root directory of OpenOffice.org, and you can run several version in parallel.

Windows

On Windows, you must do a so-called administrative installation of your package. This is something available for all msi-based installations, and basically simply means extracting the .cab files which come with your installation.

If you have a all-in-one executable containing your installation set (one single .exe file having more than 100 MB, named e.g. OOo_2.4.237_Win32Intel_install.exe), you first allow it to extract itself. For this, simply start the executable - it will prompt you for where to extract the files. After extraction, it will automatically run the real installer - cancel it.

In the following, we assume you extracted it to c:\temp\install

Now, open a console (<Windows_Key>+R, following by typing "cmd<enter>", will do), there do a

 ...> c:
 c:\> cd \temp\install
 c:\temp\install> msiexec /a ooodev24.msi

(The above assumes there is a file ooodev24.msi in the given directory. The name changes with the version you're installing, but it should always be exactly one .msi file. Use this one's name.)

msiexec is a tool to, well, execute .msi files. The /a switch tells it to do an administrative install. It will start a UI, where you again are asked for the target location - choose a folder where you finally want to have OOo being installed. Then, click the "Install" button, wait a few minutes, and there you are.

side note for advanced users:

 msiexec /a ooodev24.msi "TARGETDIR=c:\Program Files\OOoDev\m237" /qr

will install OOo into the folder "c:\Program Files\OOoDev\m237", without any further user interaction.

User Configuration

Like with the Linux version above, you need to make sure the user data of the just installed OOo version doesn't conflict with the user data of other installations. To do so, open the file <OOo_installation>\program\bootstrap.ini in a text editor of your choice, and locate the line

 UserInstallation=$SYSUSERCONFIG/OOo-dev2

(Again, the last part of this depends on the concrete version you installed, but there's only one line starting with UserInstallation.)

Change this to

 UserInstallation=$ORIGIN/..

Now, your user data will be put into a folder user right besides your program folder. Which has two advantages: Different version's user data don't clash anymore, and you can remove the complete installation, including your user data, by simply deleting the installation folder. Be aware, however, that now different people working on the same Windows machine will all work with the same user data, which is unlike a normal installation.

Personal tools