home *** CD-ROM | disk | FTP | other *** search
/ Oracle Video Server 3.0.3.1 / OVS_3031_NT.iso / nt_x86 / pkg / prog.vrf < prev    next >
Encoding:
Text File  |  1997-08-13  |  8.8 KB  |  246 lines

  1. /*****************************************************************************
  2.   Copyright (c) Oracle Corporation 1996.  All Rights Reserved
  3.  
  4.   NAME
  5.     prog.vrf - Package verification script - multiple selection
  6.  
  7.   DESCRIPTION
  8.     This script displays a selection list of products for a package and
  9.     allows the user to select multiple products to be installed.
  10.  
  11.     The list of products in the package is determined by executing
  12.     a 'product_name.PKG' script.  (Note: product_name must be at most 8
  13.     characters.)  This PKG script should set the following variables:
  14.  
  15.       products           - The list of products to be diplayed in the custom package dialog
  16.       dflt_products      - The list of custom package products to be selected by default
  17.       pkg_products       - The list of products to be displayed in the regular package dialog
  18.       dflt_pkg_products  - The list of regular pkg products displayed by default
  19.       selection_title    - The title (content string) for the selection dialog
  20.       selection_prompt   - The prompt for the selection dialog
  21.       selection_help     - The help message for the selection dialog
  22.  
  23.     If a 'product_name.PKG' script does not exist, the list of products
  24.     will be determined by the child products in the PRD file.
  25.  
  26.   OWNER
  27.     David Tom
  28.  
  29.   MODIFIED    DD-MMM-YY  Reason
  30.     mmckerle     AUG-97  Modified for 7.3.4 Production Release of Prog/2000 package
  31.     dtom      21-AUG-95  Add product to selected_products list only once
  32.     dtom      01-AUG-95  Created
  33. *****************************************************************************/
  34.  
  35. {
  36.   vrf_ratchet = "1.0.0.0.0";
  37.  
  38.   { doit = execute("%installer_home%\%operating_system%.vrf"); }
  39.   [
  40.     'UNBOUND_VARIABLE:
  41.       {
  42.         required_version = product_version(ntinstver);
  43.         temp = explode(required_version,".");
  44.         required_version = implode(list(first(temp),first(rest(temp)),
  45.                                         first(rest(rest(temp))),
  46.                                         first(rest(rest(rest(temp))))),".");
  47.         signal('failure,instantiate(nls("instver_too_early1","The version of the Installer currently running is %%installer_version%%. The installation you have chosen requires version %%required_version%% or later. Please run version %%required_version%% or later in order to perform this installation.")));
  48.       }
  49.   ]
  50.  
  51.   /*------------------------------------------------------------------------*/
  52.  
  53.   if (doit)
  54.   {
  55.     prod_label = product_interface_label(current_product);
  56.     prod_name  = product_name(current_product);
  57.  
  58.     no_products_msg   = nls("no_products_msg",   "There are no items available to install under this selection.  Choose OK to continue.");
  59.     no_products_help  = nls("no_products_help",  "No items are available for installation under your selection.  Choose OK to continue.");
  60.     no_selection_msg  = nls("no_selection_msg",  "No items were selected to be installed.  Choose OK to continue without installing any items, or BACK to select an item to install.");
  61.     no_selection_help = nls("no_selection_help", "No items were selected to be installed.  If you wish to install an item, choose BACK to return to the  selection list.  Choose OK to continue without installing any items.");
  62.  
  63.  
  64.     /* Determine which type of install - Custom Install has a different behaviour */
  65.     {
  66.      install_type = install_type;
  67.     }
  68.      [
  69.       'UNBOUND_VARIABLE:
  70.         install_type = "Custom Installation";
  71.      ]
  72.  
  73.     {
  74.      if(install_type == install_type_custom)
  75.        custom_install = TRUE;
  76.      else
  77.        custom_install = FALSE;
  78.     }
  79.      [
  80.       'UNBOUND_VARIABLE: custom_install = TRUE;
  81.      ]
  82.  
  83.  
  84.  
  85.     /*----Default list of products------------------------------------------*/
  86.  
  87.     products = all_child_products(current_product);
  88.     sort(products);
  89.  
  90.     dflt_products = list();
  91.  
  92.     selection_title  = nls("selection_title",  "%%prod_label%%");
  93.     selection_prompt = nls("selection_prompt", "Please select the %%prod_label%% you wish to install:");
  94.     selection_help   = nls("selection_help",   "Select the %%prod_label%% you wish to install by selecting the desired item.  Multiple items may be selected.%carriage_return%%carriage_return%Single items may be selected by clicking on the item with the mouse or by moving the cursor to the item and using the space bar to select the item. Multiple items may be selected by holding the CTRL key and clicking on the item with the mouse.");
  95.  
  96.     /*----Override if PKG file found----------------------------------------*/
  97.  
  98.     { execute("%prod_name%.pkg"); }
  99.     [ 'FILE_NOT_FOUND: continue(); ]
  100.  
  101.     /*----Check if product list is empty------------------------------------*/
  102.  
  103.     if (empty(products))
  104.     {
  105.       information_dialog(
  106.             instantiate(no_products_msg),
  107.             prod_label,
  108.             instantiate(no_products_help),
  109.             'NO_CANCEL );
  110.       return(0);
  111.     }
  112.  
  113.     /*----Build list of product labels--------------------------------------*/
  114.  
  115.     labels           = list();
  116.     dflt_labels      = list();
  117.     pkg_labels       = list();   # the list of labels installed in the regular pkg_install
  118.     dflt_pkg_labels  = list();   # the list of labels selected by default from the above list
  119.     tmp_products = products;
  120.  
  121.     while (not(empty(tmp_products)))
  122.     {
  123.       prod = first(tmp_products);
  124.  
  125.       label = product_interface_label(prod);
  126.       ver   = product_version(prod);
  127.       entry = "%label% %ver%";
  128.       add(labels,entry);
  129.  
  130.       # pkg_labels contains only those products which should be displayed in the regular pkg_install
  131.       if(member(pkg_products, prod))
  132.       {
  133.          add(pkg_labels, entry);
  134.          add(dflt_pkg_labels, entry);
  135.       }
  136.  
  137.       if (member(dflt_products,prod))
  138.         add(dflt_labels,entry);
  139.  
  140.       tmp_products = rest(tmp_products);
  141.     }
  142.  
  143.     /*----Display multiple selection dialog---------------------------------*/
  144.  
  145.     mark
  146.     {
  147.       /*--If single item in list, default to that item----------------------*/
  148.       if (empty(rest(labels)))
  149.         products_chosen = labels;
  150.  
  151.       /*--else display selection dialog-------------------------------------*/
  152.       else if(not(custom_install))
  153.          products_chosen = multiple_selection_dialog(
  154.                               instantiate(selection_prompt),
  155.                               pkg_labels,
  156.                               dflt_pkg_labels,
  157.                               instantiate(selection_title),
  158.                               instantiate(selection_help));
  159.       else
  160.         products_chosen = multiple_selection_dialog(
  161.                              instantiate(selection_prompt),
  162.                              labels,
  163.                              dflt_labels,
  164.                              instantiate(selection_title),
  165.                              instantiate(selection_help) );
  166.  
  167.       /*--Check if an item was chosen---------------------------------------*/
  168.       if (empty(products_chosen))
  169.       mark
  170.       {
  171.         information_dialog(
  172.               instantiate(no_selection_msg),
  173.               prod_label,
  174.               instantiate(no_selection_help),
  175.               'NO_CANCEL );
  176.         return(0);
  177.       }
  178.     }
  179.  
  180.     /*----Add products to selected products list and verify-----------------*/
  181.  
  182.     tmp_labels   = labels;
  183.     tmp_products = products;
  184.     totalSize = 0;
  185.  
  186.     while (not(empty(tmp_labels)))
  187.     {
  188.       label = first(tmp_labels);
  189.       prod  = first(tmp_products);
  190.  
  191.       if (member(products_chosen,label))
  192.       {
  193.          if (not(member(selected_products,prod)))
  194.          {
  195.             add(selected_products,prod);
  196.             totalSize = totalSize + verify(prod);
  197.          }
  198.       }
  199.  
  200.       tmp_labels   = rest(tmp_labels);
  201.       tmp_products = rest(tmp_products);
  202.     }
  203.  
  204.  
  205.    # If this is not a custom install, go ahead and add the other products explicitly displayed.
  206.    if(not(custom_install))
  207.    {
  208.       tmp_labels   = labels;
  209.       tmp_products = products;
  210.  
  211.       while (not(empty(tmp_labels)))
  212.       {
  213.          label = first(tmp_labels);
  214.          prod  = first(tmp_products);
  215.  
  216.          if(not(member(selected_products, prod)))  # to ensure that a product is not added twice
  217.          {
  218.             if(not(member(pkg_products, prod)))           # to ensure that a product not selected in the dialog is not added
  219.             {
  220.                add(selected_products, prod);
  221.                totalSize = totalSize + verify(prod);
  222.             }
  223.          }
  224.  
  225.          tmp_labels   = rest(tmp_labels);
  226.          tmp_products = rest(tmp_products);
  227.       }
  228.    }
  229.  
  230.  
  231.  
  232.     /*----Return total size-------------------------------------------------*/
  233.  
  234.     return(totalSize);
  235.  
  236.   }
  237.  
  238.   /*----Do not install------------------------------------------------------*/
  239.  
  240.   else
  241.   {
  242.     refresh_map_file = FALSE;
  243.     return(0);
  244.   }
  245. }
  246.