home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / po7_win / install / windows.vrf < prev    next >
Text File  |  1994-09-02  |  4KB  |  108 lines

  1. /* Copyright (c) Oracle Corporation 1993.  All Rights Reserved */
  2. /*****************************************************************************
  3.   NAME
  4.     windows.vrf - V3 common version analysis script for Windows products
  5.  
  6.   DESCRIPTION
  7.     This script performs common version analysis functionality across product
  8.     VRF scripts.  It returns the variable 'doit', indictating whether the
  9.     installation is to proceed.  The variable 'version_status' is set to
  10.     one of four values: 'upgrade,'downgrade,'reinstall and 'new_install.
  11.  
  12.   OWNER
  13.     Dan Galatin
  14.  
  15.   MODIFIED    DD-MMM-YY  Reason
  16.     kjain     07-JUL-94  Added verbose mode support.
  17.     dgalatin  05-NOV-93  Created from unix.vrf.
  18. *****************************************************************************/
  19.  
  20. {
  21.   product_label = product_interface_label(current_product);
  22.  
  23.   ui_product(product_label);
  24.   analyze_depend = nls("analyze_depend",
  25.                "Analyzing %%product_label%% Dependencies...");
  26.   ui_action(instantiate(analyze_depend));
  27.   { 
  28.     /* Check to make sure the required version of the Installer is running */
  29.  
  30.     required_version = product_version(windowsinstver);
  31.  
  32.     if (earlier_version(installer_version,required_version,4))
  33.       {
  34.         temp = explode(required_version,".");
  35.         required_version = implode(list(first(temp),first(rest(temp)),
  36.                                         first(rest(rest(temp))),
  37.                                         first(rest(rest(rest(temp))))),".");
  38.     information_dialog(instantiate(instver_too_early));
  39.     return(FALSE);
  40.       }
  41.   }
  42.     [ 'UNBOUND_VARIABLE: continue(); ]
  43.  
  44.   mark
  45.     if (registered(product_name(current_product)))
  46.       {
  47.         registry = registration(product_name(current_product));
  48.         current_version = product_version(current_product);
  49.         installed_version = registry_version(registry);
  50.   
  51.         if (earlier_version(registry,current_version))
  52.           {
  53.             version_status = 'upgrade;
  54.         if (verbose)
  55.           doit = yesno_dialog(instantiate(reinstall_prompt01),TRUE,
  56.                   instantiate(reinstall_content01),
  57.                   instantiate(reinstall_help01));
  58.         else
  59.           doit = TRUE;
  60.  
  61.             if (not(doit))
  62.               if (internally_called)
  63.                 information_dialog(instantiate(reinstall_prompt02),
  64.                                    instantiate(reinstall_content02),
  65.                                    instantiate(reinstall_help02));
  66.           }
  67.         else
  68.           {
  69.             if (later_version(registry,current_version))
  70.               version_status = 'downgrade;
  71.             else
  72.               version_status = 'reinstall;
  73.  
  74.             if (member(selected_products,current_product))
  75.               if (version_status == 'downgrade)
  76.                 doit = yesno_dialog(instantiate(reinstall_prompt03),FALSE,
  77.                                     instantiate(reinstall_content03),
  78.                                     instantiate(reinstall_help03));
  79.               else
  80.         {
  81.           if (verbose)
  82.             doit = yesno_dialog(instantiate(reinstall_prompt04),FALSE,
  83.                     instantiate(reinstall_content04),
  84.                     instantiate(reinstall_help04));
  85.           else
  86.             doit = TRUE;
  87.         }
  88.             else
  89.               doit = FALSE;
  90.           }
  91.       }
  92.     else
  93.       {
  94.         version_status = 'new_install;
  95.         doit = TRUE;
  96.       }
  97.  
  98.   if (doit)
  99.     {
  100.       if (not(member(products_for_installation,current_product)))
  101.     add(products_for_installation,current_product);
  102.     }
  103.   else if (member(selected_products,current_product))
  104.     ui_action(instantiate(nls("cancel_install","Cancelling Installation of %%product_label%%...")));
  105.  
  106.   return(doit);
  107. }
  108.