/* Copyright (c) Oracle Corporation 1995. All Rights Reserved */ /******************************************************************************* NAME toolsnls.usr - External script for Language supplements, release 2.0 DESCRIPTION This script contains an external .vrf (called from the product .vrf),an external .ins script (called from the product .ins script) and an external .dei script (called from the product .dei script) The .vrf section confirms whether or not products required for installation are installed. If they are, it finds the specific products installed and then flags the language files for those products. The .ins script installs language supplement files according to which products are installed (according to the flags set by the .vrf). The .dei section deinstalls language supplement files according to which products are installed. OWNER Amanda Harrison MODIFIED MM/DD/YY REASON rbchen 12/10/96 Updated for R2.0 Win32 aharriso 10/04/96 Updated for R1.3.2 Win32 aharriso 11/14/95 Created for release 1.2. ********************************************************************************/ /******************************************************************************** Start external .vrf script ********************************************************************************/ { if(RUN_SCRIPT == "LANGUAGE_SUPPLEMENT_VERIFY") { /*************************************** Create a label with the product, version ****************************************/ EXECUTE_SCRIPT = "CREATE_LABEL"; execute("%product_home%%dir_separator%d2kr2vrf.usr"); /************************************************** Create a list of products required for installation ***************************************************/ REQUIRED_PRODUCTS_LIST = list("w32gui25", "w32tutil30", "w32fdes50", "w32frun50", "w32rrun30", "w32grun30", "w32oca20", "w32pj10", "w32qb25"); /******************************************* Check to see if any of the above products are installed before continuing. ********************************************/ REGISTERED_PRODUCTS_LIST = all_registrations(); /*get list of all registered products*/ REQUIRED_REGISTRATIONS = list(); while(not(empty(REGISTERED_PRODUCTS_LIST))) { product_registry = registry_name(first(REGISTERED_PRODUCTS_LIST)); if (member(REQUIRED_PRODUCTS_LIST, product_registry)) { add(REQUIRED_REGISTRATIONS, product_registry); } REGISTERED_PRODUCTS_LIST = rest(REGISTERED_PRODUCTS_LIST); } if (length(REQUIRED_REGISTRATIONS) == 0) /* Cancel the installation if none of the required products have been installed*/ { information_dialog(instantiate(lang_products_missing), instantiate(lang_products_content), instantiate(lang_products_help)); /*signal('FAILURE, instantiate(halt_installation)); */ refresh_map_file = FALSE; /* Continue with the installation of other NON-LANG.SUPP. products */ doit = FALSE; return(0); } /***************************************************************************************************** START MAIN LOGIC ******************************************************************************************************/ if (doit) { /************************************ Determine if #NLS_LANG parameter needs to be set in ORACLE.INI *************************************/ nls_variable = "#NLS_LANG"; alternate_nls_var = "NLS_LANG"; set_nls_lang = FALSE; {nls_lang_variable = translate(nls_variable, ora_config, product_filename(current_product));} /* check to see if #NLS_LANG variable for this language supplement already exists */ [ 'UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: /* #NLS_LANG not found for the language supplement, look for NLS_LANG variable */ {nls_lang_variable = translate(alternate_nls_var, ora_config, product_filename(current_product));} [ 'UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: { nls_lang_variable = nls_value; /* #NLS_LANG or NLS_LANG variable doesn't exist in ora_config, set it to nls_value from .vrf */ set_nls_lang = TRUE; } ] ] if(not(set_nls_lang)) /* if #NLS_LANG or NLS_LANG already exists, make sure it's the same as nls_value */ { if(not(nls_lang_variable == nls_value)) { nls_lang_variable = nls_value; /* #NLS_LANG or NLS_LANG variable is different from nls_value, reset it to nls_value */ set_nls_lang = TRUE; } } /*********************************************** Check if GUI Common files need to be installed ***********************************************/ install_gui25 = FALSE; if(member(REQUIRED_REGISTRATIONS, "w32gui25")) { main_product = GUI_PRODUCT; /*set values for user.avf*/ main_product_label = product_interface_label(main_product); main_product_version = product_version(main_product); { mm21 = translate("MM21", ora_config, "gui25"); tk25 = translate("TK25", ora_config, "gui25"); } ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: signal('FAILURE, instantiate(bad_oracle_ini_variable));] install_gui25 = TRUE; lang_total = lang_total + sum(langcommon,"gui"); } /************************************************** Check if Tools Utilities files need to be installed **************************************************/ install_tutil30 = FALSE; if(member(REQUIRED_REGISTRATIONS, "w32tutil30")) { main_product = TUTIL_PRODUCT; /*set values for user.avf*/ main_product_label = product_interface_label(main_product); main_product_version = product_version(main_product); { vgs30 = translate("VGS30", ora_config, "tutil30"); de20 = translate("DE20", ora_config, "tutil30"); } ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: signal('FAILURE, instantiate(bad_oracle_ini_variable));] install_tutil30 = TRUE; lang_total = lang_total + sum(langcommon,"tutil"); } /************************************************************ Check if Project Builder files need to be installed ************************************************************/ install_pj = FALSE; if(member(REQUIRED_REGISTRATIONS, "w32pj10")) { main_product = PROJECT_BUILDER_PRODUCT; /*set values for user.avf*/ main_product_label = product_interface_label(main_product); main_product_version = product_version(main_product); install_variable = "PJ10"; home_variable = ""; {home_variable = translate(install_variable, ora_config, "PJ10");} ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: signal('FAILURE, instantiate(bad_oracle_ini_variable));] PJ10 = home_variable; install_pj = TRUE; lang_total = lang_total + sum(runtime, "pj"); } /**************************************************/ /************************************************* Check if Forms Designer files need to be installed *************************************************/ install_fdes = FALSE; if(member(REQUIRED_REGISTRATIONS, "w32fdes50")) { main_product = FORMS_DESIGNER_PRODUCT; /*set values for user.avf*/ main_product_label = product_interface_label(main_product); main_product_version = product_version(main_product); install_variable = "FORMS50"; home_variable = ""; {home_variable = translate(install_variable, ora_config, "FORMS50");} ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: signal('FAILURE, instantiate(bad_oracle_ini_variable));] FORMS50 = home_variable; install_fdes = TRUE; lang_total = lang_total + sum(designer,"forms"); } /**************************************************/ /************************************************************ Check if Query Builder (Browser) files need to be installed ************************************************************/ install_qb = FALSE; if(member(REQUIRED_REGISTRATIONS, "w32qb25")) { main_product = PROJECT_BUILDER_PRODUCT; /*set values for user.avf*/ main_product_label = product_interface_label(main_product); main_product_version = product_version(main_product); install_variable = "BROWSER25"; home_variable = ""; {home_variable = translate(install_variable, ora_config, "BROWSER25");} ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: signal('FAILURE, instantiate(bad_oracle_ini_variable));] BROWSER25 = home_variable; install_qb = TRUE; lang_total = lang_total + sum(browser, "common"); } /**************************************************/ /************************************************ Check if Forms Runtime files need to be installed *************************************************/ install_frun = FALSE; if(member(REQUIRED_REGISTRATIONS, "w32frun50")) { main_product = FORMS_RUNTIME_PRODUCT; /*set values for user.avf*/ main_product_label = product_interface_label(main_product); main_product_version = product_version(main_product); install_variable = "FORMS50"; home_variable = ""; {home_variable = translate(install_variable,ora_config,"FORMS50");} /* check for existance of runtime variable */ ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: signal('FAILURE, instantiate(bad_oracle_ini_variable));] FORMS50 = home_variable; install_frun = TRUE; lang_total = lang_total + sum(runtime,"forms"); } /************************************************/ /**************************************************** Check if Graphics Runtime files need to be installed ****************************************************/ install_grun = FALSE; if(member(REQUIRED_REGISTRATIONS, "w32grun30")) { main_product = GRAPHICS_RUNTIME_PRODUCT; /*set values for user.avf*/ main_product_label = product_interface_label(main_product); main_product_version = product_version(main_product); install_variable = "GRAPHICS30"; home_variable = ""; {home_variable = translate(install_variable,ora_config,"GRAPHICS30");} /* check for existance of runtime variable */ ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: signal('FAILURE, instantiate(bad_oracle_ini_variable));] GRAPHICS30 = home_variable; OCL30 = GRAPHICS30; install_grun = TRUE; lang_total = lang_total + sum(runtime,"graph"); } /**************************************************/ /************************************************** Check if Reports Runtime files need to be installed ***************************************************/ install_rrun = FALSE; if(member(REQUIRED_REGISTRATIONS, "w32rrun30")) { main_product = REPORTS_RUNTIME_PRODUCT; /*set values for user.avf*/ main_product_label = product_interface_label(main_product); main_product_version = product_version(main_product); install_variable = "RW30"; home_variable = ""; {home_variable = translate(install_variable, ora_config, "REPORT30");} /* check for existance of runtime variable */ ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: signal('FAILURE, instantiate(bad_oracle_ini_variable));] RW30 = home_variable; install_rrun = TRUE; lang_total = lang_total + sum(runtime,"report"); } /***************************************************/ /*************************************************************** Check if Open Client Adapter for ODBC files need to be installed Install path is hardcoded - do not need to translate variable ****************************************************************/ install_odbc = FALSE; if(member(REQUIRED_REGISTRATIONS, "w32oca20")) { main_product = ODBC_PRODUCT; /*set values for user.avf*/ main_product_label = product_interface_label(main_product); main_product_version = product_version(main_product); install_odbc = TRUE; lang_total = lang_total + sum(odbc); } /**************************************************/ lang_total = lang_total + sum(deinst); return(lang_total); } /*END IF DOIT*/ else { refresh_map_file = FALSE; return(0); } } /* END LANGUAGE_SUPPLEMENT_VERIFY SECTION*/ /******************************************************************************************************************* Start External .ins script *******************************************************************************************************************/ if(RUN_SCRIPT == "LANGUAGE_SUPPLEMENT_INSTALL") { if (doit) { execute("%installer_home%%dir_separator%%operating_system%.ins"); permit_retry_operations = TRUE; permit_ignore_operations = TRUE; permit_process_operations= TRUE; /****************** Install the product *******************/ ui_product(instantiate(display_product_label)); ui_action(instantiate(install_files)); copy(deinst); if(install_gui25) { ui_action(instantiate(install_files)); copy(langcommon,"gui"); } if(install_tutil30) { ui_action(instantiate(install_files)); copy(langcommon,"tutil"); } if(install_pj) { ui_action(instantiate(install_files)); copy(runtime, "pj"); } if(install_qb) { ui_action(instantiate(install_files)); copy(browser, "common"); } if(install_fdes) { ui_action(instantiate(install_files)); copy(designer,"forms"); } if(install_frun) { ui_action(instantiate(install_files)); copy(runtime,"forms"); } if(install_grun) { ui_action(instantiate(install_files)); copy(runtime,"graph"); } if(install_rrun) { ui_action(instantiate(install_files)); copy(runtime,"report"); } if(install_odbc) { ui_action(instantiate(install_files)); copy(odbc); } permit_retry_operations = FALSE; /********************************* Register and Reference the product and remove delold. **********************************/ EXECUTE_SCRIPT = "REGISTER_REFERENCE_PRODUCT"; execute("%installer_home%%dir_separator%d2kr2ins.usr"); /********************************** Add #NLS string to Registry Editor **********************************/ if(set_nls_lang) modify(nls_variable, nls_lang_variable, ora_config, product_filename(current_product)); /****************************/ permit_retry_operations = FALSE; } /*END IF DOIT*/ [ 'UNREGISTERED_PRODUCT: continue(); 'CANCEL: signal('FAILURE, instantiate(halt_installation)); ] return(0); } /*END LANGUAGE_SUPPLEMENT_INSTALL SECTION*/ /*************************************************************************************************************** Start external .dei script. ***************************************************************************************************************/ if(RUN_SCRIPT == "LANGUAGE_SUPPLEMENT_REMOVE") { if (doit) { deinstall_files = nls("deinstall_files", "Removing %%registry_label%% Installation Scripts..."); /************************************************ Create a label with the product name, and version *************************************************/ EXECUTE_SCRIPT = "CREATE_LABEL"; execute("%installer_home%%dir_separator%d2kr2dei.usr"); /************************************************/ permit_retry_operations = FALSE; /********************************************* Set the variables to remove NLS_LANG parameter for EACH Supplement from ORACLE.INI, and reset it under [Oracle] in ORACLE.INI **********************************************/ nls_var = "#NLS_LANG"; alternate_nls_var = "NLS_LANG"; ALTER_NLS_LANG = FALSE; nls_var_to_alter = ""; /*********************************************/ /******************************** Validate GUI Common path variable *********************************/ { remove_gui = TRUE; mm21 = translate("MM21", ora_config, "gui25"); tk25 = translate("TK25", ora_config, "gui25"); } ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: remove_gui = FALSE;] /*******************************/ /************************************** Validate Tools Utilities path variables ***************************************/ { remove_tutil = TRUE; vgs30 = translate("VGS30", ora_config, "tutil30"); de20 = translate("DE20", ora_config, "tutil30"); } ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: remove_tutil = FALSE;] /**************************************/ /***************************************************** Validate Project Builder deinstallation path *******************************************************/ deinstall_variable = "PJ10"; home_variable = ""; deinstall_pj = TRUE; {home_variable = translate(deinstall_variable, ora_config, "PJ10");} /* Get path from variable in oracle.ini */ ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: deinstall_pj = FALSE;] /*if path doesn't exist, cannot remove pj lang. files*/ PJ10 = home_variable; /*********************************/ /***************************************************** Validate Query Builder (Browser) deinstallation path *******************************************************/ deinstall_variable = "BROWSER25"; home_variable = ""; deinstall_qb = TRUE; {home_variable = translate(deinstall_variable, ora_config, "BROWSER25");} /* Get path from variable in oracle.ini */ ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: deinstall_qb = FALSE;] /*if path doesn't exist, cannot remove Query Builder lang. files*/ BROWSER25 = home_variable; /*********************************/ /***************************************************** Validate Forms Designer & Runtime deinstallation path *******************************************************/ deinstall_variable = "FORMS50"; home_variable = ""; deinstall_forms_runtime = TRUE; deinstall_forms_designer = TRUE; {home_variable = translate(deinstall_variable, ora_config, "FORMS50");} /* Get path from variable in oracle.ini */ ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: { deinstall_forms_runtime = FALSE; deinstall_forms_designer = FALSE; } ] /*if path doesn't exist, cannot remove forms lang. files*/ FORMS50 = home_variable; if ( not(registered("w32frun50")) ) /* don't remove runtime if it is not registered */ { deinstall_forms_runtime = FALSE; } if ( not(registered("w32fdes50")) ) /* don't remove designer if it is not registered */ { deinstall_forms_designer = FALSE; } /*********************************/ /********************************************** Validate Graphics Runtime deinstallation path **********************************************/ deinstall_variable = "GRAPHICS30"; home_variable = ""; deinstall_grun = TRUE; {home_variable = translate(deinstall_variable, ora_config, "GRAPH30");} ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: deinstall_grun = FALSE;] /*if path doesn't exist, cannot remove grun lang. files*/ GRAPHICS30 = home_variable; OCL30 = GRAPHICS30; /************************************/ /******************************************** Validate Reports Runtime deinstallation path ********************************************/ deinstall_variable = "RW30"; home_variable = ""; deinstall_rrun = TRUE; {home_variable = translate(deinstall_variable, ora_config, "REPORT30");} /* Get path from variable in oracle.ini. */ ['UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: deinstall_rrun = FALSE;] /*if path doesn't exist, cannot remove rrun lang. files*/ RW30 = home_variable; /***********************************/ /*************************************************** Do not need to validate Open Client Adapter for ODBC deinstall because the path is hardcoded ****************************************************/ permit_retry_operations = TRUE; permit_ignore_operations = TRUE; permit_process_operations= TRUE; /********************* Unregister the product **********************/ ui_product(instantiate(display_registry_label)); unregister(current_registry); /*********************/ /****************************************** Deinstall files flagged for deinstallation *******************************************/ ui_product(instantiate(display_registry_label)); { ui_action(instantiate(deinstall_files)); remove(odbc); } if(deinstall_rrun) { ui_action(instantiate(deinstall_files)); remove(runtime, "report"); } if(deinstall_grun) { ui_action(instantiate(deinstall_files)); remove(runtime, "graph"); } if(deinstall_forms_runtime) { ui_action(instantiate(deinstall_files)); remove(runtime, "forms"); } if(deinstall_pj) /* deinstall Project Builder */ { ui_action(instantiate(deinstall_files)); remove(runtime, "pj"); } if(deinstall_qb) /* deinstall Query Builder */ { ui_action(instantiate(deinstall_files)); remove(browser, "common"); } if(deinstall_forms_designer) { ui_action(instantiate(deinstall_files)); remove(designer, "forms"); } if(remove_tutil) { ui_action(instantiate(deinstall_files)); remove(langcommon, "tutil"); } if(remove_gui) { ui_action(instantiate(deinstall_files)); remove(langcommon, "gui"); } ui_action(instantiate(deinstall_files)); remove(deinst); /********************/ permit_retry_operations = FALSE; } /*END IF DOIT*/ } /*END LANGUAGE_SUPPLEMENT_REMOVE SECTION */ /****************************************************************************************************/ }