/* Copyright (c) Oracle Corporation 1993. All Rights Reserved */ /***************************************************************************** NAME win32.vrf - V3 common version analysis script for Windows 32-bit products DESCRIPTION This script performs common version analysis functionality across product VRF scripts. The variable 'doit' is set to a boolean indictating whether the installation is to proceed. The variable 'version_status' is set to one of four values: 'upgrade,'downgrade,'reinstall and 'new_install. Optionally, upon calling this script the custom_version_analysis variable can be set to TRUE, which causes a customized version analysis to be asked when required. To use this feature, the following variables must be set prior to calling this script: custom_version_analysis = TRUE; custom_version_analysis_reinstall_prompt = "Reinstall prompt"; custom_version_analysis_reinstall_content = "Reinstall content"; custom_version_analysis_reinstall_help = "Reinstall help"; custom_version_analysis_upgrade_prompt = "Upgrade prompt"; custom_version_analysis_upgrade_content = "Upgrade content"; custom_version_analysis_upgrade_help = "Upgrade help"; custom_version_analysis_downgrade_prompt = "Downgrade prompt"; custom_version_analysis_downgrade_content = "Downgrade content"; custom_version_analysis_downgrade_help = "Downgrade help"; custom_version_analysis_choice_reinstall = "Text shown for an reinstall"; custom_version_analysis_choice_upgrade = "Text shown for an upgrade"; custom_version_analysis_choice_downgrade = "Text shown for an downgrade"; custom_version_analysis_choice_fresh = "Text shown for a fresh install"; custom_version_analysis_choice_skip = "Text shown to skip install"; CREATED Siddhartha Agarwal, July 16, 1996 MODIFIED DD-MMM-YY Reason jewillia 17-FEB-97 Add support for advanced options startup dialog jewillia 12-OCT-95 Modify reinstall prompt to pick up registry label zzerhoun 22-AUG-97 MOH support: * non-MOH_AWARE pdts installed on dflt home only * non-MOH INSALLATION pdts installed in multiple homes sagarwal 16-JUL-97 Created from nt.vrf. *****************************************************************************/ { product_label = product_interface_label(current_product); ui_product(product_label); { ui_action(instantiate(analyze_depend)); } ['UNBOUND_VARIABLE: { ui_action(UI_analyzing_dependencies); }] /*************************************************************************/ current_version = product_version(current_product); /* [jewillia] add support for advanced options startup dialog */ /* these messages are defined in user.avf and should be translated there. But check here to avoid crashing the script. The definition should be the same in both places. */ {new_install_prompt01 = new_install_prompt01;} ['UNBOUND_VARIABLE: new_install_prompt01 = nls("new_install_prompt01","Would you like to install %%product_label%%, version %%current_version%%?"); ] {new_install_content01 = new_install_content01;} ['UNBOUND_VARIABLE: new_install_content01 = nls("new_install_content01","New Install"); ] {new_install_help01 = new_install_help01;} ['UNBOUND_VARIABLE: new_install_help01 = nls("new_install_help01","Choose 'Yes' to install %%product_label%% %%current_version%%. Choose 'No' if you do not want to install the product."); ] {reinstall_prompt01a = reinstall_prompt01a;} ['UNBOUND_VARIABLE: reinstall_prompt01a = nls("reinstall_prompt01a","Would you like to update %%registry_label%%, version %%installed_version%%, with the available release of %%product_label%%, version %%current_version%%?"); ] /*************************************************************************/ /* If target home is default home, access software\oracle key structure */ { if (oracle_home_info == default_home_info) signal('UNBOUND_VARIABLE); else if (not(multiple_home_aware)) { signal('FAILURE,instantiate(moh_invalid_home)); } }['UNBOUND_VARIABLE: multiple_home_aware = FALSE; ] { /* Check to make sure the required version of the Installer is running */ if (os_name == "nt") required_version = product_version(ntinstver); else required_version = product_version(w95instver); if (earlier_version(installer_version,required_version,4)) { temp = explode(required_version,"."); required_version = implode(list(first(temp),first(rest(temp)), first(rest(rest(temp))), first(rest(rest(rest(temp))))),"."); information_dialog(instantiate(instver_too_early)); return(FALSE); } } [ 'UNBOUND_VARIABLE: continue(); ] mark { version_status = 'NEW_INSTALL; doit = TRUE; if (registered(product_name(current_product))) { registry = registration(product_name(current_product)); current_version = product_version(current_product); installed_version = registry_version(registry); { evaluate("custom_version_analysis"); } [ 'UNBOUND_VARIABLE: custom_version_analysis = FALSE; ] if (earlier_version(registry,current_version)) { version_status = 'UPGRADE; if (custom_version_analysis) { custom_version_analysis_choice = single_selection_dialog(custom_version_analysis_upgrade_prompt, list(custom_version_analysis_choice_upgrade, custom_version_analysis_choice_fresh, custom_version_analysis_choice_skip), custom_version_analysis_choice_upgrade, custom_version_analysis_upgrade_content, custom_version_analysis_upgrade_help); if (custom_version_analysis_choice == custom_version_analysis_choice_skip) doit = FALSE; else { doit = TRUE; if (custom_version_analysis_choice == custom_version_analysis_choice_fresh) version_status = 'NEW_INSTALL; } } else { /* [jewillia] add support for advanced options startup dialog */ {always_upgrade = always_upgrade; } [ 'UNBOUND_VARIABLE: always_upgrade = FALSE;] {notify_upgrade = notify_upgrade; } [ 'UNBOUND_VARIABLE: notify_upgrade = verbose;] if (always_upgrade == TRUE) doit = TRUE; /* if (verbose) */ else if (notify_upgrade) { { /* [jewillia] use registry label (ie current product name) for the out of date name and prd label (product_label) for the new name by using XXX_prompt01a and not XXX_prompt01. */ registry_label = registry_interface_label(registry); doit = yesno_dialog(instantiate(reinstall_prompt01a),TRUE, instantiate(reinstall_content01), instantiate(reinstall_help01)); } [ 'UNBOUND_VARIABLE: doit = yesno_dialog(instantiate(reinstall_prompt01),TRUE, instantiate(reinstall_content01), instantiate(reinstall_help01)); ] } else doit = TRUE; } if (not(doit)) if (internally_called) information_dialog(instantiate(reinstall_prompt02), instantiate(reinstall_content02), instantiate(reinstall_help02)); } else { if (later_version(registry,current_version)) version_status = 'DOWNGRADE; else version_status = 'REINSTALL; if (custom_version_analysis) { if (version_status == 'DOWNGRADE) custom_version_analysis_choice = single_selection_dialog(custom_version_analysis_downgrade_prompt, list(custom_version_analysis_choice_skip, custom_version_analysis_choice_downgrade, custom_version_analysis_choice_fresh), custom_version_analysis_choice_skip, custom_version_analysis_downgrade_content, custom_version_analysis_downgrade_help); else custom_version_analysis_choice = single_selection_dialog(custom_version_analysis_reinstall_prompt, list(custom_version_analysis_choice_reinstall, custom_version_analysis_choice_fresh, custom_version_analysis_choice_skip), custom_version_analysis_choice_reinstall, custom_version_analysis_reinstall_content, custom_version_analysis_reinstall_help); if (custom_version_analysis_choice == custom_version_analysis_choice_skip) doit = FALSE; else { doit = TRUE; if (custom_version_analysis_choice == custom_version_analysis_choice_fresh) version_status = 'NEW_INSTALL; } } else { /* [jewillia] add support for advanced options startup dialog */ {always_reinstall = always_reinstall; } [ 'UNBOUND_VARIABLE: always_reinstall = FALSE;] {never_reinstall = never_reinstall; } [ 'UNBOUND_VARIABLE: never_reinstall = FALSE;] {notify_reinstall = notify_reinstall; } [ 'UNBOUND_VARIABLE: notify_reinstall = verbose;] {case_selected_products = case_selected_products; } [ 'UNBOUND_VARIABLE: case_selected_products = list();] if (version_status == 'downgrade) { if (always_reinstall == TRUE) { doit = TRUE; } else if (never_reinstall == TRUE) { doit = FALSE; } else { {notify_down_install = notify_down_install; } [ 'UNBOUND_VARIABLE: notify_down_install = FALSE;] if (notify_down_install) { if ((member(selected_products,current_product)) || (member(case_selected_products,current_product)) ) /* [jewillia] */ doit = yesno_dialog(instantiate(reinstall_prompt03),FALSE, instantiate(reinstall_content03), instantiate(reinstall_help03)); else /* default unless asked or forced is NOT to downgrade as this may stop products working */ doit = FALSE; } else { /* default unless asked or forced is NOT to downgrade as this may stop products working */ doit = FALSE; } } } else { /* version_status == 'reinstall */ /* [jewillia] add support for advanced options startup dialog */ if (always_reinstall == TRUE) doit = TRUE; else if (never_reinstall == TRUE) doit = FALSE; else if ((member(selected_products,current_product)) || (member(case_selected_products,current_product)) || (always_reinstall == TRUE)) { /* if (verbose) */ if (notify_reinstall) doit = yesno_dialog(instantiate(reinstall_prompt04),FALSE, instantiate(reinstall_content04), instantiate(reinstall_help04)); else doit = TRUE; } else doit = FALSE; } } } } else { if (not(multiple_home_installation)) { /* check if registered in other homes */ doit = TRUE; version_status = 'NEW_INSTALL; home_list = all_homes(); extract(home_list, oracle_home_info); current_version = product_version(current_product); current_product_installations = list(); while(not(empty(home_list))) { hm = first(home_list); if (registered(product_name(current_product), hm)) { doit = FALSE; registry = registration(product_name(current_product), hm); installed_version = registry_version(registry); if (earlier_version(registry,current_version)) version_status = 'UPGRADE; else if (later_version(registry,current_version)) version_status = 'DOWNGRADE; else version_status = 'REINSTALL; add(current_product_installations, list(hm,version_status,installed_version)); } home_list = rest(home_list); } /* [jewillia] add support for advanced options startup dialog */ if (doit) { {notify_new_install = notify_new_install; } [ 'UNBOUND_VARIABLE: notify_new_install = FALSE;] if (notify_new_install) doit = yesno_dialog(instantiate(new_install_prompt01),FALSE, instantiate(new_install_content01), instantiate(new_install_help01)); else doit = TRUE; } } else { version_status = 'NEW_INSTALL; /* [jewillia] add support for advanced options startup dialog */ {notify_new_install = notify_new_install; } [ 'UNBOUND_VARIABLE: notify_new_install = FALSE;] if (notify_new_install) doit = yesno_dialog(instantiate(new_install_prompt01),FALSE, instantiate(new_install_content01), instantiate(new_install_help01)); else doit = TRUE; } } ['UNBOUND_VARIABLE: { doit = TRUE; } ] /* Happens if running installed pre-MOH installer */ } if (doit) { if (not(member(products_for_installation,current_product))) add(products_for_installation,current_product); } else if (member(selected_products,current_product)) ui_action(instantiate(cancel_install)); if (doit) win32_remove_ocsm_key(); return(doit); }