/***************************************************************************** Copyright (c) Oracle Corporation 1996. All Rights Reserved NAME pkg.vrf - Package verification script - multiple selection DESCRIPTION This script displays a selection list of products for a package and allows the user to select multiple products to be installed. The list of products in the package is determined by executing a 'product_name.PKG' script. (Note: product_name must be at most 8 characters.) This PKG script should set the following variables: products - The list of products dflt_products - The list of products to be selected by default selection_title - The title (content string) for the selection dialog selection_prompt - The prompt for the selection dialog selection_help - The help message for the selection dialog If a 'product_name.PKG' script does not exist, the list of products will be determined by the child products in the PRD file. OWNER David Tom MODIFIED DD-MMM-YY Reason jewillia 25-MAY-00 do not display message if part of the packaged install jewillia 25-MAY-00 if nothing to install then doit = false, remove from pfi dtom 21-AUG-95 Add product to selected_products list only once dtom 01-AUG-95 Created *****************************************************************************/ { vrf_ratchet = "1.0.0.0.0"; { doit = execute("%installer_home%\%operating_system%.vrf"); } [ 'UNBOUND_VARIABLE: { required_version = product_version(ntinstver); temp = explode(required_version,"."); required_version = implode(list(first(temp),first(rest(temp)), first(rest(rest(temp))), first(rest(rest(rest(temp))))),"."); 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."))); } ] /*------------------------------------------------------------------------*/ if (doit) { prod_label = product_interface_label(current_product); prod_name = product_name(current_product); no_products_msg = nls("no_products_msg", "There are no items available to install under this selection. Choose OK to continue."); no_products_help = nls("no_products_help", "No items are available for installation under your selection. Choose OK to continue."); 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."); 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."); /*----Default list of products------------------------------------------*/ products = all_child_products(current_product); /* this call sometimes returns duplicates !! remove them */ sort(products,TRUE); dflt_products = list(); selection_title = nls("selection_title", "%%prod_label%%"); selection_prompt = nls("selection_prompt", "Please select the %%prod_label%% you wish to install:"); 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."); /*----Override if PKG file found----------------------------------------*/ { execute("%prod_name%.pkg"); } [ 'FILE_NOT_FOUND: continue(); ] /*----Check if product list is empty------------------------------------*/ if (empty(products)) { /* [jewillia] */ /* do not display message if part of the packaged install */ if (not(bootstrap)) information_dialog( instantiate(no_products_msg), prod_label, instantiate(no_products_help), 'NO_CANCEL ); /* [jewillia] if nothing to install then doit = false, remove from pfi */ extract(products_for_installation, current_product); doit = FALSE; return(0); } /*----Build list of product labels--------------------------------------*/ labels = list(); dflt_labels = list(); /* stillhaving problems with duplicates in the list so construct the copy in a different manner */ /* tmp_products = products; */ tmp_products =list(); union(tmp_products,products); while (not(empty(tmp_products))) { prod = first(tmp_products); label = product_interface_label(prod); ver = product_version(prod); entry = "%label% %ver%"; add(labels,entry); if (member(dflt_products,prod)) add(dflt_labels,entry); tmp_products = rest(tmp_products); } /*----Display multiple selection dialog---------------------------------*/ mark { /*--If single item in list, default to that item----------------------*/ if (empty(rest(labels))) products_chosen = labels; /*--else display selection dialog-------------------------------------*/ else products_chosen = multiple_selection_dialog( instantiate(selection_prompt), labels, dflt_labels, instantiate(selection_title), instantiate(selection_help) ); /*--Check if an item was chosen---------------------------------------*/ if (empty(products_chosen)) mark { information_dialog( instantiate(no_selection_msg), prod_label, instantiate(no_selection_help), 'NO_CANCEL ); /* [jewillia] if nothing to install then doit = false, remove from pfi */ extract(products_for_installation, current_product); doit = FALSE; return(0); } } /*----Add products to selected products list----------------------------*/ tmp_labels = labels; tmp_products = products; while (not(empty(tmp_labels))) { label = first(tmp_labels); prod = first(tmp_products); if (member(products_chosen,label)) { if (not(member(selected_products,prod))) add(selected_products,prod); } tmp_labels = rest(tmp_labels); tmp_products = rest(tmp_products); } /*----Determine size based on products choosen--------------------------*/ total_size = 0; tmp_labels = labels; tmp_products = products; while (not(empty(tmp_labels))) { label = first(tmp_labels); prod = first(tmp_products); if (member(products_chosen,label)) total_size = total_size + verify(prod); tmp_labels = rest(tmp_labels); tmp_products = rest(tmp_products); } /*----Return total size-------------------------------------------------*/ return(total_size); } /*----Do not install------------------------------------------------------*/ else { refresh_map_file = FALSE; return(0); } }