/* Copyright (c) Oracle Corporation 1995. All Rights Reserved */ /******************************************************************************* NAME toolsdei.usr - External script for Tools Products' Deinstallation scripts DESCRIPTION This external script is a Library of Routines (like Functions/Procedures). Each Routine is a block of code that is being used by more than one Installer script. Each routine is uniquely identified by a global variable that needs to be set by the product script calling this script, and a roman numeral (for ease of locating the desired Routine). Following is a list of all the routines in this Library: I. SET_DEINSTALL_VARIABLES. II. CREATE_LABEL Create a label with the product name, version (used by all dei scripts) III. GET_DEINSTALLATION_PATH Set up deinstallation path (used by all dei scripts - unless path is preset) IV. DEINSTALL_PARENT Deinstall parent if no other child product exists (used by all child scripts) V. UNREFERENCE_DEINSTALL_CHILD_PRODUCTS Unreference and remove all child products if parent product was selected. VI. DEINSTALL_COMPONENTS Same as "Unreference_Deinstall_Child_Products" but also removes all cross-referencing between components & parent. (used by parent scripts) VII. UNREFERENCE_DEPENDENCIES Unreference product dependencies. (generally only used by parent scripts) OWNER Rajesh Bansal MODIFIED MM/DD/YY REASON aharriso 01/02/96 Added FILE_NOT_FOUND handler for TRANSLATE in win32 scripts. aharriso 08/29/95 Added Unreference_dependencies and deinstall_components. rbansal 08/07/95 Created ********************************************************************************/ { /**************************************************************** I. SET_DEINSTALL_VARIABLES Set the directory separator according to the current operating system. Specific to R2.0 *****************************************************************/ if (EXECUTE_SCRIPT == "SET_DEINSTALL_VARIABLES") { RSF_PRODUCT_STRING = "w32rsf73"; PLUS_PRODUCT_STRING = "w32plus33"; dir_separator = "\"; /********************************************** Set variables for program groups for .MAP files ***********************************************/ developer_icon = nls("developer_icon","Forms & Reports"); d2k_icon = developer_icon; D2K60_COMPONENTS = nls("D2K60_COMPONENTS","Oracle %d2k_icon% 6i Comps"); D2K60_ADMINISTRATION = nls("D2K60_ADMINISTRATION","Oracle %d2k_icon% 6i Admin"); D2KOR60_ADMINISTRATION = nls("D2KOR60_ADMINISTRATION","Oracle Reports 6i Admin"); D2KIF60_ADMINISTRATION = nls("D2KIF60_ADMINISTRATION","Oracle Forms 6i Admin"); D2K60_DEMOS = nls("D2K60_DEMOS","Oracle %d2k_icon% 6i Demos"); D2K60_DOCS = nls("D2K60_DOCS","Oracle %d2k_icon% 6i Doc"); D2K60_DRIVERS = nls("D2K60_DRIVERS","Oracle %d2k_icon% 6i Direct Drivers"); D2K60_GROUP = nls("D2K60_GROUP","Oracle %d2k_icon% 6i"); D2KOR60_GROUP = nls("D2KOR60_GROUP","Oracle Reports 6i"); D2KIF60_GROUP = nls("D2KIF60_GROUP","Oracle Forms 6i"); OLAP22_CLIENT = nls("OLAP22_CLIENT","Oracle Olap Client 2.2"); D2K60_COMPONENTS_OLD = nls("D2K60_COMPONENTS_OLD","Oracle Developer 60 Comps"); D2K60_ADMINISTRATION_OLD = nls("D2K60_ADMINISTRATION_OLD","Oracle Developer 60 Admin"); D2K60_DEMOS_OLD = nls("D2K60_DEMOS_OLD","Oracle Developer 60 Demos"); D2K60_DOCS_OLD = nls("D2K60_DOCS_OLD","Oracle Developer 60 Doc"); D2K60_DRIVERS_OLD = nls("D2K60_DRIVERS_OLD","Oracle Developer 60 Direct Drivers"); D2K60_GROUP_OLD = nls("D2K60_GROUP_OLD","Oracle Developer 60"); D2K60_COMPONENTS ="%D2K60_COMPONENTS%%oracle_home_group%"; D2K60_ADMINISTRATION = "%D2K60_ADMINISTRATION%%oracle_home_group%"; D2KOR60_ADMINISTRATION = "%D2KOR60_ADMINISTRATION%%oracle_home_group%"; D2KIF60_ADMINISTRATION = "%D2KIF60_ADMINISTRATION%%oracle_home_group%"; D2K60_DEMOS = "%D2K60_DEMOS%%oracle_home_group%"; D2K60_DOCS = "%D2K60_DOCS%%oracle_home_group%"; D2K60_DRIVERS = "%D2K60_DRIVERS%%oracle_home_group%"; D2K60_GROUP = "%D2K60_GROUP%%oracle_home_group%"; D2KOR60_GROUP = "%D2KOR60_GROUP%%oracle_home_group%"; D2KIF60_GROUP = "%D2KIF60_GROUP%%oracle_home_group%"; OLAP22_CLIENT = "%OLAP22_CLIENT%%oracle_home_group%"; OPEN2K60_DOCS = D2K60_DOCS; D2K60_COMPONENTS_NEW =D2K60_COMPONENTS; D2K60_ADMINISTRATION_NEW = D2K60_ADMINISTRATION; D2KOR60_ADMINISTRATION_NEW = D2KOR60_ADMINISTRATION; D2KIF60_ADMINISTRATION_NEW = D2KIF60_ADMINISTRATION; D2K60_DEMOS_NEW = D2K60_DEMOS; D2K60_DOCS_NEW = D2K60_DOCS; D2K60_DRIVERS_NEW = D2K60_DRIVERS; D2K60_GROUP_NEW = D2K60_GROUP; D2KOR60_GROUP_NEW = D2KOR60_GROUP; D2KIF60_GROUP_NEW = D2KIF60_GROUP; D2K60_COMPONENTS_OLD ="%D2K60_COMPONENTS_OLD%%oracle_home_group%"; D2K60_ADMINISTRATION_OLD = "%D2K60_ADMINISTRATION_OLD%%oracle_home_group%"; D2K60_DEMOS_OLD = "%D2K60_DEMOS_OLD%%oracle_home_group%"; D2K60_DOCS_OLD = "%D2K60_DOCS_OLD%%oracle_home_group%"; D2K60_DRIVERS_OLD = "%D2K60_DRIVERS_OLD%%oracle_home_group%"; D2K60_GROUP_OLD = "%D2K60_GROUP_OLD%%oracle_home_group%"; /**********************************************/ /********************************** Bind variables for Installation ***********************************/ TOOLS_HOME = "%ORACLE_HOME%%dir_separator%TOOLS"; DOC60 = "%TOOLS_HOME%%dir_separator%DOC60"; /**********************************/ /************************ Setup the nls() stuff for deinstall scripts *************************/ deinstall_unregister = nls("deinstall_unregister","Unregistering %%registry_label%%..."); unreference_dependencies= nls("unreference_dependencies","Unreferencing %%registry_label%% Dependencies..."); deinstall_dll = nls("deinstall_dll","Removing %%registry_label%% Dynamic Link Libraries..."); deinstall_which = nls("deinstall_which","Remove which %%registry_label%%?"); deinstall_location = nls("deinstall_location", "%%registry_label%% is not found in this directory. Do you wish to attempt to deinstall at this location anyway?"); deinstall_exe = nls("deinstall_exe", "Removing %%registry_label%% Executables..."); deinstall_components = nls("deinstall_components", "Deinstalling %%registry_label%% Components..."); deinstall_files = nls("deinstall_files","Removing %%registry_label%% files..."); modify_variables = nls("modify_variables", "Modifying %%registry_label%% Environment Variables..."); } /*END SET_DEINSTALL_VARIABLES*/ /********************************************************************/ /******************************************************************** II. Create a label with the product name, version *********************************************************************/ if (EXECUTE_SCRIPT == "CREATE_LABEL") { installed_version = registry_version(current_registry); version_list = explode(installed_version,"."); msb_version_list = list(first(version_list), first(rest(version_list))); display_version = implode(msb_version_list,"."); display_registry_label = "%registry_label% %display_version%"; ui_product(instantiate(display_registry_label)); return(0); } /********************************************************************/ /******************************************************************** III. Set up deinstallation path *********************************************************************/ if (EXECUTE_SCRIPT == "GET_DEINSTALLATION_PATH") { home_variable = ""; /* bind product_home variable */ prompt_flag = FALSE; { home_variable = translate(deinstall_variable, ora_config, section_heading); /* Get path from variable in oracle.ini. */ full_path = "%home_variable%"; if(not(exists(full_path))) /* Make sure this is the product's location */ prompt_flag = TRUE; } [ 'UNBOUND_ENVIRONMENT_VARIABLE,'INVALID_FILE_NAME, 'FILE_NOT_FOUND: { prompt_flag = TRUE; } ] if(prompt_flag) { mark { home_variable = choose_directory_dialog(instantiate(deinstall_which),oracle_home); if(not(exists(instantiate("%home_variable%")))) /* Make sure this is the product's location */ { mark /* Allow user to backup to previous MARK level to select appropriate product location */ { deinstall_here = yesno_dialog(instantiate(deinstall_location), FALSE); if(not(deinstall_here)) signal('FAILURE, "Halted deinstallation process."); } } } } return(home_variable); } /********************************************************************/ /******************************************************************** IV. Deinstall parent if no other child product exists *********************************************************************/ if (EXECUTE_SCRIPT == "DEINSTALL_PARENT") { if(member(registration("selected_registries"), current_registry)) { remove_parent = TRUE; child_products = all_child_registrations(PARENT_PRODUCT); extract(child_products, current_registry); while(not(empty(child_products))) { if(registered(registry_name(first(child_products)))) { remove_parent = FALSE; break(); } child_products = rest(child_products); } if(remove_parent) { dependent = registration(PARENT_REGISTRY_NAME); /*********************************************** if PARENT needs to be deinstalled, make sure all references to PARENT are unreferenced before attempting to deinstall the PARENT ************************************************/ reference_list = registry_references(dependent); while(not(empty(reference_list))) { if(registered(registry_name(first(reference_list)))) unreference(dependent, registration(registry_name(first(reference_list)))); reference_list = rest(reference_list); } /***********************************************/ unreference(dependent); deinstall(dependent); } } ['UNREGISTERED_PRODUCT: continue();] return(0); } /**********************************************************************************/ /********************************************************************************** V. UNREFERENCE_DEINSTALL_CHILD_PRODUCTS Unreference and remove all child products if parent product was selected. **********************************************************************************/ if (EXECUTE_SCRIPT == "UNREFERENCE_DEINSTALL_CHILD_PRODUCTS") { if(member(registration("selected_registries"), current_registry)) /* remove all child products if parent product was selected */ { ui_product(instantiate(display_registry_label)); ui_action(instantiate(deinstall_components)); child_products = all_child_registrations(current_registry); /***************************** Deinstall the child product(s) ******************************/ while(not(empty(child_products))) { if(registered(registry_name(first(child_products)))) { dependent = registration(registry_name(first(child_products))); unreference(dependent); /* unset the child's self-reference */ deinstall(dependent); } child_products = rest(child_products); } } return(0); } /***********************************************************************************/ /************************************************************************************************************************* VI . DEINSTALL_COMPONENTS Similar to "UNREFERENCE_DEINSTALL_CHILD_PRODUCTS" but eliminates cross-referencing between components & parent. ************************************************************************************************************************/ if (EXECUTE_SCRIPT == "DEINSTALL_COMPONENTS") { if(member(registration("selected_registries"), current_registry)) /* remove all child products if parent product was selected */ { ui_product(instantiate(display_registry_label)); ui_action(instantiate(deinstall_components)); child_products = all_child_registrations(current_registry); /*************************************************** Make sure the cross-referencing between different component products/parent is eliminated, before continuing with the deinstallation of child products ****************************************************/ reference_products = child_products; while(not(empty(reference_products))) { if(registered(registry_name(first(reference_products)))) { dependent = registration(registry_name(first(reference_products))); reference_list = registry_references(dependent); while(not(empty(reference_list))) { if(registered(registry_name(first(reference_list)))) unreference(dependent, registration(registry_name(first(reference_list)))); reference_list = rest(reference_list); } } reference_products = rest(reference_products); } /***************************************************/ /******************************************* Deinstall the component (child) product(s) ********************************************/ while(not(empty(child_products))) { if(registered(registry_name(first(child_products)))) { dependent = registration(registry_name(first(child_products))); unreference(dependent); /* unset the child's self-reference */ deinstall(dependent); } child_products = rest(child_products); } /*******************************************/ } /**********************************************************/ return(0); } /***********************************************************************************/ /*********************************************************************************** VII. UNREFERENCE_DEPENDENCIES Unreference and deinstall product dependencies. ***********************************************************************************/ if (EXECUTE_SCRIPT == "UNREFERENCE_DEPENDENCIES") { ui_product(instantiate(display_registry_label)); ui_action(instantiate(unreference_dependencies)); while(not(empty(dependency_list))) { next_dependency = first(dependency_list); if(registered(next_dependency)) { dependent = registration(next_dependency); unreference(dependent, current_registry); unreference(dependent); deinstall(dependent); } dependency_list = rest(dependency_list); } } /***********************************************************************************/ }