[Libreoffice] Script used to change the product codes

Fridrich Strba fstrba at novell.com
Wed Oct 13 15:12:06 PDT 2010

Hello, good people,

I was thinking that it would be nice to document the script that I used
to change the product IDs of libreoffice so that we don't uninstall
OpenOffice.org on Windows.

The script was generated once using the old codes in by this command:

(echo "#!/bin/sh"; for i in `grep -i -E
inc_ure/windows/msi_templates/codes.txt | awk '{ print $3}' | sort |
uniq | sed 's#\"{##g' | sed 's#}\"##g'`; do echo "perl -pi -e 's#
$i#`uuidgen | tr [:lower:] [:upper:]`#g' \"\$@\"";
done )>change-guids.sh

*This generation should not be done anymore.* I committed the resulting
script here:


I run the script on the relevant code*.txt files in instsetoo_native and
I reverted all stuff that concerns BrOffice back, since its product code
was distinct from OOo product code. Should it be desirable to change the
BrOffice codes, it is enough to run that script anew and commit the
changed files. Since the IDs are unique, the already changed IDs will
not be modified.

Now, there is a little hurdle for those that merge into LibreOffice tree
the relevant OOo changes:

If you see a new GUID in those files, please do following: 

1) Just merge them at the place where they were added despite the fact
that they will have quite different context (due to the change of all

2) Run the script on those files that were modified.

3) If the GUID that was added will not be changed by this script, amend
the script by adding a line 

	perl -pi -e 's#<old_guid>#<new_guid>#g' "$@"

generating a new GUID using "uuidgen | tr [:lower:] [:upper:]"

4) Run the amended script again and don't forget to commit the changes
to it too

This will regenerate a new GUID and also take care of situation where
some of the GUIDs in those files might be not unique (i.e. linking one
product to another by their product IDs).

Sorry for such a strict instruction, but I don't see another way to
ensure that we will not accidentally produce two versions of LibO that
will be not having the same product code in some element.



More information about the LibreOffice mailing list