|
|
The
scp-project in OpenOffice.org Introduction: The scp project contains the script-particles (scp) for OpenOffice.org. This project produces *.inf (Win) and *.ins (Unx) files which are used to direct the setup and the production of installation sets with lzip. The scp project directs the whole installation process for the OpenOffice.org. Following components are supported: Directorys, files, configuration items (for *.xml files), registry items (for windows registry), profile items (entries for the ini-files), folders, default installation path, help texts for setup, cinema text, modules and basic scripts.
A. How to put a new file in the installation set:
B. Configurationitems
Configurationitems are used to add or change configuration entries in xml files. There are several important subentries like Path, Key, Value, Styles and ModuleID. A typical item looks like following example:
ConfigurationItem GID_CONFIGURATIONITEM_EXAMPLE ModuleID = GID_MODULE_SO_ROOT; Path = "org.openoffice.Office.ExampleFile/Filters/draw_SGV_StarDraw_20"; Key = "UIName"; Value = "SGV - StarDraw 2.0"; Styles = (CFG_STRING, CREATE); End
Path: The first part of this entry declares the filename without extension in this example org.openoffice.Office.ExampleFile.xml is the target file. The following part of the entry describes the path in the xml file.
Key and Value: Contain the entries in the xml file.
Styles: Defines the type of value:
CFG_STRING: Value = "A string" CFG_STRINGLIST: Value = a list of strings CFG_BOOLEAN: Value = "TRUE" or "FALSE" CFG_NUMERIC: Value = 1031 CFG_BINARY: Value is binary. CREATE: Creates a new entry in the xml file. If this entry exsists in the xml file no action takes place.
C. Profile and ProfileItems
This part of setup is localized in the profile.scp and profile_xxx.scp files (where xxx means for example calc for different setup-modules).
Profile declares the name and directory of an ini file. The gid name is needed in the ProfileItem declaration as ProfileID parameter. The ProfileItems are the entries in the form Key = Value of the ini-files.
Profile GID_PROFILE__EXAMPLE_INI ModuleID = GID_MODULE_EXAMPLE; Name = "example.ini"; Dir = GID_DIR_EXAMPLE; Styles = (NETWORK); End
Styles: NETWORK : Network installation WORKSTATION : Workstation installation INSTALL_INFO : Only necessary for the install.ini
ProfileItem GID_PROFILEITEM_EXAMPLE_INI_TEST ProfileID = GID_PROFILE_EXAMPLE_INI; ModuleID = GID_MODULE_EXAMPLE; Order = 2; Section = "Example"; Key = "test"; Value = "testValue"; End
ProfileID : GID of the ini file defined by Profile ModuleID : Setup-module GID Section : Declaration of the sectioname Order : Numerical order of the entry Key and Value : Contain the content of the ini-file entry
Language dependent Value entries are in the correspondent lng files. Several macros are used to handle these entries (xx = 01,03,...,96): ALL_LANG_STR_SECTION(str) expands to Section(xx) = "str-xx" ALL_LANG_STR_KEY(str) expands to Key (xx) = "str" ALL_LANG_STR_VALUE_LNG(ID) expands to Value (01) = "Value text 01"; ° ° Value (96) = "...";
when the content of the lng file is
[STR_VALUE_ID] 01 = "Value text 01" ° ° 96 = "..."
You can use the macros as follows:
ProfileItem GID_PROFILEITEM_EXAMPLE_INI_TEST ProfileID = GID_PROFILE_INSTALL_INI; ModuleID = GID_MODULE_PRG_IMPRESS_BIN; Order = 2; ALL_LANG_STR_SECTION(simpress-Filters); ALL_LANG_STR_KEY("StarImpress 4.0 Vorlage"); ALL_LANG_STR_VALUE_LNG(TEMPLATE_STAR_IMPRESS40); End
D. Directories
This part of setup is localized in the dir.scp and dir_xxx.scp files (where again xxx means for example calc for different setup-modules).
Directory GID_DIR_EXAMPLE ParentID = PD_PROGDIR; DosName = "example"; Styles = (WORKSTATION, DELETE_ONLY, CHECK_TIMESTAMP,CREATE); End
Styles: WORKSTATION : Create directory on client side (Network installation only) CREATE : Create empty directory. If setup copies a file into a directory the directory will be created automatically. DELETE_ONLY : Setup removes this directory during deinstallation CHECK_TIMESTAMP : Will be only deleted
when 'delete all' flag during deinstallation
PD_PROGDIR is predefined as the installation path.
E. Modules
This part of setup is localized in the module.scp and module_xxx.scp files (and again xxx means for example calc for different setup-modules).
Modules are used to declare installation components which are composited from files, directorys, basic procedures, profileitems, configurationitems. They are usally selectable or deselectable in the setup dialog box for custom installation.
Module GID_MODULE_EXAMPLE Name = "Example name"; Description = "Example description"; ParentID = GID_MODULE_PARENT; Files = (GID_FILE_EXAMPLE1,GID_FILE_EXAMPLE2); Procedures = (GID_PROCEDURE_EXAMPLE); Minimal = YES; Default = YES; Styles = (HIDDEN_ROOT); End
Name: Name of the module. Description: Description of the module.
Minimal: If set to YES, this component is part of a minimal installation. Default: If set to YES, this component is part of a standard installation. Styles: HIDDEN_ROOT: Hide the module in the dialog box for custom installation. DONT_SELECT_BY_USER: The user can't change the selection status of the module.
Important: To switch Profiles, ProfileItems and ConfigurationItems with modules, the gid of the module is specified in the Profile/ProfileItem/ConfigurationItem ModuleID parameter. To switch customs, procedures, files and directories, the gid of these items are specified in the similar Files,Customs, Dirs, Procedures parameters of the Module declaration.
MOD_NAME_DESC(id): The macro MOD_NAME_DESC is very usefull, because of the language dependencies of the name and description entries. It is using the corresponding module.lng and module_xxx.lng files which contain the language dependent strings.
Usage: Module GID_MODULE_EXAMPLE MOD_NAME_DESC(MODULE_EXAMPLE); ParentID = GID_MODULE_OPTIONAL; Files = (GID_FILE_ZIP_ADDIN,GID_FILE_LIB_ROT,GID_FILE_LIB_DFA); Procedures = (GID_PROCEDURE_EXAMPLE); Minimal = YES; Default = YES; Styles = (HIDDEN_ROOT); End
In this example the id
MODULE_EXAMPLE expands to the appropriate sections
[STR_NAME_ MODULE_EXAMPLE] 01 = "Example" ° ° 96 = "...."
[STR_DESC_ MODULE_EXAMPLE] 01 = "Example description" ° ° 96 = "...."
The country codes have the following meaning: 01: English 03: Portuguese 07: Russian 30: Greek 31: Dutch 33: French 34: Spanish 39: Italian 45: Danish 46: Swedish 48: Polish 49: German 55: Spanish (Brasil) 81: Japanese 82: Korean 86: Chinese (simple) 88: Chinese (traditional) 90: Turkish 96: Arabian
F. Procedures
This part of setup is localized in the basic.scp and basic_xxx.scp files for Windows. For UNIX the appropriate files are unxbasic.scp and unxbasic_xxx.scp (and of course xxx means for example calc for different setup-modules).
Procedure gid_Procedure_Example ProcName = "ExampleProcedure"; Styles = (STANDALONE, WORKSTATION, INSTALL, BEFORE_INST); Code = {Sub ExampleProcedure ° ° Basic program ° ° End Sub }; End
Styles: STANDALONE Execute during standalone installation/deinstallation NETWORK : Execute during network installation/deinstallation WORKSTATION : Execute during workstation installation/deinstallation INSTALL : Execute during installation UNINSTALL : Execute during deinstallation BEFORE_INST : Execute before creating directories/files. AFTER_INST : Execute at the end of installation. PRE_SELECT_MODULE : Execute before custom select dialog Only for one procedure allowed. LANGUAGE_SELECT_MODULE : Only important for checking the setup module selection
Important: The value of ProcName must be the name of the subroutine given in the first line of the code parameter. In this example: 'ExampleProcedure'. The procedure GID must be added to a module by using the Procedures parameter in the module declaration (look above).
G. Setup specifications
Some setup-variables are available, which are replaced by the scp-linker or the setup itself.
Linker-Variables:
%PRODUCTNAME will be substituted by the name of the product, here OpenOffice.org %PRODUCTVERSION will be substituted by the version of the product, here 6.0
Setup-Variables: <workpath>, <progpath> : Office-installation path <productkey> : only for the sversion-ini Userdata: <title>, <email>, <customernr>, <position>, <city>, <fax>, <telefonwork>, <telefonhome>, <street>, <company>, <country>, <state>, <zip>, <userfirstname>, <username>, <userid>, <sequence_languages>
The following preprocessor directive is available for OpenOffice.org: OSL_PRODUCT
Tip: If you make changes in one of the scp-files, please use the SUPD, for example if you include a new file in the files.scp use:
#if SUPD > 622 ... Here is the file-definition #endif
|


