home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / gc25ptch / par_vrf.usr < prev    next >
Text File  |  1995-01-31  |  4KB  |  115 lines

  1. /* Copyright (c) Oracle Corporation 1994.  All Rights Reserved */
  2.  
  3. /*****************************************************************************
  4.   NAME
  5.     par_vrf.usr - Modified windows.vrf executable for parent products
  6.  
  7.   DESCRIPTION
  8.     This script performs common version analysis functionality similar to
  9.     the standard windows.vrf file.  It differs in the logical structure of the 
  10.     registration checking for externally vs. interally called parent products.
  11.  
  12.   OWNER
  13.     Bryan Sabol
  14.  
  15.   MODIFIED    MM/DD/YY    Reason
  16.    rbansal    03/18/94  Modified for Windows platform
  17.     bsabol    03/17/94    Created from mac.vrf.
  18. *****************************************************************************/
  19.  
  20. {
  21.     product_label = product_interface_label(current_product);
  22.  
  23.     ui_product(product_label);
  24.     ui_action(instantiate(nls("analyze_depend",
  25.                               "Analyzing %%product_label%% Dependencies...")));
  26.  
  27.     /**********************
  28.     Check Installer version
  29.     ***********************/
  30.     { 
  31.         required_version = product_version(windowsinstver);
  32.  
  33.         if (earlier_version(installer_version,required_version,4))
  34.         {
  35.             information_dialog(instantiate(nls("instver_too_early","The version of the Installer currently running is %%installer_version%%. The installation you have chosen requires version %%required_version%%. Please run version %%required_version%% in order to perform this installation.")));
  36.             return(FALSE);
  37.         }
  38.     }
  39.     [ 'UNBOUND_VARIABLE: continue(); ]
  40.  
  41.     if(not(member(selected_products, current_product)))                        /* internally called */
  42.     {
  43.         /*******************************
  44.         Check product registry & version
  45.         ********************************/
  46.         mark
  47.         if(registered(product_name(current_product)))                        /* Product is installed */
  48.         {
  49.             registry = registration(product_name(current_product));
  50.             current_version = product_version(current_product);
  51.             installed_version = registry_version(registry);
  52.     
  53.             if (earlier_version(registry, current_version))
  54.             {
  55.                 version_status = 'upgrade;
  56.                 doit = TRUE;
  57.             }
  58.             else
  59.             {
  60.                 doit = FALSE;                                                /* either downgrade or same version; don't install */
  61.                 
  62.                 if (later_version(registry, current_version))
  63.                     version_status = 'downgrade;
  64.                 else
  65.                     version_status = 'reinstall;
  66.                     
  67.             }
  68.         }
  69.         else
  70.             doit = TRUE;                                                    /* product isn't registered; install */
  71.     }
  72.     else                                                                    /* externally called script; prompt for install location */
  73.     {
  74.         if (registered(product_name(current_product)))
  75.         {
  76.             registry = registration(product_name(current_product));
  77.             current_version = product_version(current_product);
  78.             installed_version = registry_version(registry);
  79.           
  80.             if (earlier_version(registry,current_version))
  81.             {
  82.                 version_status = 'upgrade;
  83.                 doit = TRUE;                                                /* simple upgrade;  install */
  84.       
  85.             }
  86.             else
  87.             {
  88.                 if (later_version(registry, current_version))
  89.                 {
  90.                     version_status = 'downgrade;
  91.                          
  92.                     doit = yesno_dialog(instantiate(reinstall_prompt03),FALSE,
  93.                                         instantiate(reinstall_content03),
  94.                                         instantiate(reinstall_help03));
  95.                 }
  96.                 else
  97.                 {
  98.                     version_status = 'reinstall;
  99.                                                                             /* customized response. See user.avf */
  100.                     doit = yesno_dialog(instantiate(reinstall_group),FALSE,        
  101.                                         instantiate(reinstall_group_content),
  102.                                         instantiate(reinstall_group_help));
  103.                 }
  104.             }
  105.         }
  106.         else
  107.         {
  108.             version_status = 'new_install;
  109.             doit = TRUE;
  110.         }
  111.     }
  112.  
  113.     return(doit);
  114. }
  115.