home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / pmpdf01.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  2001-12-21  |  2KB  |  90 lines

  1. /**/
  2. call rxfuncadd sysloadfuncs,rexxutil,sysloadfuncs
  3. call sysloadfuncs
  4.  
  5. version = "0.1.11"
  6. gsincluded = 'gs703os2.zip'
  7. gslocationzip = 'gs7.03'
  8.  
  9. say 'PMPDF Poor Mans PDF, a Acrobat substitue'
  10. say 'version :' version 'Instalation utility'
  11. say 'homepage: http://pmpdf.netlabs.org'
  12. say 'help    : pmpdf@yahoogroups.com'
  13. say
  14.  
  15. say 'checking packages.....'
  16. pdr = checkfile('pdfwrite.pdr')
  17. gs = checkfile(gsincluded)
  18. ps = checkfile('pscript\*')
  19. parse upper arg gslocation
  20.  
  21. say "Where do you want to store your PDF's ?"
  22. pull pdflocation
  23. say "Where is GhostScript Installed ??"
  24. pull gslocation
  25. call sysfiletree gslocation'\bin\gsos2.exe','gsfile', 'FSO'
  26. do while gsfile.0 = 0
  27.  /* checking for ghostscript*/
  28.  
  29.  if gsfile.0 = 0 then do
  30.   if gs=0 then do
  31.    say 'GhostScript NOT found !'
  32.    say "Where is GhostScript Installed ??"
  33.    pull gslocation
  34.    call sysfiletree gslocation'\bin\gsos2.exe','gsfile', 'FSO'
  35.   end
  36.   else
  37.   do
  38.   say 'Install Ghostscript in: 'gslocation' ?'
  39.   parse upper pull installgs
  40.   if installgs='Y' then do
  41.    '@unzip -d' gslocation gsincluded
  42.    gslocation = gslocation'\'gslocationzip
  43.   end
  44.   else
  45.    exit
  46.   end
  47.   leave
  48.  end
  49.  else
  50.   leave
  51. end
  52.  
  53. call sysini 'SYSTEM','PM_PDF','INITIALIZATION',gslocation';'pdflocation||x2c('0')
  54.  
  55.  
  56. "@rinstprn.exe /R:"getrspname()
  57.  
  58. exit
  59.  
  60. getrspname:
  61.  
  62.       rc = sysini('BOTH','FolderWorkareaRunningObjects','ALL:','Objects')
  63.       bootdrive=left(Objects.1,1)
  64.       Say 'Looking for postscript driver in: 'bootdrive':\OS2'
  65.       call sysfiletree bootdrive':\OS2\pscript.drv','file', 'FSO'
  66.       if file.0 = 0 then do
  67.         rspname = nops.rsp
  68.         Say "PSCRIPT.DRV not found installing now"
  69.         end
  70.       else do
  71.         rspname = withps.rsp
  72.         Say "PSCRIPT.DRV found using installed version"
  73.         end
  74.       return rspname
  75.  
  76. checkfile:
  77.      arg filetocheck
  78.      call sysfiletree filetocheck,'file', 'FSO'
  79.       if file.0 = 0 then do
  80.         rspname = 0
  81.         Say filetocheck' ... Not Found !!'
  82.         end
  83.       else do
  84.         rspname = 1
  85.         Say filetocheck' ... Found'
  86.         end
  87.       return rspname
  88.  
  89.  
  90.