home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / WELCOME.ZIP / WELCOME.OLD < prev   
Text File  |  1992-11-06  |  13KB  |  393 lines

  1. /* 2 Lines on Icon Name ??? */
  2.  
  3. /***************************************************************/
  4. /*      This Rexx file recreates the Welcome Folder and        */
  5. /*      all of its utilities.  If the Executable files         */
  6. /*      that are related to the Welcome Folder are             */
  7. /*      removed from the hard drive, this program will         */
  8. /*      not completely restore the Welcome Folder to           */
  9. /*      its original state.                                    */
  10. /*                                                             */
  11. /*                      Shawn McAlhany                         */
  12. /*                     November 5, 1992                        */
  13. /*                      Completed:                             */
  14. /***************************************************************/
  15.  
  16. /***************************************************************/
  17. /* This procedure explains the utility to the user and calls   */
  18. /* other procedures to continue or terminate the program.      */
  19. /***************************************************************/
  20.  
  21. call rxfuncadd 'sysloadfuncs', 'rexxutil', 'sysloadfuncs'
  22. call sysloadfuncs                /* register system functions */
  23. address cmd 'echo off'          /* echo is turned off */
  24.  
  25. say
  26. say 'This Rexx file recreates the Welcome Folder and' 
  27. say 'all of its utilities.  If the Executable files' 
  28. say 'that are related to the Welcome Folder are' 
  29. say 'removed from the hard drive, this program will'
  30. say 'not completely restore the Welcome Folder to'
  31. say 'its original state.'
  32. say
  33.  
  34. call option
  35.  
  36. say
  37. say 'Program has been asked to continue at the users discretion...'
  38.  
  39. call create_folder
  40.  
  41. say
  42. say 'Creation of the Welcome Folder has been completed.'
  43. say 'Any fixes or updates to this utility will be available on' 
  44. say 'the IBM Bulletin Board System.'
  45. say 'Creator: Shawn McAlhany'
  46. say
  47.  
  48. call quit
  49.  
  50. /***************************************************************/
  51. /* Get the boot drive's ID                                     */
  52. /***************************************************************/ 
  53.  
  54. bootdrive = Substr(Value('PATH',,'OS2ENVIRONMENT'),Pos('\OS2\SYSTEM',Value('PATH',,'OS2ENVIRONMENT'))-2,2)
  55.  
  56. /***************************************************************/ 
  57. /* Procedure: create_folder                                    */
  58. /*                                                             */
  59. /* This procedure creates the icons and folders that are part  */
  60. /* of the original Welcome Folder.                             */
  61. /***************************************************************/    
  62.  
  63. create_folder:
  64.  
  65. say
  66. say 'Creating Welcome Folder...'
  67.  
  68. /* create Welcome Folder */
  69.  
  70. rc = SysCreateObject('WPFolder','Welcome','<WP_DESKTOP>','OBJECTID=<WELCOME>;','R')
  71. if rc = 1 then do
  72.    say 'Welcome folder was successfully installed.'
  73. end /* do */
  74.  
  75. else do
  76.    say
  77.    say 'A problem occured during the installation of the'
  78.    say 'Welcome folder.  This folder was not'
  79.    say 'created successfully.'
  80.    call reason
  81.    say
  82. end /* do */
  83.  
  84. /* create Configuration Tools in Welcome Folder */
  85.  
  86. rc = SysCreateObject('WPFolder','Configuration Tools','<WELCOME>','OBJECTID=<CONFIGURE>;','R')
  87.  
  88. if rc = 1 then do
  89.    say 'Configuration Tools folder was successfully installed.'
  90. end /* do */
  91.  
  92. else do
  93.    say
  94.    say 'A problem occured during the installation of the'
  95.    say 'Configuration Tools folder .  This folder was not'
  96.    say 'created successfully.'
  97.    call reason
  98.    say
  99. end /* do */
  100.  
  101. /* create Applications Folder in Welcome Folder */
  102.  
  103. rc = SysCreateObject('WPFolder','Applications','<WELCOME>','OBJECTID=<APPS>;','R')
  104. if rc = 1 then do
  105.    say 'Applications folder was successfully installed.'
  106. end /* do */
  107.  
  108. else do
  109.    say
  110.    say 'A problem occured during the installation of the'
  111.    say 'Applications folder.  This folder was not'
  112.    say 'created successfully.'
  113.    call reason
  114.    say
  115. end /* do */
  116.  
  117. /* create Features Folder in Welcome Folder */
  118.  
  119. rc = SysCreateObject('WPFolder','Features','<WELCOME>','OBJECTID=<FEATURES>;','R')
  120. if rc = 1 then do
  121.    say 'Features folder was successfully installed.'
  122. end /* do */
  123.  
  124. else do
  125.    say
  126.    say 'A problem occured during the installation of the'
  127.    say 'Features folder.  This folder was not'
  128.    say 'created successfully.'
  129.    call reason
  130.    say
  131. end /* do */
  132.  
  133. /* create Tutorials Folder in Welcome Folder */
  134.  
  135. rc = SysCreateObject('WPFolder','Tutorials','<WELCOME>','OBJECTID=<TUTORIALS>;','R')
  136. if rc = 1 then do
  137.    say 'Tutorials folder was successfully installed.'
  138. end /* do */
  139.  
  140. else do
  141.    say
  142.    say 'A problem occured during the installation of the'
  143.    say 'Tutorials folder.  This folder was not'
  144.    say 'created successfully.'
  145.    call reason
  146.    say
  147. end /* do */
  148.  
  149. /* create Welcome & Quick Tour Book in Welcome Folder */
  150.  
  151. rc = SysCreateObject('WPProgram','Welcome & Quick Tour','<WELCOME>','EXENAME='||bootdrive||'\OS2\VIEW.EXE;PROGTYPE=PM;PARAMETERS=QTOUR.INF WELCOME;STARTUPDIR='||bootdrive||'\OS2\INSTALL\PRELOAD\;','R')
  152.  
  153. if rc = 1 then do
  154.    say 'Welcome & Quick Tour icon was successfully installed.'
  155. end /* do */
  156.  
  157. else do
  158.    say
  159.    say 'A problem occured during the installation of the'
  160.    say 'Welcome & Quick Tour icon.  This icon was not'
  161.    say 'created successfully.'
  162.    call reason
  163.    say
  164. end /* do */
  165.  
  166. /* create Create Utility Diskettes in Configuration Tools folder */
  167.  
  168. rc = SysCreateObject('WPProgram','Create Utility Diskettes','<CONFIGURE>','EXENAME='||bootdrive||'\OS2\INSTALL\PRELOAD\BOOTDISK.EXE;PROGTYPE=PM;PARAMETERS=NULL;STARTUPDIR='||bootdrive||'\OS2\INSTALL\PRELOAD\;','R')
  169.                                                                                                                                                                             
  170. if rc = 1 then do
  171.    say 'Create Utility Diskettes icon was successfully installed.'
  172. end /* do */
  173.  
  174. else do
  175.    say
  176.    say 'A problem occured during the installation of the'
  177.    say 'Create Utility Diskettes icon.  This icon was not'
  178.    say 'created successfully.'
  179.    call reason
  180.    say
  181. end /* do */
  182.  
  183. /* create Configure in Configuration Tools folder */
  184.  
  185. rc = SysCreateObject('WPProgram','Configure','<CONFIGURE>','EXENAME='||bootdrive||'\OS2\INSTALL\PRELOAD\CONFIG.EXE;PROGTYPE=PM;PARAMETERS=NULL;STARTUPDIR='||bootdrive||'\OS2\INSTALL\PRELOAD\;','R')
  186.  
  187. if rc = 1 then do
  188.    say 'Configure icon was successfully installed.'
  189. end /* do */
  190.  
  191. else do
  192.    say
  193.    say 'A problem occured during the installation of the'
  194.    say 'Configure icon.  This icon was not'
  195.    say 'created successfully.'
  196.    call reason
  197.    say
  198. end /* do */
  199.  
  200. /* create Selective Uninstall in Configuration Tools folder */
  201.  
  202. rc = SysCreateObject('WPProgram','Selective Uninstall','<CONFIGURE>','EXENAME='||bootdrive||'\OS2\INSTALL\PRELOAD\UNINSTAL.EXE;PROGTYPE=PM;PARAMETERS=NULL;STARTUPDIR='||bootdrive||'\OS2\INSTALL\PRELOAD\;','R')
  203.  
  204. if rc = 1 then do
  205.    say 'Selective Uninstall icon was successfully installed.'
  206. end /* do */
  207.  
  208. else do
  209.    say
  210.    say 'A problem occured during the installation of the'
  211.    say 'Selective Unistall icon.  This icon was not'
  212.    say 'created successfully.'
  213.    call reason
  214.    say
  215. end  /* do */
  216. /* create Application Installation Overview in Applications folder */
  217.  
  218. rc = SysCreateObject('WPProgram','Application Installation Overview','<APPS>','EXENAME='||bootdrive||'\OS2\VIEW.EXE;PROGTYPE=PM;PARAMETERS=INSTALL.INF INSTALLING YOUR APPLICATIONS;STARTUPDIR='||bootdrive||'\OS2\INSTALL\PRELOAD\;','R')
  219.  
  220. if rc = 1 then do
  221.    say 'Application Installation Overview icon was successfully installed.'
  222. end /* do */
  223.  
  224. else do
  225.    say
  226.    say 'A problem occured during the installation of the'
  227.    say 'Application Installation Overview.  This icon was not'
  228.    say 'created successfully.'
  229.    call reason
  230.    say
  231. end /* do */
  232.  
  233. /* create Services and Support in Features folder */
  234.  
  235. rc = SysCreateObject('WPProgram','Services and Support','<FEATURES>','EXENAME='||bootdrive||'\OS2\VIEW.EXE;PROGTYPE=PM;PARAMETERS=SERVICES.INF SERVICES AND SUPPORT;STARTUPDIR='||bootdrive||'\OS2\INSTALL\PRELOAD\;','R')
  236.  
  237. if rc = 1 then do
  238.    say 'Services and Support icon was successfully installed.'
  239. end /* do */
  240.  
  241. else do
  242.    say
  243.    say 'A problem occured during the installation of the'
  244.    say 'Services and Support.  This icon was not'
  245.    say 'created successfully.'
  246.    call reason
  247.    say
  248. end /* do */
  249.  
  250. /* create Your System in Features folder */
  251.  
  252. rc = SysCreateObject('WPProgram','Your System','<FEATURES>','EXENAME='||bootdrive||'\OS2\APPS\SYSINFO.EXE;PROGTYPE=PM;PARAMETERS=NULL;STARTUPDIR='||bootdrive||'\OS2\APPS\;','R')
  253.  
  254. if rc = 1 then do
  255.    say 'Your System icon was successfully installed.'
  256. end /* do */
  257.  
  258. else do
  259.    say
  260.    say 'A problem occured during the installation of the'
  261.    say 'Your System icon.  This icon was not'
  262.    say 'created successfully.'
  263.    call reason
  264.    say
  265. end /* do */
  266.  
  267. /* create For the DOS User in Tutorials folder */
  268.  
  269. rc = SysCreateObject('WPProgram','For the DOS User','<TUTORIALS>','EXENAME='||bootdrive||'\OS2\INSTALL\PRELOAD\DOSUSER.EXE;PROGTYPE=PM;PARAMETERS=D;STARTUPDIR='||bootdrive||'\OS2\INSTALL\PRELOAD\;','R')
  270.  
  271. if rc = 1 then do
  272.    say 'Your System icon was successfully installed.'
  273. end /* do */
  274.  
  275. else do
  276.    say
  277.    say 'A problem occured during the installation of the'
  278.    say 'Your System icon.  This icon was not'
  279.    say 'created successfully.'
  280.    call reason
  281.    say
  282. end /* do */    
  283.  
  284. /* create System Overview in Tutorials folder */
  285.  
  286. rc = SysCreateObject('WPProgram','System Overview','<TUTORIALS>','EXENAME='||bootdrive||'\OS2\INSTALL\PRELOAD\SYSOVER.EXE;PROGTYPE=PM;PARAMETERS=D;STARTUPDIR='||bootdrive||'\OS2\INSTALL\PRELOAD\;','R')
  287.  
  288. if rc = 1 then do
  289.    say 'System Overview icon was successfully installed.'
  290. end /* do */
  291.  
  292. else do
  293.    say
  294.    say 'A problem occured during the installation of the'
  295.    say 'System Overview icon.  This icon was not'
  296.    say 'created successfully.'
  297.    call reason
  298.    say
  299. end /* do */    
  300.  
  301. /* create Application Installation Overview in Tutorials folder */
  302.  
  303. rc = SysCreateObject('WPProgram','Application Installation Overview','<TUTORIALS>','EXENAME='||bootdrive||'\OS2\VIEW.EXE;PROGTYPE=PM;PARAMETERS=INSTALL.INF INSTALLING YOUR APPLICATIONS;STARTUPDIR='||bootdrive||'\OS2\INSTALL\PRELOAD\;','R')
  304.  
  305. if rc = 1 then do
  306.    say 'Application Installation Overview icon was successfully installed.'
  307. end /* do */
  308.  
  309. else do
  310.    say
  311.    say 'A problem occured during the installation of the'
  312.    say 'Application Installation Overview.  This icon was not'
  313.    say 'created successfully.'
  314.    call reason
  315.    say
  316. end /* do */
  317.  
  318. /* create Tutorial in the Tutorials folder */
  319.  
  320. rc = SysCreateObject('WPProgram','Tutorial','<TUTORIALS>','EXENAME='||bootdrive||'\OS2\TUTORIAL.EXE;PROGTYPE=PM;PARAMETERS=D;STARTUPDIR='||bootdrive||'\OS2\HELP\;','R')
  321.  
  322. if rc = 1 then do
  323.    say 'System Overview icon was successfully installed.'
  324. end /* do */
  325.  
  326. else do
  327.    say
  328.    say 'A problem occured during the installation of the'
  329.    say 'System Overview icon.  This icon was not'
  330.    say 'created successfully.'
  331.    call reason
  332.    say
  333. end /* do */    
  334.  
  335. /***************************************************************/
  336. /* Procedure: option                                           */
  337. /*                                                             */
  338. /* Prompts the user for continuation of creation of the        */
  339. /* Welcome Folder.                                             */
  340. /***************************************************************/
  341.  
  342. option:
  343. /*say 'Enter N(n), Y(y), or Q(q) to quit.'
  344. do forever
  345.    input = sysgetkey ()
  346.    input = translate(input)
  347.    say
  348.    select
  349.       when input = 'Y' then return
  350.       when input = 'N' then return
  351.       when input = 'Q' then return
  352.    otherwise
  353.       say 'Invalid input. Please enter N(n), Y(y), or Q(q) to quit.'
  354.       iterate
  355.    end  /* do */
  356.    end  /* select */
  357. end  /* do */   */
  358.  
  359. Say "Do you want to continue (Y/N)?"
  360. Parse Upper Pull yesno .
  361. If Substr(yesno,1,1) <> 'Y' Then Call quit
  362.  
  363. return
  364.  
  365. /***************************************************************/ 
  366. /* Procedure: reason                                           */
  367. /*                                                             */
  368. /* This procedure gives the user some knowledge as to why the  */
  369. /* icon did not successfully install.                          */
  370. /***************************************************************/ 
  371.  
  372. reason:
  373.    say 'The icon may not have installed because:'
  374.    say '   1.  This is not a feature that was preloaded on your system.'
  375.    say '   2.  The executable file was not located on you system.  It'
  376.    say '       may have been deleted.'
  377. return
  378.  
  379. /***************************************************************/  
  380. /* Procedure: quit                                             */
  381. /*                                                             */
  382. /* This procedure terminates the program at the appropriate    */
  383. /* time.  Determined by user or program completion             */
  384. /***************************************************************/  
  385.  
  386. quit:
  387.  
  388. say
  389. say 'Program terminated.'
  390.  
  391. exit
  392.  
  393.