Previous Topic: Specify Files for the PIF Product MERCHANTNext Topic: Change the Installation Path of the PIF Product MERCHANT


Add a Procedure to the PIF Product MERCHANT

The PIF product MERCHANT must create the database tables after the product files have been installed. Due to the specifications of the product MERCHANT, the user-written script file create_tables.sh will do this.

The script file properties are specified in the component section, as follows:

@COMPONENT:
#chead: component1 ;
#dir: bin , root , sys , drwxrwxrwx ;
#file: bin/merchant.jar , /myhomepath/src/merchant.jar, root , sys , -r—r—r-- , 1 ;
#file: bin/run_merchant.sh , /myhomepath/scripts/run_merchant.sh, root , sys , -r-xr-xr-x , 1 ;
#slink: /usr/bin/run_merchant.sh , bin/run_merchant.sh ;
#file: bin/create_tables.sh , /myhomepath/scripts/create_tables.sh , root , sys , -r-xr-xr-x , 1 ;
@ENDCOMP:
#file: bin/create_tables.sh , /myhomepath/scripts/create_tables.sh , root , sys , -r-xr-xr-x , 1 ;

The script file create_tables.sh should be installed in the target directory bin. The source directory for the script file is /myhomepath/scripts. Owner is root, group is sys, read (r) and execute (x) access is granted for all users, and the file type is 1 meaning standard file.

The script execution time is specified in the product information section, as follows:

@PRODUCT:
#phead: MERCHANT , 2.1.0.0 ;
#sys: Any ;
#locale: ENU ;
#comment: This is an example for a PIF product ;
#ppath: /home/merchant ;
#pdep: Ingres , 4.0.0.0 ,  >= ;
#postinit: bin/create_tables.sh ;
@ENDPROD:
#postinit: bin/create_tables.sh ;

The keyword #postinit: determines that the script create_table.sh is executed after the product files have been installed.

To specify the script file create_table.sh through the command line

  1. Copy the script file create_tables.sh into the /tmp/merchant/scripts folder.
  2. Execute the pifproto command as follows:
    pifproto -n MERCHANT -v 2.1.0.0 -a Any -d /tmp/merchant -b /home/merchant -i scripts/create_tables.sh -o
    

    Through the -i option the post-install procedure is defined. The -o switch enables overwriting the existing prototype file of the product MERCHANT.

To add a Procedure through the GUI

  1. Run the smgui command to launch the Packager GUI.
  2. Select the product MERCHANT in the Project pane.
  3. Select component1 on the Components tab.
  4. Choose the File list property sheet.
  5. Right-click within the File list property sheet and select Insert from the context menu.

    The Choose source file dialog appears.

  6. Browse for the file create_tables.sh and click Choose.
  7. In the file list, double-click the new file. On the appearing dialog, select the Access property sheet, check all execute check boxes, uncheck the write check boxes, and click Change.
  8. Select the product MERCHANT in the Project pane.
  9. Select the Procedures tab in the work pane.
  10. Right-click in the procedures list and select Add internal procedure from the context menu.

    The Internal procedure dialog appears.

  11. Specify or select the following values:

    Execution time: post installation

    Procedure file: create_tables.sh

  12. Click Add.

    The procedure appears in the procedures list and the properties are incorporated in the prototype file of the PIF product MERCHANT.