Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/gui.git] / doc / salome / gui / GUI / input / installing_salome.doc
1 /*!
2
3 \page installing_salome_page SALOME Installation Wizard Help
4
5 <hr>
6 <ul>
7 <li>\ref installing_products "Installing products with the Installation Wizard"
8 <ul>
9 <li>\ref gui_mode_install "GUI mode"
10 <li>\ref batch_mode_install "Batch mode"
11 <li>\ref environment_files "Environment files"
12 </ul>
13 <li>\ref notes_on_check "Notes on check products version procedure"
14 <li>\ref pick_up_env "Pick up the environment"
15 <li>\ref modifying_xml "Modifying XML configuration file"
16 <li>\ref installation_scripts "Implementing installation scripts for the new products"
17 <li>\ref finish_buttons "Customizing Readme page buttons"
18 </ul>
19 <hr>
20 \anchor installing_products 
21 <h1>Installing products with the <em>Installation Wizard</em></h1>
22
23 The Installation Wizard can be launched in two modes: \b GUI and \b
24 batch.
25 <br>The root directory of the Installation Wizard contains Python
26 script \b runInstall. To run the Installation Wizard just type \b runInstall.
27 in the terminal window:
28 <br><br>[ python ] \b runInstall [options]
29
30 Without options this script will launch the SALOME Installation
31 Wizard in the default mode (GUI). \n The default installation settings
32 can be overridden by using command line options. Each option has a
33 short and a long notation:
34
35 <b>-g / --gui</b>
36 \par
37 Runs the Installation Wizard in the GUI mode (this is the default
38 mode).
39
40 <b>-b / --batch</b>
41 \par
42 Runs the Installation Wizard in the terminal mode.
43
44 <b>-f FILE / --file=FILE</b>
45 \par
46 The XML configuration file to be used by the Installation Wizard.  If
47 this option is not used then the installation script tries to define
48 the \e Linux version and use the corresponding XML file if it exists. For
49 examle, for <em>Linux Mandrake 10.1</em>  the <b>config_Mandrake_10.1.xml</b>  file
50 will be used by default. If no appropriate file is found, the file
51 <b>config.xml</b> will be used. This file refers to the basic target platform 
52 which is <em>Linux Mandrake 10.1</em> for SALOME 3.0 and newer. If <b>config.xml</b>
53 file is not found either, a warning message box is shown (in GUI mode)
54 or printed to the console (in batch mode) and the Installation Wizard 
55 quits.
56
57 <b>-d DIR / --target=DIR</b>
58 \par
59 The target directory SALOME platform is to be installed to. 
60 If used, this option overrides the default target directory, given in
61 the configuration XML file (usually <b>${HOME}/salome_\<version\></b>, 
62 see \ref modifying_xml "here" for more details).
63
64 <b>-t DIR / --tmp=DIR</b>
65 \par
66 The directory, which should be used for temporary files. If given,
67 this option overrides the default temporary directory, given in the
68 configuration xml file (usually \b /tmp, see \ref modifying_xml "here"
69 for more information).
70
71 <b>-a / --all-from-sources</b>
72 \par
73 Forces all the products to be installed from sources (including all
74 SALOME modules). If this option is used, all default installation
75 modes for all products are ignored.
76 \n This option is helpful when the user wants to install SALOME on the
77 platform which is not officially supported. In this case, the user can
78 try to run the SALOME Installation Wizard with the \b -a option in order
79 to build all the products from sources.
80 \n <b>Note, that this is a time-consuming operation which can take
81 more than 24 hours depending on the computer.</b>
82
83 <b>-h / --help</b>
84 \par
85 Prints help information on the Installation Wizard's use.
86
87 <b>-v / --version</b>
88 \par
89 Prints version information (\b Note: this is the Installation Wizard's
90 version number, not the number of SALOME platform version).
91
92 The installation procedure supports different \em Linux platforms and
93 installs various installation 3d-party prerequisite products which are
94 required by SALOME platform. As it was mentioned above, the basic
95 target platform for SALOME 3.0 and newer is <em>Linux Mandrake 10.1</em>.
96 Use of configuration XML files gives a flexible way to modify the list
97 of products to be installed by the Installation Wizard without
98 changing the program source code. Just create your own XML
99 configuration file and implement installation scripts for the
100 prerequisite products you need and then use this XML file with the
101 Installation Wizard. This can be done, for example, for some Linux
102 platform which is not supported directly by the Installation
103 Wizard. See \ref modifying_xml "Modifying XML configuration file" and
104 \ref installation_scripts "Implementing installation scripts for the new products"
105 sections for more information.
106
107 <br>
108 \anchor gui_mode_install
109 <h2>GUI mode</h2>
110
111 The <b>Installation Wizard</b> GUI has been developed using
112 Trolltech's <b>Qt 3.0.5</b> toolkit. After launching the Installation
113 Wizard in the GUI mode the wizard window is shown to the user. This
114 wizard guides the user through several subsequent pages. To navigate
115 between the pages use \em "Next" and \em "Back" buttons in the lower
116 part of the wizard window. The \em "Cancel" button closes the wizard
117 window and quits the installation procedure after the user's
118 confirmation. The \em "Help" button opens an additional window to show
119 help information.
120
121 The first \em "Introduction" page is shown in \ref figure_1 "Figure 1". 
122 Skip this page by clicking \em "Next":
123
124 \anchor figure_1
125 \image html intropage.png 
126 \n <center><b>Figure 1:</b> "Introduction" page</center>
127
128 In the second page you are proposed to enter the target directory
129 where the SALOME platform should be installed to. You can also click
130 <em>"Browse..."</em> and choose the destination folder using the standard
131 browse directory dialog box.
132 \n If the directory you want to install products to does not exist you
133 are prompted to confirm directory creation. If you type a wrong
134 directory path, or if you do not have write permissions 
135 for the directory you use, the corresponding message box is shown.
136
137 You can also change the temporary directory (which is used to store
138 temporary files required for the installation).
139 \n In the bottom part of the window the total disk space required for
140 the installation and for the temporary files is displayed (see below
141 for more details).
142
143 In the GUI mode the Installation Wizard provides two different options
144 to install the SALOME platform: \b basic (default option) and
145 \b advanced. In the \b basic mode the user should enter the target
146 installation directory and temporary folder. All other installation
147 options are taken from the XML configuration file (see \ref figure_2 "Figure 2"):
148
149 \anchor figure_2
150 \image html productpage1.png
151 \n <center><b>Figure 2:</b> "Installation settings"</center>
152
153 In addition, you have a choice to use "Install all products from
154 sources" check box. If this option is turned on, all the products will
155 be installed from the sources (using their own build procedures). This
156 check box corresponds to the <b>--all-from-sources (-a)</b> option of
157 the \b runInstall script (see \ref installing_products "here").
158
159 \Note <b>Installation of all products from sources is a long-time
160 operation.</b>
161
162 To switch to the \b advanced option, click <em>"More..."</em> (see 
163 \ref figure_3 "Figure 3" ).
164
165 In the advanced mode you have a possibility to select products to be
166 installed. Each product can have several options of installation: you
167 have a possibility to use the native product (provided with Linux
168 distribution and installed in the system folders), install already
169 precompiled binaries, build the product from sources or not install it
170 at all. Available options and default option are taken from the XML
171 configuration file. You can mark the products you want to install by
172 clicking the corresponding radio-buttons in the list view in the left
173 part of the page.
174 \n Note, that some products may require some other pre-requisite
175 products to be installed (or these prerequisite products should be
176 already available on your computer). The installation procedure has a
177 special feature to automatically mark these products in the list
178 view. For example, in order to install \b PyQt it is necessary to have
179 <b>gcc, Python, Qt</b> and \b Sip installed. Therefore all these
180 products will also be  turned on when you check on \b PyQt. This
181 feature can be switched off by clicking the <em>"Automatic
182 dependencies"</em> checkbox. Turn on this checkbox if you want all
183 prerequisite products to be automatically checked when you select some
184 product to be installed. Turn off this checkbox if you want to disable
185 this feature.
186
187 \anchor figure_3
188 \image html productpage.png
189 \n <center><b>Figure 3:</b> "Installation settings" page in the 'advanced' mode</center>
190
191 If you want to use native products (like \b gcc, \b tcl, etc.), select <em>"use
192 native"</em> option. 
193 \n Special button in the right part of the page - <em>"Unselect All"</em> -
194 allows to reset quickly all products to the <em>"not install"</em> state.
195 <br><br>
196 There are also two checkboxes on this page: <em>"SALOME sources"</em>
197 and <em>"SALOME binaries"</em>. These three-state checkboxes allow
198 quick selecting/unselecting sources/binaries packages of SALOME
199 modules for installation.
200 <br><br>
201 In addition, when some SALOME sources are selected, one more check box
202 becomes available: <em>"Build SALOME sources"</em>. If this option is
203 turned on, the selected SALOME modules will be built and installed
204 from sources.
205
206 \note <b>If this check box is turned on, the corresponding SALOME
207 module binaries package installation is disabled, because of  SALOME
208 module sources and binaries packages conflict</b> (see \ref figure_4 "Figure 4" below).
209
210 \anchor figure_4
211 \image html productpage2.png
212 \n <center><b>Figure 4:</b> "Build SALOME sources" check box
213 usage</center>
214
215 The box at the right side of the page displays the information about
216 currently highlighted product: name, version and short description,
217 required disk space, disk space required for temporary files, list of
218 prerequisites (this information is provided in the XML file) and
219 current user choice.
220 <br><br>
221 The <em>"Disk space required:"</em> field displays how much disk space
222 on the hard drive is required for installation of selected products.
223
224 \note <b>Please, take into account that the displayed amount of
225 required disk space is approximate and may differ when you install
226 products on your hard drive.</b>
227
228 The installation procedure uses a special directory to store temporary
229 files. The <em>"Space for temporary files:"</em> field shows the information
230 about required disk space on the hard drive for extracting and
231 compiling the selected products. You can change the temporary
232 directory - just type a path to the folder you want to use or click on 
233 the corresponding <em>"Browse..."</em> button.
234
235 \note Actually, temporary files are not stored directly in the
236 directory entered by the user. The Installation Wizard creates an
237 additional folder in this directory named something like
238 INSTALLWORK<b>XXXXX</b> where XXXXX is a unique number. This allows to launch
239 several Installation Wizards simultaneously. This temporary directory
240 is removed automatically when the installation finishes.
241
242 The installation procedure also checks the available disk space. If
243 there is not enough disk space on your hard drive you will see a
244 corresponding error message box.
245
246 \note <b>You are strongly recommended not to use directory names
247 containing spaces</b>. Otherwise you can experience 
248 some troubles with the installation.
249
250 To proceed further click <em>"Next"</em>. At this moment the program will make
251 some tests to check installation settings: if there is enough disk
252 space on the hard drive, check for native products installation,
253 dependencies (prerequisites) for each product you have selected to be
254 installed. If any test fails you will see the corresponding warning
255 message box. Otherwise the wizard will proceed to the next page:
256
257 \anchor figure_5
258 \image html choicepage.png
259 \n <center><b>Figure 5:</b> "Check your choice" page</center>
260
261 This page summarizes the installation options you've made on the
262 previous pages. You can check again your choice and change it if
263 necessary by getting back to the previous page.
264 \n When you are sure that everything is OK, click <em>"Next"</em> to
265 follow to the \ref figure_6 "next page".
266
267 \anchor figure_6
268 \image html progresspage1.png
269 \n <center><b>Figure 6:</b> "Installation progress" page</center>
270
271 To start installation of the selected products click "Start". It
272 launches the shell installation script and you will be able to see the
273 output of the script in the  dialog topmost frame. If any errors occur
274 during the installation progress the corresponding messages will be
275 printed to the log window in bold red font.
276
277 It is possible to break the installation at any time by clicking
278 "Stop". Then you can get back to the previous pages if you wish to
279 change installation settings or restart installation by pressing again
280 "Start" button.
281
282 \note <b>In the current implementation it is not possible to resume
283 the stopped installation process; it will be re-started from the very
284 beginning.</b>
285
286 \anchor figure_7
287 \image html progresspage.png
288 \n <center><b>Figure 7:</b> "Installation progress" page: installation in progress</center>
289
290 The <em>"Installation Status"</em> frame window shows you the progress of
291 installation. \c "Waiting" status means that installation of this product
292 has not been started yet. The product currently being installed is
293 marked as \c "Processing". All installed products have \c "Completed"
294 status.
295
296 You can abort installation and close the installation procedure using
297 \em "Cancel" button.
298
299 \note <b>This button sends the signal "SIGTERM" to the shell
300 script. The script tries to clear all temporary files. The process of
301 removing temporary files can take some time, so the installation
302 wizard will wait 3 seconds before closing.</b>
303
304 At the end of installation (all selected products have been installed
305 successfully) you can go back to the previous pages to start a new
306 installation or click \em "Next" to go the Readme page:
307
308 \anchor figure_8
309 \image html readmepage.png
310 \n <center><b>Figure 8:</b> "Finish installation" page</center>
311
312 In this page you can read important information about the Instalation
313 Wizard itself and some tips: how to run and test SALOME or how to
314 build SALOME from the sources. This is the contents of the README file
315 which you can find in the root directory of the Installation Wizard.
316
317 You can also launch SALOME Desktop from this page or read the Release
318 Notes file by clicking on the corresponding buttons in the lower part
319 of the page (see \ref modifying_xml "here" and \ref finish_buttons
320 "here" for more information about customizing these buttons).
321
322 <br>
323 \anchor batch_mode_install
324 <h2>Batch mode</h2>
325
326 To launch the Installation Wizard in the batch mode use -\b b (--\b batch)
327 parameter.
328 \n In this mode the GUI wizard is not shown but all the installation
329 status is displayed directly in the console. In the batch mode the
330 user does not have a possibility to change installation settings which
331 are given in the configuration file, except target and temporary
332 directories which can be overridden by the corresponding command line
333 options.
334 \n The only exception is --\b all-from-sources (-\b a) option which enables
335 special installation mode in which all the products (including SALOME
336 modules) are installed from sources, ignoring the default mode defined
337 in the XML configuration file (see \ref installing_products "here" for details).
338
339 \anchor figure_9
340 \image html batchmode.png
341 \n <center><b>Figure 9:</b> Batch mode</center>
342
343 <br>
344 \anchor environment_files
345 <h2>Environment files</h2>
346
347 During the process of installation the script creates some environment
348 files to simplify the procedure of launching SALOME. These shell
349 scripts set all necessary environment variables for all products you
350 have installed. To learn how installation scripts collects the
351 environment, see \ref pick_up_env "here". These files are: \b
352 salome.csh + \b salome.sh in the <b><em>KERNEL module sources</em></b>
353 and <b><em>KERNEL module binaries</em></b> root directories and
354 \b env_products.csh + \b env_products.sh and \b env_build.csh + 
355 \b env_build.sh in the target installation directory.
356
357 \note there is some difference between these files: \b env_build.*
358 files are optimized to be used for building SALOME modules from
359 sources (see \b README file provided with the installation procedure
360 on the CD). The \b env_products.* (and \b salome.*) files are
361 optimized for SALOME launching. The behavior is defined by the
362 environment variable \b ENV_FOR_LAUNCH which is set to \b 0 in
363 env_build.* files and to \b 1 in env_products.* (salome.*) files.
364
365 <br>
366 <hr>
367 \anchor notes_on_check
368 <h2>Notes on <em>check products version</em> procedure</h2>
369
370 Unfortunately there is no exact algorithm to identify the product
371 version under Linux platform. The information in this section gives an
372 idea how the version is checked for the native/preinstalled products
373 (this information refers to the base platform <em>Linux Mandrake
374 10.1</em>; and the same algorithms are used for other platforms).
375
376 The general rule for all products is that the path to the binaries
377 should be set via the \b PATH environment variable, path to the libraries
378 should be set via the \b LD_LIBRARY_PATH variable and the python modules
379 should be available via the \b PYTHONPATH variable.
380
381 \note the information given in this section refers to the prerequisite
382 products for SALOME version 3.2.4.
383
384 <ul>
385 <li>gcc 3.4.1
386 \n\n Version number is checked by <b>gcc -dumpversion</b> command. The \b gcc
387 executable should be in the \b PATH environment variable. Version should
388 be equal to "3.4.1". It is recommended to use native gcc on Mandrake
389 10.1.<br><br>
390 </li>
391 <li>tcl/tk 8.4.5
392 \n\n Version number for \b tcl/tk can be found in tclConfig.sh and
393 tkConfig.sh files (\b TCL_VERSION and \b TK_VERSION variables
394 correspondingly). Version number should be equal to "8.4" (release
395 number is not checked). Set the \b TCLHOME environment variable to the
396 root directory of tcl/tk installation. It is recommended to use native
397 tcl/tk on Mandrake 10.1.<br><br>
398 </li>
399 <li>boost 1.31.0
400 \n\n Version number is defined by \b version.hpp file which is part of
401 the boost distribution. This file defines the \b BOOST_VERSION macro
402 which should be equal to "103100". In addition the existence of boost
403 libraries is checked. Set the \b BOOSTDIR environment variable if you
404 have a preinstalled version of boost.<br><br>
405 </li>
406 <li>Python 2.3.4
407 \n\n Version number is checked by \b python -\b V command. The \b python
408 executable should be in the \b PATH environment variable. Version
409 number should be equal to "2.3.4". It is recommended to use native
410 Python on Mandrake 10.1. Set the \b PYTHONHOME environment variable if
411 you have a preinstalled version of Python.<br><br>
412 </li>
413 <li>Swig 1.3.24
414 \n\n Version number is checked by \b swig -\b version command. The \b swig
415 executable should be in the \b PATH environment variable. Version number
416 should be equal to "1.3.24".
417 <br><br>
418 </li>
419 <li>Qt 3.3.3
420 \n\n Version number is defined by \b qglobal.h file which is part of the
421 Qt distribution. This file defines \b QT_VERSION_STR macro which should be equal to "3.3.3". It is recommended to use native Qt on Mandrake 10.1.
422 \n Set the \b QTDIR environment variable if you have a preinstalled version of qt.<br><br>
423 </li>
424 <li>msg2qm
425 \n\n \b msg2qm is a Qt tool which is used to convert text *.po files
426 to *.qm resource files. Unfortunately this tool is not included to the
427 Linux distribution and provided only in Qt sources package. This is
428 the reason why this tool is supplied with the SALOME Installation
429 Wizard. There is no way to check the version number of msg2qm tool. Just set
430 \b MSG2QM_ROOT environment variable if you have a preinstalled version
431 of msg2qm tool.<br><br>
432 </li>
433 <li>Open CASCADE 6.1.2a2
434 \n\n Version number is defined by \b Standard_Version.hxx file which
435 is part of the Open CASCADE distribution. This file defines \b
436 OCC_VERSION_MAJOR, \b OCC_VERSION_MINOR and \b OCC_VERSION_MAINTENANCE
437 macros which should refer to version 6.1.2. \n Set the CASROOT
438 environment variable if you have a preinstalled version of Open
439 CASCADE.<br><br>
440 </li>
441 <li>qwt 4.2.0/0.4.2
442 \n\n Version number is defined by \b qwt_global.h file which is part of
443 the qwt distribution. This file defines \b QWT_VERSION_STR macro which should be equal to "4.2.0".
444 \n Set the \b QWTHOME environment variable if you have a preinstalled version of qwt.<br><br>
445 </li>
446 <li>hdf 5-1.6.4
447 \n\n Version number is defined by \b libhdf5.settings file which is
448 part of the \b hdf5 distribution. Version should be equal to 1.6.4.
449 \n Set the \b HDF5HOME environment variable if you have a preinstalled
450 version of hdf5.<br><br>
451 </li>
452 <li>med 2.2.3
453 \n\n Unfortunately there is no formal way to check med version
454 number. We check existence of libmed.so.1.0.2 library on the
455 computer. If you have any problem with a preinstalled version of med,
456 please, reinstall it.
457 \n Set the \b MED2HOME environment variable if you have a preinstalled
458 version of med.<br><br>
459 </li>
460 <li>Vtk 4.2.6
461 \n\n Unfortunately there is no formal way to check VTK version
462 number. We just check the existence of \b libvtkCommon.so library on
463 the computer and hope that it is of version we need. If you have any
464 problem with a preinstalled version of Vtk, please, reinstall it.
465 \n Set the \b VTKHOME environment variable if you have a preinstalled
466 version of Vtk.<br><br>
467 </li>
468 <li>OmniORB 4.0.5, OmniORBpy 2.5, OmniNotify 2.1
469 \n\n We just check existence of some omniORB libraries and executable
470 on the computer, like \b libomniORB4.so.0.5, \b _omnipymodule.so.2.4,
471 \b libCOSNotify4.so.0.1 and \b notifd. \n Set the \b OMNIORBDIR
472 environment variable if you have a preinstalled version of omniORB
473 products.<br><br>
474 </li>
475 <li>sip 4.1
476 \n\n Version number is checked by \b sip -\b V command. The \b sip
477 executable should be in the \b PATH environment variable. Version number should be equal to "4.1".
478 \n Set the \b SIPDIR environment variable to the directory where you
479 have sip executable preinstalled.<br><br>
480 </li>
481 <li>PyQt 3.13
482 \n\n Version number is defined by \b pyqtconfig.py Python module file
483 which is part of the \b PyQt distribution. Version should be equal to "3.13".
484 \n Set the \b PYQTDIR environment variable if you have a preinstalled
485 version of PyQt.<br><br>
486 </li>
487 <li>netgen 4.5
488 \n\n Unfortunarely we can't find anything about netgen version. We
489 just check if \b NETGENROOT environment variable is set. \n Set the\b
490 NETGENROOT environment variable if you have a preinstalled version of
491 netgen mesher.<br>
492 \note netgen 4.5 provided with the SALOME installation Wizard has been patched to improve its performance.
493 </li>
494 <li>Numeric 23.7
495 \n\n Version number is checked by <b>python -c 'import Numeric; print
496 Numeric.__version__'</b> command. The \b python executable should be
497 in the \b PATH environment variable and \b Numeric module should be
498 available for the Python (for example it should be in the \b PYTHONPATH environment variable). Version number should be equal to "23.7". If you have any problem with a preinstalled version of Numeric 23.7, please, reinstall it.
499 \n Add the directory where you have a preinstalled version of Numeric
500 package to the the \b PYTHONHOME environment variable.<br><br>
501 </li>
502 <li>graphviz 2.2.1
503 \n\n Version number is checked by \b dot -\b V command. The dot
504 executable should be in the \b PATH environment variable. Version
505 number should be equal to "2.2.1". \n Add \b graphviz bin directory to
506 the the \b PATH environment variable.<br><br>
507 </li>
508 <li>doxygen 1.4.6
509 \n\n Version number is checked by \b doxygen --\b version command. The
510 \b doxygen executable should be in the \b PATH environment
511 variable. Version number should be equal to "1.4.6".<br><br>
512 </li>
513 <li>\b SALOME module \b sources (3.2.4).
514 \n\n For each SALOME module sources package (KERNEL, GUI, GEOM,
515 etc...) the root directory contains file configure.in (configure.ac)
516 which defines version information.\n Set the \b \<MODULE\>_SRC_DIR environment variable for each SALOME \b
517 MODULE sources package installed (where \b MODULE is KERNEL, GUI,
518 GEOM, ...).<br><br>
519 </li>
520 <li>\b SALOME module \b binaries (3.2.4)
521 \n\n For each SALOME module binaries package (KERNEL, GUI, GEOM,
522 etc...) the \b bin/salome directory contains file \b VERSION which
523 defines version information.\n Set \<MODULE\>_ROOT_DIR environment
524 variable for each SALOME \b MODULE binaries package installed (where
525 \b MODULE is KERNEL, GUI, GEOM, ...).<br><br>
526 </li>
527 </ul>
528
529 If you have native products installed to directories different from
530 default ones (not \b /usr/bin, \b /usr/lib...), it is recommended to follow
531 the above mentioned instructions. Or you should properly set \b PATH and
532 \b LD_LIBRARY_PATH variables \em before starting the Installation
533 Wizard. Otherwise the installation script will fail to find
534 preinstalled/native products.
535
536 \note for some native products (e.g. gcc, Python) the rules of version
537 checking are not so strict as described above. Only major and minor
538 version numbers should coincide with the prerequisite. Newer version
539 of the product can also be used. If some native product has version
540 number larger than that required by the installation procedure, the
541 user will be prompted by the warning message like this: "<em>You have
542 newer version of gcc installed on your computer than that is required
543 (3.4.1). Continue?</em>". You can click "\em Yes" to proceed with the
544 installation but in this case you should be aware of what you are
545 doing. SALOME binaries (including other products) are compiled with
546 the predefined prerequisites and most likely can not be run
547 successfully if these products are not found. This can be helpful only
548 if you plan to build all products from sources.
549
550 <br>
551 <hr>
552 \anchor pick_up_env
553 <h2>Pick up the <em>environment</em></h2>
554
555 Please, read the following information carefully . This section
556 describes how the installation procedure generates the environment
557 scripts for the SALOME platform being installed.
558 <br><br>
559 After installing each product shell the script creates a special
560 environment file for the product in its installation folder. The name
561 of the file is generated from the name of product by the following
562 scheme: \b env_<product_name>.sh (for example \b env_Vtk.sh for the
563 Vtk). This file includes all necessary environment settings. At the
564 final step of the installation the script picks up all the settings
565 files and generates two common environment files from them: \b salome.sh
566 and \b salome.csh for \b bash and \b csh shells correspondingly. Such approach
567 helps to save time when reinstalling products and you may not bother
568 about setting all environment variables manually to build/launch
569 SALOME. What you simply need is to source one of these environment
570 files.
571 <br><br>
572 This also concerns those products which are not being installed. For
573 example, you install some SALOME binaries to the directory where you
574 have previously installed other products.  The Installation procedure
575 tries to collect environment files from the target directory if it
576 finds necessary products installed there. If some product is not found
577 in the target directory the corresponding section of
578 \b salome.sh/salome.csh files will be skipped.
579 \n For native products (like \b gcc, \b tcl, etc...) the installation
580 procedure tries to find them first using \b PATH / \b LD_LIBRARY_PATH
581 variables and then in the system default directories (\b /usr/bin,
582 \b /usr/lib etc., depending on the product).
583 <br><br>
584 In any case you may edit \b salome.* files after the installation
585 procedure finishes, if you want.
586
587 \note As it was mentioned \ref environment_files "above" there are
588 other environment files which are generated by the installation
589 procedure: \b env_products.csh + \b env_products.sh and \b env_build.csh +
590 \b env_build.sh. These files can be found in the target installation root
591 directory.
592
593 <br>
594 <hr>
595 \anchor modifying_xml
596 <h2>Modifying <em>XML</em> configuration <em>file</em></h2>
597
598 You can create your own XML configuration file. The Installation
599 Wizard can then take it as a command line argument to provide a list
600 of products you want to install with it. The list of products and some
601 other settings for the Installation Wizard are provided in the XML
602 file. The default file which Installation Wizard looks for if no
603 command line arguments are given, is \b config.xml.
604 \n This section describes the structure of the configuration file. 
605 \n Optional sections/tags are in brackets.
606
607 \code
608 <document> 
609     [ <config [ version=<install_wizard_version> ] 
610               [ caption=<install_wizard_caption> ] 
611               [ copyright=<install_wizard_copyright>  ] 
612               [ license=<install_wizard_license_info> ] 
613               [ os=<target_platform> ]
614       /> 
615     ] 
616     [ <path   [ targetdir=<target_directory> ] 
617               [ tempdir=<temp_directory>     ]
618       /> 
619     ] 
620     [ <button   label=<button_label>      
621               [ tooltip=<button_tooltip> ] 
622                 script=<button_script>    
623               [ disable=<disable_flag>   ]
624       /> 
625     ] 
626     [ <button ... 
627       />
628     ] 
629     [ <product  name=<product_name> 
630                 version=<product_version> 
631               [ context=<product_context>         ]
632               [ description=<product_description> ]
633                 install=<installation_mode> 
634                 supported=<supported_installation_modes> 
635               [ disable=<disable_flag>            ]
636               [ pickupenv=<pickup_env_flag>       ]
637                 dependancies=<list_of_prerequisites> 
638                 installdiskspace=<install_disk_space> 
639                 temporarydiskspace=<tmp_disk_space> 
640                 script=<installation_script_name>
641       /> 
642     ] 
643     [ <product ... 
644       /> 
645     ]
646     ...
647 </document>
648 \endcode
649
650 <b>\<config\> section</b>
651 \n\n This is an optional section; it provides general information about
652 the Installation Wizard itself.
653 <br><br>
654 Attributes:
655 <ul>
656 <li><b>version</b>
657 \n\n The application version number to be shown in the caption.<br><br>
658 </li>
659 <li><b>caption</b>
660 \n\n The application main window caption - if this string contains
661 '\%1' text the title will contain the version number in this place (see
662 above).<br><br>
663 </li>
664 <li><b>copyright</b>
665 \n\n The application copyright information (shown in the first
666 page).<br><br>
667 </li>
668 <li><b>license</b>
669 \n\n The application license information (shown in the first
670 page).<br><br>
671 </li>
672 <li><b>os</b>
673 \n\n This parameter defines the directory (relative from
674 ./Products/BINARIES) where the Installation Wizard will search
675 precompiled binaries packages. If this tag is not provided, binaries
676 packages are looked for in the ./Products/BINARIES directory.<br><br>
677 </li>
678 </ul>
679
680 <b>\<path\> section</b>
681 \n\n This is an optional section; it defines default installation
682 directories.
683 <br><br>
684 Attributes:
685 <ul>
686 <li><b>targetdir</b>
687 \n\n The target directory - the path to the directory where products
688 should be installed.<br><br>
689 </li>
690 <li><b>tempdir</b>
691 \n\n The temporary directory - the path to the directory for the
692 temporary files.<br><br>
693 </li>
694 </ul>
695
696 <b>\<product\> section</b>
697 \n\n This section describes product to be installed with the
698 Installation Wizard. The XML file should include a \<product\> section
699 for each product to be installed. The products appear in the tree view
700 and are installed in the order they are described in the configuration
701 file. It is recommended (but not obligatory) to define native products
702 at the top of the list before all other products.
703 <br><br>
704 Attributes:
705 <ul>
706 <li><b>name</b>
707 \n\n Product name.<br><br>
708 </li>
709 <li><b>version</b>
710 \n\n Product version.<br><br>
711 </li>
712 <li><b>description</b>
713 \n\n Product description (optional).<br><br>
714 </li>
715 <li><b>context</b>
716 \n\n Context (optional). The possible values are '<b>salome
717 sources</b>', '<b>salome binaries</b>' and '<b>prerequisite</b>'
718 (several contexts can be given separated by ":" symbol).<br><br>
719 </li>
720 <li><b>supported</b>
721 \n\n Supported modes of installation. Several modes can be separated
722 by comma. Possible value are: <em>install sources, install binaries, use
723 native</em>. The Installation script should contain the corresponding
724 functions for each of the supported installation modes (see
725 \ref installation_scripts "here").<br><br>
726 </li>
727 <li><b>install</b>
728 \n\n Default (starting) installation mode.<br><br>
729 </li>
730 <li><b>disable</b>
731 \n\n If this optional flag has 'true' value, the corresponding product
732 will not appear in the list of products and will not be
733 installed.<br><br>
734 </li>
735 <li><b>pickupenv</b>
736 \n\n This flag points that pickup environment procedure should be
737 performed for this product. If this flag equal to 'true',  salome.sh
738 and salome.csh files will  be created in the product installation
739 directory. Usually this option is set to true for SALOME KERNEL module
740 sources and binaries package. This is an optional key, default value
741 is 'false'.<br><br>
742 </li>
743 <li><b>dependancies</b>
744 \n\n List of prerequisite products, which are necessary to build this
745 product, separated by comma.<br><br>
746 </li>
747 <li><b>installdiskspace</b>
748 \n\n Total amount of space (integer, in Kbytes), which the product
749 occupies on the hard drive after the installation.<br><br>
750 </li>
751 <li><b>temporarydiskspace</b>
752 \n\n Disk space (integer, in Kbytes) for temporary files, which is
753 necessary to build the product from the sources.<br><br>
754 </li>
755 <li><b>script</b>
756 \n\n The installation script name. This script is in charge of the
757 installation of the product. It is called automatically by the
758 Installation Wizard when necessary from the main program. 
759 See the \ref installation_scripts "next section" for more information.<br><br>
760 </li>
761 </ul>
762
763 <b>\<button\> section</b>
764 \n\n This is an optional section. It allows customization of the last
765 "Finish installation" page of the Installation Wizard by adding one or
766 more buttons in the lower part of the wizard's window. The script
767 which is attached to each such button, can perform some specific
768 action, for example, launch the application or show the Release Notes
769 file by using an external program. See \ref finish_buttons "here" for
770 more details about writing scripts.<br><br>
771 Attributes:
772 <ul>
773 <li><b>label</b>
774 \n\n This is the button text.<br><br>
775 </li>
776 <li><b>tooltip</b>
777 \n\n The button tooltip (optional).<br><br>
778 </li>
779 <li><b>script</b>
780 \n\n The script attached to the button.<br><br>
781 </li>
782 <li><b>disable</b>
783 \n\n If this optional flag has 'true' value, the corresponding button
784 will not appear in the "<em>Finish installation</em>" page - the section of XML
785 file is silently ignored.<br><br>
786 </li>
787 </ul>
788
789 \note If you add new products to be installed with Installation
790 Wizard, you should also provide installation script for this
791 product. See the next section for more details.
792
793 <br>
794 <hr>
795 \anchor installation_scripts
796 <h2>Implementing <em>installation scripts</em> for the new products</h2>
797
798 When you want some product to be installed with the Installation
799 Wizard, you should add its description \ref modifying_xml "to the configuration file"
800 and create the installation script, following the rules described in this section.
801
802 There are some obligatory functions which should be implemented in
803 this installation script. These functions are automatically called by
804 the master installation script or/and its GUI shell when it is
805 necessary. \n File \b common.sh contains some service functions which can
806 be used in your installation script, like \b make_env(), \b make_dir(),
807 \b try_existing(), \b sort_path(), \b find_in_path(), etc.
808
809 <ul>
810 <li><b>check_version()</b>
811 \n\n This function allows to check the version of the product already
812 installed on the computer. It should try to find the product (native
813 or preinstalled in the target directory) and check its version. This
814 helps to avoid unnecessary reinstallation. This is an internal
815 function and is not called from the master installation
816 script.<br><br>
817 </li>
818 <li><b>try_native()</b>
819 \n\n This function is called when the 'use native' installation mode
820 is selected by the user. The function should try to find a native
821 version of the product and define possibility of its use. It should
822 create the environment file for the product in the temporary directory
823 (see also the description of \b print_env() function). It is not
824 necessary to implement this function if you do not provide native mode
825 installation.<br><br>
826 </li>
827 <li><b>install_source()</b>
828 \n\n This function is called when the 'install sources' installation
829 mode is selected by the user. The function is responsible for building
830 the product from the sources package. It should create the environment
831 file for the product in the temporary directory (see also description
832 of \b print_env() function). It is not necessary to implement this
833 function if you do not provide sources mode installation.<br><br>
834 </li>
835 <li><b>install_source_and_build()</b>
836 \n\n This function is called when SALOME module is installed and the
837 --\b all-from-sources (-\b a) option is used (<em>"Build SALOME sources"</em>
838 check box in GUI mode). This function should be used to unpack SALOME
839 sources package and then call the build/install procedure for it.
840 For more details please refer to the \ref installing_products "this"
841 and \ref gui_mode_install "this" sections for more details.<br><br>
842 </li>
843 <li><b>install_binary()</b>
844 \n\n This function is called when the <em>'install binaries'</em> installation
845 mode is selected by the user. The function is responsible for the
846 extracting of the product from the binaries package. It should create
847 environment for the product in the temporary directory (see also
848 description of \b print_env() function). It is not necessary to implement
849 this function if you do not provide binaries mode
850 installation.<br><br>
851 </li>
852 <li><b>try_preinstalled()</b>
853 \n\n This function is called when the 'not install' installation mode
854 is selected by the user. In this case the script should inspect the
855 target directory to try to find an already preinstalled product, pick
856 up and check the environment from there. See \ref pick_up_env "here" for more
857 details.<br><br>
858 </li>
859 <li><b>print_env()</b>
860 \n\n This function is in charge of creating the environment script. It
861 should create a file with name \b env_<product_name>.sh in the temporary
862 directory and then copy it into the product installation
863 directory. The file should contain all necessary environment variables
864 settings for the product. It will be collected during the
865 'pick-up-environment' procedure.<br><br>
866 </li>
867 <li><b>pickup_env()</b>
868 \n\n This procedure corresponds to the \b pickupenv tag of the
869 configuration xml file (see previous section). It should call the
870 \b make_env procedure to perform the pick-up environment procedure for
871 the product.<br><br>
872 </li>
873 </ul>
874
875 The calling signature of the product installation script is the following: 
876 <b>\<product_script_name\> \<function_name\> \<temp_folder\>
877 \<products_directory\> \<target_directory\> \<dependancies\>
878 \<product_name\></b>
879 \n\n where \n\n
880 <b>\<product_script_name\></b> - installation script name (described in the
881 configuration xml file);\n
882 <b>\<function_name\></b> - the name of function, corresponding to the selected
883 installation mode: \em try_native, \em install_source, \em install_binary or
884 \em try_preinstalled;\n
885 <b>\<temp_folder\></b> - temporary files directory;\n
886 <b>\<products_directory\></b> - directory where the sources/binaries package
887 can be found. You should provide the sources package in the
888 <em>\<Install_Wizard_root_directory\>/Products/SOURCES</em> directory and
889 binaries package in the
890 <em>\<InstallWizard_root_directory\>/Products/BINARIES/\<os_version\></em>, where
891 \<os_version\> is the target platform description, which appears in the
892 corresponding section of the \ref modifying_xml "configuration xml file";
893 <em>\<target_directory\></em> - root target directory where the product should be installed to; 
894 <em>\<dependancies\></em> - single-quoted list of prerequisite products, separated by space; 
895 <em>\<product_name\></em> - product name itself.
896
897 \b Example:
898 \n <em>med-2.2.3.sh install_binary /tmp/work
899 ./Products/BINARIES/Mandrake10.1 /usr/salome 'gcc Hdf' med</em>
900
901 Copy the created script into the
902 <em>\<Install_Wizard_root_directory\>/config_files</em> sub-directory where all
903 installation scripts are stored. Installation Wizard will
904 automatically search and call your script during the installation
905 procedure.
906
907 <br>
908 <hr>
909 \anchor finish_buttons
910 <h2>Customizing <em>Readme page</em> buttons</h2>
911
912 The Installation Wizard allows customizing the look-n-feel of the last
913 <em>"Finish installation"</em> page. If you want to add one or more buttons to
914 this page in order to perform some specific actions at the end of the
915 installation (for example, to show the Release Notes file by using
916 Open Office) you can put an additional section to the XML
917 configuration file. This is the \b \<button\> section (see 
918 \ref modifying_xml "here" for more details).
919
920 To implement the action which will be performed when the user clicks
921 the button, you need to create a script and put it to the
922 <em>\<Install_Wizard_root_directory\>/config_files</em> directory.
923 \n There are some obligatory functions which should be implemented in
924 this script. These functions are automatically called by the
925 Installation Wizard GUI.
926
927 <ul>
928 <li><b>check_enabled()</b>
929 \n\n This procedure is called by the Installation Wizard when the
930 <em>"Finish installation"</em> page is displayed and the status of the buttons
931 should be modified according to the installation options. This
932 procedure should return \b 0 if the corresponding action can be performed
933 and, thus, the button should become enabled. Otherwise, it should
934 return \b 1 - in this case the corresponding button will be
935 disabled.<br><br>
936 </li>
937 <li><b>execute()</b>
938 \n\n This procedure is invoked when the user clicks the button. This
939 procedure should return \b 0 if the corresponding action is done
940 successfully and \b 1 if any error occurs.<br><br>
941 </li>
942 </ul>
943
944 The calling signature of the script is the following:
945 \n <b>\<product_script_name\> \<function_name\> \<target_directory\>
946 \<temp_folder\></b>
947 \n\n where \n\n
948 \b \<product_script_name\> - the script name itself (retrieved from the XML configuration xml file); 
949 \n \b \<function_name\> - the name of function; 
950 \n \b \<target_directory\> - root target directory where the product is installed to; 
951 \n \b \<temp_folder\> - temporary files directory;
952
953 \note The standard Installation Wizard buttons "Launch SALOME" and
954 "Release Notes" are implemented with this feature. Refer to scripts
955 \b start_salome.sh and \b release_notes.sh for sample implementation.
956
957 \note Any button (even standard) can be ignored by the Installation
958 Wizard if the attribute \b \<disable\> in the XML configuration file is set
959 to the "true" value.
960
961 */