Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

Understanding the script language



The setup scripts is a file you can read with a normal text editor. In an installation set it is placed next to setup. The script contains only blocks, beginning with a special keyword and ending with an „End“.

A typical block looks like:

File gid_File_Lib_Db31
Name = "libdb32.dll";
PackedName = "f_0320";
Size = 430080;
Dir = gid_Dir_Program;
Carrier = gid_DataCarrier;
UnixRights = 755;
Date = "23012002";
Time = "0600";
Styles = (PACKED);
End

This block is the definition of the global ID gid_File_Lib_Db31. Due to the beginning word File it describes a file. What information is needed for a file definition? First of all we see the name libdb32.dll. This is the physical name of the file. This file is packed in the installation set in a file name f_0320. The size of the unpacked libdb32.dll is 430.080 bytes. It shall be installed into a directory with the global ID gid_Dir_Program. This gid has to be definded in this setup script before this file definition. The Carrier is the medium, on which this file is stored. This is important for example for multi discs installations. If we install this product on a Unix platform we can give the Unix rights 755 to it. The installation date will be the 01/23/2002, the installation time is 0600. This file is packed into the file f_0320, therefore it has the Style Packed.

This block you can find in the setup script of an installation set. The original setup script is located in the bin directory of the output tree. It was created in one of the scp-projects. The block of this file looks in the original setup script:

File gid_File_Lib_Db31
Name = "libdb32.dll";
Dir = gid_Dir_Program;
Carrier = gid_Datacarrier;
UnixRights = 755;
Date = " 23012002 ";
Time = "0600";
Styles = (PACKED);
End

As you can see, scpzip adds the lines for the PackedName and the Size to the file definition. These are data, you cannot know, when you define a new file.

But how looks the original file definition. As you have already read, the setup script in the output tree is already platform and product independent. It was created from scp files, which were checked, preprocessed, linked and edited in many ways. The original file definition in the scp projects is the following definition block:

File gid_File_Lib_Db31
BIN_FILE_BODY;
#ifdef UNX
Name = "libdb-3.2.so";
#else
Name = "libdb32.dll";
#endif
Dir = gid_Dir_Program;
Styles = (PACKED);
End

Obviously the name of this file is platform dependent. You can also see a macro name BIN_FILE_BODY. This is defined in the file macros.inc scp2 project.

#define BIN_FILE_BODY FILE_BODY \
UnixRights = 755

BIN_FILE_BODY contains only two lines: The macro FILE_BODY and the UnixRights.

In this way one file is defined. If you do not want, that the file belongs to the root module and is installed always, you have to assign the file to a module. Modules can be deselected by a user in a user defined installation process. By the way, modules are also defined in such blocks, beginning with the keyword Module. These module definitions contain lists of files, of procedures and whatever can be defined in a setup script. One module is a root module, showing that it cannot be deselected during the setup. If a module contains the lines:

Default = YES;
Minimal = YES;

it is selected in a Default and Minimal installation. The directories in the scp projects represent the modules. The directory scp2/ooo contains all files, registryitems, ... that belong to the root module. In the directory scp2/cde you find all the content of the cde module.

A product like an OpenOffice.org can be understand as the addition of all of these modules. All the defined scp files in the scp2 directory are bound together by the linker par2script.pl, who gets his information from the product definition in scp2/util/makefile.mk.





Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.