home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 December / Chip_1999-12_cd.bin / zkuste / Svet_OS2 / WARPNOTE / WNOTE185.ZIP / install.cmd < prev    next >
Encoding:
Text File  |  1999-07-31  |  5.4 KB  |  210 lines

  1. /*****************************************************************************/
  2. /* INSTALL.CMD Installation script using REXX, allowing upgrade installation */
  3. /* (c)1997 Uwe Schlenther Software, Bebelstraße 30, 70193 Stuttgart, Germany */
  4. /*****************************************************************************/
  5.  
  6. SIGNAL ON ERROR NAME Err
  7.  
  8. Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  9. Call SysLoadFuncs;
  10.  
  11. AppName="WarpNote"
  12. ExeFile="WARPNOTE.EXE"
  13. DefaultDir="C:\WarpNote"
  14.  
  15. Call SysFileTree ExeFile,"dirs","FO"
  16.  
  17. if dirs.0<>1 then do
  18.   say ""
  19.   say "It seems you haven't unpacked the archive file."
  20.   say "Please do so and try again."
  21.   exit
  22. end
  23.  
  24. say ""
  25. say "You're about to install "AppName". Welcome !"
  26. say ""
  27. say "Do you want to upgrade a previous installation of "AppName" ? (Y/N)"
  28. pull answer
  29.  
  30. if answer="Y" then do
  31.   call Upgrade
  32. end
  33. else do
  34.   call Install
  35. end
  36.  
  37. exit
  38.  
  39.  
  40.  
  41. CopyFiles:
  42.   arg Path
  43.  
  44.   call SysMkDir Path
  45.  
  46.   INTERPRET "'COPY WARPNOTE.EX? 'Path'\*.*'"
  47.   INTERPRET "'COPY WNOTEGER.DLL 'Path'\*.*'"
  48.   INTERPRET "'COPY WARPNOTE.INF 'Path'\*.*'"
  49.   INTERPRET "'COPY WNCOMM.EXE 'Path'\*.*'"
  50.   INTERPRET "'COPY BIRTHDAY.* 'Path'\*.*'"
  51.  
  52.   Call SysFileTree Path"\WARPNOTE.DLL","dllfile","FO"
  53.  
  54.   if dllfile.0=1 then do
  55.     INTERPRET "'DEL 'Path'\WARPNOTE.DLL'"
  56.     say ""
  57.     say "You might need a new language module for the new version of WarpNote."
  58.     say ""
  59.   end
  60.  
  61.   say ""
  62.   say "Do you want to use the German language module ?"
  63.   say "Soll die deutsche Sprachunterstützung aktiviert werden ?"
  64.   say "(Y[es]/N[o])  (J[a]/N[ein])"
  65.   PULL answer
  66.  
  67.   if (answer="Y") | (answer="J") then signal German
  68.  
  69.   return 0
  70.  
  71. German:
  72.   INTERPRET "'ren 'Path'\WNOTEGER.DLL WARPNOTE.DLL'"
  73.  
  74. return 0
  75.  
  76. CreateObjects:
  77.   arg Path
  78.  
  79.   say ""
  80.   say "Do you want to create/update program objects for "AppName" ? (Y/N)"
  81.   pull answer
  82.  
  83.   if answer="Y" then do
  84.     say ""
  85.     say "Creating WPS objects..."
  86.  
  87.     /* Folder */
  88.     klasse='WPFolder'
  89.     titel='WarpNote'
  90.     ort='<WP_DESKTOP>'
  91.     param='OBJECTID=<WNOTE_ORDNER>;'
  92.     mode='f'
  93.     rc = SysCreateObject(klasse,titel,ort,param,mode)
  94.  
  95.     /* Das Programmobjekt anlegen */
  96.     klasse='WPProgram'
  97.     titel='WarpNote'
  98.     ort='<WNOTE_ORDNER>'
  99.     param='PROGTYPE=PM;EXENAME='Path'\WARPNOTE.EXE;STARTUPDIR='Path';'
  100.     mode='r'
  101.     rc = SysCreateObject(klasse,titel,ort,param,mode)
  102.  
  103.     /* Das Hilfeobjekt anlegen */
  104.     klasse='WPProgram'
  105.     titel='WarpNote Information'
  106.     ort='<WNOTE_ORDNER>'
  107.     param='PROGTYPE=PM;NOPRINT=YES;HELPPANEL=4083;EXENAME=VIEW.EXE;NOPRINT=YES;STARTUPDIR='Path';PARAMETERS='Path'\WARPNOTE.INF;'
  108.     mode='r'
  109.     rc = SysCreateObject(klasse,titel,ort,param,mode)
  110.  
  111.     /* Das Geburtstagsobjekt anlegen */
  112.     klasse='WPProgram'
  113.     titel='Birthday Reminder'
  114.     ort='<WNOTE_ORDNER>'
  115.     param='PROGTYPE=PM;NOPRINT=YES;HELPPANEL=4083;EXENAME='Path'\BIRTHDAY.CMD;NOPRINT=YES;STARTUPDIR='Path';'
  116.     mode='r'
  117.     rc = SysCreateObject(klasse,titel,ort,param,mode)
  118.  
  119.     klasse='WPProgram'
  120.     titel='Birthday List'
  121.     ort='<WNOTE_ORDNER>'
  122.     param='PROGTYPE=PM;NOPRINT=YES;HELPPANEL=4083;EXENAME=E.EXE;NOPRINT=YES;STARTUPDIR='Path';PARAMETERS='Path'\BIRTHDAY.TXT;'
  123.     mode='r'
  124.     rc = SysCreateObject(klasse,titel,ort,param,mode)
  125.  
  126.     /* Das Clipboard-Objekt anlegen */
  127.     klasse='WPProgram'
  128.     titel='Create Note from Clipboard'
  129.     ort='<WNOTE_ORDNER>'
  130.     param='PROGTYPE=PM;NOPRINT=YES;HELPPANEL=4083;EXENAME='Path'\WNCOMM.EXE;NOPRINT=YES;STARTUPDIR='Path';PARAMETERS=CLIPBOARD;'
  131.     mode='r'
  132.     rc = SysCreateObject(klasse,titel,ort,param,mode)
  133.  
  134.   end
  135.  
  136. return 0
  137.  
  138.  
  139. Install:
  140.  
  141. Question:
  142.   say ""
  143.   say "Where do you want to copy the files for "AppName" ?"
  144.   say "(e.g. "DefaultDir")  "
  145.   PARSE PULL path
  146.   IF path = "" THEN path=DefaultDir
  147.   say ""
  148.   say AppName" files will be copied to "path
  149.   say ""
  150.   say "Press <return> to continue, <E> to enter a new location or"
  151.   say "<C> to cancel."
  152.   pull answer
  153.  
  154.   if answer="C" then exit
  155.   if answer="E" then signal Question
  156.  
  157.   call CopyFiles path
  158.  
  159.   call CreateObjects path
  160.  
  161. return 0
  162.  
  163. Upgrade:
  164.   say ""
  165.   say "Please make a backup copy of the birthday list BIRTHDAY.TXT in"
  166.   say "the WarpNote directory if you have made changes."
  167.   say ""
  168.   say "Press RETURN to continue..."
  169.   pull answer
  170.  
  171.   dirs.0=0
  172.  
  173.   do until (LENGTH(drive)=1) & (dirs.0>0)
  174.     say ""
  175.     say "On what drive do you expect your installation ? (C,D,...)"
  176.     pull drive
  177.     if LENGTH(drive)=1 then do
  178.       call SysFileTree drive":\"ExeFile,"dirs","FSO"
  179.       if dirs.0=0 then say "The installation was not found on drive "drive"."
  180.     end
  181.   end
  182.  
  183.   do i=1 to dirs.0
  184.     dirs.i=FILESPEC("D",dirs.i) || FILESPEC("P",dirs.i)
  185.     l=LENGTH(dirs.i)
  186.     if l>3 then if SUBSTR(dirs.i,l,1)="\" then dirs.i=SUBSTR(dirs.i,1,l-1)
  187.     say ""
  188.     say "Do you want to upgrade "AppName" in "dirs.i" ? (Y/N)"
  189.     say ""
  190.     pull answer
  191.     if answer="Y" then do
  192.       call CopyFiles dirs.i
  193.       call CreateObjects dirs.i
  194.     end
  195.   end
  196. return 0
  197.  
  198. Err:
  199.   say ""
  200.   say "An error has occured. Possible causes are:"
  201.   say ""
  202.   say " - You have interrupted installation by pressing CTRL-BREAK."
  203.   say " - A file is missing in the package. Try to unpack the archive file again."
  204.   say " - A file cannot be replaced because it is in use. Make sure the program"
  205.   say "   you're about to install is not running currently."
  206.   say ""
  207.   say "Please try again later."
  208. exit
  209.  
  210.