home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / wuz131.zip / Install.Cmd < prev    next >
OS/2 REXX Batch file  |  1994-06-16  |  18KB  |  568 lines

  1. /* Rexx install program */
  2. /* Donated to the public domain Feb. 19, 1994 by Scott Maxwell. */
  3.  
  4. /* Note: I believe this to be a pretty intelligent install routine. */
  5. /*       Please modify it and use it as you like.            */
  6.  
  7. Call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  8. Call SysLoadFuncs
  9.  
  10. parse arg args
  11. if Left(args,1) = '"' then do
  12.   parse var args '"' where '"' tempdir
  13.   tempdir = strip(tempdir)
  14. end
  15. else
  16.   parse var args where tempdir
  17.  
  18.  
  19. KeepCommandLineWindow = 1
  20. WaitForUnzip  = 1
  21. UnzipInCommandLineWindow = 1    /* KeepCommandLineWindow must be 1 for this */
  22. UsePKZip = 0
  23.  
  24. foundInfoZip = ''
  25. foundInfoUnZip = ''
  26. foundPKZip = ''
  27. foundPKUnZip = ''
  28.  
  29.   Say "Welcome to Workplace UnZip!"'0a'x
  30.  
  31.   Say "WUZ is a series of REXX functions to give you access to archive"
  32.   Say "files (including .ARC, .ARJ, .LZH, .TAR, .Z, .ZIP and .ZOO) from"
  33.   Say "the Workplace Shell or the command line."'0a'x
  34.  
  35. top:
  36.   do while queued()>0
  37.      parse pull ans
  38.   end
  39.  
  40. ucnt = 1
  41. final = ''
  42. AutoMatic = 1
  43.  
  44. if where = '' then do
  45.   where = ''
  46.   path = Value('PATH',,'OS2ENVIRONMENT')
  47.  
  48.   i = 1
  49.   found = 0
  50.   dir. = ''
  51.   do forever
  52.     parse var path dir.i ';' path
  53.     if Right(dir.i,1) \= '\' then
  54.       dir.i = dir.i'\'
  55.     if SubStr(dir.i,2,1) = ':' then do
  56.       if foundInfoUnZip == '' then
  57.         foundInfoUnZip = Stream( dir.i'unzip.exe', 'c', 'query exists' )
  58.       if foundInfoZip == '' then
  59.         foundInfoZip = Stream( dir.i'zip.exe', 'c', 'query exists' )
  60.       if foundPKUnZip == '' then
  61.         foundPKUnZip = Stream( dir.i'pkunzip.exe', 'c', 'query exists' )
  62.       if foundPKZip == '' then
  63.         foundPKZip = Stream( dir.i'pkzip.exe', 'c', 'query exists' )
  64.       if Stream( dir.i'wuz.cmd', 'C', 'QUERY EXISTS' ) \= '' then do
  65.         found=i
  66.         Call LineIn dir.found'wuz.cmd'
  67.         Call LineIn dir.found'wuz.cmd'
  68.         Call LineIn dir.found'wuz.cmd'
  69.         Call LineIn dir.found'wuz.cmd'
  70.         old = LineIn(dir.found'wuz.cmd')
  71.         if Left(old,8) \= 'DestPath' then do
  72.           preamble = "A version of WUZ.CMD I don't recognize"
  73.       old = ''
  74.       end
  75.         else do
  76.           old = SubStr(old,13,Length(old)-13)
  77.       preamble = 'WUZ'
  78.           Call LineIn dir.found'wuz.cmd'
  79.           Call LineIn dir.found'wuz.cmd'
  80.  
  81.           hold = LineIn(dir.found'wuz.cmd')
  82.           var = "KeepCommandLineWindow"
  83.           if Abbrev(hold,var' = 0') | Abbrev(hold,var' = 1') then
  84.             interpret var "= SubStr(hold,Length(var)+4,1)"
  85.  
  86.           hold = LineIn(dir.found'wuz.cmd')
  87.           var = "WaitForUnzip"
  88.           if Abbrev(hold,var' = 0') | Abbrev(hold,var' = 1') then
  89.             interpret var "= SubStr(hold,Length(var)+4,1)"
  90.  
  91.           hold = LineIn(dir.found'wuz.cmd')
  92.           var = "UnzipInCommandLineWindow"
  93.           if Abbrev(hold,var' = 0') | Abbrev(hold,var' = 1') then
  94.             interpret var "= SubStr(hold,Length(var)+4,1)"
  95.  
  96.           hold = LineIn(dir.found'wuz.cmd')
  97.           var = "UsePKZip"
  98.           if Abbrev(hold,var' = 0') | Abbrev(hold,var' = 1') then
  99.             interpret var "= SubStr(hold,Length(var)+4,1)"
  100.         end
  101.     Call LineOut dir.found'wuz.cmd'
  102.     if Stream( dir.found'Post-WUZ.cmd', 'C', 'QUERY EXISTS' ) \= '' then do
  103.       Call Linein(dir.found'Post-wuz.cmd')
  104.       Call Linein(dir.found'Post-wuz.cmd')
  105.       Call Linein(dir.found'Post-wuz.cmd')
  106.       final = Linein(dir.found'Post-wuz.cmd')
  107.       if Left(final,12)\='FinalCommand' | Right(final,3) = "=''" then
  108.         final=''
  109.       ucnt = 1
  110.       user.ucnt = Linein(dir.found'Post-wuz.cmd')
  111.       if Left(user.ucnt,11) = '/* ---- You' then
  112.       do ucnt=2 to 50
  113.         user.ucnt = Linein(dir.found'Post-wuz.cmd')
  114.         if Left(user.ucnt,12) = '/* ---- They' then leave
  115.       end
  116.     end
  117.     Call LineOut dir.found'Post-wuz.cmd'
  118.       end
  119.       i=i+1
  120.     end
  121.     if path='' then leave
  122.   end
  123.  
  124.   if found > 0 then
  125.   do forever
  126.     Say preamble "seems to be installed in" dir.found'0a'x
  127.     Say "0) Use the current copy (i.e. aborting this install)"
  128.     Say "1) Copy over the current version, keep current settings"
  129.     Say "2) Copy over the current version, change settings"
  130.     Say "3) Remove the current copy of WUZ and install somewhere else"
  131.     Say "4) Remove every last trace of WUZ from your computer"'0a'x
  132.     Call CharOut ,"What would you like to do: "
  133.     parse upper pull ans
  134.     if ans = 0 | ans = '' then exit(0)
  135.     if ans < 0 | ans > 4 then do
  136.       say '0a'x"Please answer either 0, 1, 2, 3, 4 or <RETURN>"
  137.       iterate
  138.     end
  139.  
  140.     if ans>=3 then do
  141.       say "Erasing:    wuz.cmd"
  142.       say "        wuz.ico"
  143.       say "        post-wuz.cmd"
  144.       say "        zipstrip.cmd"
  145.       say "        zip-dir.cmd"
  146.       say "        zip-dir.ico"
  147.       say "        fldzip.ico"
  148.       say "        fldunzip.ico"
  149.       say "        od.cmd"
  150.       say "        open-dir.cmd"
  151.       say "        wpset.cmd"
  152.       say "        kd.cmd"
  153.       say "        kill-dir.cmd from" dir.found'0a'x
  154.       Call SysFileDelete dir.found'wuz.cmd'
  155.       Call SysFileDelete dir.found'wuz.ico'
  156.       Call SysFileDelete dir.found'post-wuz.cmd'
  157.       Call SysFileDelete dir.found'zipstrip.cmd'
  158.       Call SysFileDelete dir.found'zip-dir.cmd'
  159.       Call SysFileDelete dir.found'zip-dir.ico'
  160.       Call SysFileDelete dir.found'fldzip.ico'
  161.       Call SysFileDelete dir.found'fldunzip.ico'
  162.       Call SysFileDelete dir.found'od.cmd'
  163.       Call SysFileDelete dir.found'open-dir.cmd'
  164.       Call SysFileDelete dir.found'wpset.cmd'
  165.       Call SysFileDelete dir.found'kill-dir.cmd'
  166.       Call SysFileDelete dir.found'kd.cmd'
  167.       Call SysDestroyObject '<WorkplaceUnZip>'
  168.       Call SysDestroyObject '<ZipDir>'
  169.       if ans = 4 then exit(1)
  170.     end      
  171.     if ans=1 then do
  172.       where = dir.found
  173.       AutoMatic = 1
  174.     end
  175.     if ans=2 then do
  176.       where = dir.found
  177.       AutoMatic = 0
  178.     end
  179.     leave
  180.   end
  181.   else
  182.     Say "Apparently, this is the first time you are installing WPS UnZip."
  183.   do while ans \=1 & ans \= 2
  184.     Say "There are two ways to install:"'0a'x
  185.     Say "1) Don't ask me any questions. Just do it!"
  186.     Say "2) Hey, I want to know what's going on.  Ask me everything."
  187.     Say "X) Actually, maybe I won't install right now."'0a'x
  188.     Call CharOut ,"Which would you like to do: "
  189.     parse upper pull ans
  190.     if ans = 'X' | ans = '' then exit(0)
  191.     if ans < 1 | ans > 2 then do
  192.       say '0a'x"Please answer either 0, 1, 2, 3 or <RETURN>"
  193.       iterate
  194.     end
  195.     if ans = 1 then
  196.       AutoMatic = 1
  197.     else
  198.       AutoMatic = 0
  199.     Call CharOut ,'0a'x
  200.   end
  201.  
  202.   if where = '' then do
  203.     i = i-1
  204.     root=FileSpec('Drive',Value('SYSTEM_INI',,'OS2ENVIRONMENT'))
  205.     if AutoMatic = 1 then do
  206.       where = root'\OS2'
  207.       Say "WUZ will be installed in" where
  208.     end
  209.     else do
  210.       Say "WUZ must be installed in a directory on your PATH:"'0a'x
  211.       base=1
  212.       nonbase=1
  213.       basedir. = ''
  214.       do j=1 to i
  215.         if Left(dir.j,6) = root'\OS2' | Left(dir.j,8) = root'\MMOS2' | dir.j = root'\' then do
  216.           basedir.base = dir.j
  217.       base = base+1
  218.         end
  219.         else do
  220.           dir.nonbase = dir.j
  221.           nonbase = nonbase+1
  222.         end
  223.       end
  224.       if base > 0 then do
  225.         k = 1
  226.         do j=nonbase to i
  227.           dir.j = basedir.k
  228.           k = k+1
  229.         end
  230.       end
  231.       dir.0 = i
  232.       tr = Trunc((i+1)/2)
  233.       do i=1 to tr
  234.         i2 = i+tr
  235.         build  = '('i')' dir.i
  236.         if dir.i2 \= '' then
  237.           build2 = '('i2')' dir.i2
  238.         else
  239.           build2 = ''
  240.         say insert(build,build2,,40)
  241.       end
  242.       Call CharOut ,'0a'x"Enter the number of your selection: "
  243.       parse pull ans
  244.       if ans > 0 & ans <= dir.0 then
  245.         where = dir.ans
  246.       else do
  247.         say "Invalid number.  Aborting"
  248.         exit(0)
  249.       end
  250.     end
  251.   end
  252.   tempdir = '\'
  253.   hold = directory()
  254. end
  255. else do
  256.   hold = directory()
  257.   where2 = directory(where)
  258.   if where2 = '\' then do
  259.     say "Unknown directory:" where
  260.     where = ''
  261.     Call Directory hold
  262.     Signal top
  263.   end
  264.   where = where2
  265.   if tempdir = '' then
  266.     tempdir = '\'
  267.   else
  268.     tempdir = directory(tempdir)
  269. end
  270.  
  271. do while tempdir = '\'
  272.   temp = ''
  273.   if found > 0 then temp = old
  274.   if temp = '' then
  275.     temp = Value('TMP',,'OS2ENVIRONMENT')
  276.     if temp = '' then
  277.       temp = Value('TEMP',,'OS2ENVIRONMENT')
  278.   if SubStr(temp,2,1) != ':' then temp = ''
  279.   slash = 1
  280.   if Right(temp,1) = '/' then
  281.     temp = Left(temp,Length(temp)-1)
  282.   do while slash > 0
  283.     slash = LastPos('/',temp)
  284.     if slash > 0 then
  285.       temp = Left(temp,slash-1)'\'Right(temp,slash+1)
  286.   end
  287.   if temp = '' then do
  288.     free = 0
  289.     drv = 'C:'
  290.     map = SysDriveMap('C:','LOCAL')
  291.     do i = 1 to words(map)
  292.       temp = SysDriveInfo(Word(map,i))
  293.       if Word(temp,2) > free then do
  294.         free = Word(temp,2)
  295.         drv = Word(map,i)
  296.       end
  297.     end
  298.     temp = Left(drv,2)'\Temp'
  299.   end
  300.   Say "WUZ will create a temporary directory for each archive it extracts."
  301.   if AutoMatic = 1 then
  302.     Say "Let's try putting the them in" temp'.'
  303.   else do
  304.     Call CharOut ,"Where should it create them? (<RETURN> for" temp") "
  305.     parse pull tempdir
  306.     if tempdir\='' then
  307.       temp = tempdir
  308.     do while Right(tempdir,2) == '\\' then
  309.       tempdir = Left(tempdir,Length(tempdir)-1)
  310.     end
  311.   end
  312.  
  313.   call Directory hold
  314.   tempdir = directory(temp)
  315.   if tempdir = '\' then do
  316.     if AutoMatic = 1 then
  317.       ans = 'Y'
  318.     else do
  319.       Call CharOut ,temp "does not exist.  Should I create it? "
  320.       parse upper pull ans
  321.     end
  322.     if Left(ans,1) = 'Y' then do
  323.       if SysMkDir(temp) then do
  324.         say "Can't create" temp
  325.         if AutoMatic = 1 then do
  326.           say "Using" Left(temp,3) "instead."
  327.           tempdir = Left(temp,3)
  328.         end
  329.       end
  330.       else
  331.         tempdir = temp
  332.     end
  333.   end
  334. end
  335. if Right(tempdir,1) \= '\' then tempdir = tempdir'\'
  336.  
  337. if AutoMatic = 0 then do
  338.   say ""
  339.   if foundInfoUnZip \= '' then
  340.     say 'Found InfoUnZip:' foundInfoUnZip
  341.   if foundInfoZip \= '' then
  342.     say 'Found InfoZip  :' foundInfoZip
  343.   if foundPKUnZip \= '' then
  344.     say 'Found PKUnZip  :' foundPKUnZip
  345.   if foundPKZip \= '' then
  346.     say 'Found PKZip    :' foundPKZip
  347. end
  348. if foundPKZip \= '' then do
  349.   foundPKZip = Stream( foundPKZip, 'c', 'query datetime' )
  350.   parse var foundPKZip . '-' . '-' foundPKZip ' ' .
  351. end
  352. if foundPKUnZip \= '' then do
  353.   foundPKUnZip = Stream( foundPKUnZip, 'c', 'query datetime' )
  354.   parse var foundPKUnZip . '-' . '-' foundPKUnZip ' ' .
  355. end
  356. select
  357.   when foundPKUnZip = '' & foundInfoUnZip = '' then
  358.     UsePKZip = 0
  359.   when foundPKUnZip = '' & foundInfoUnZip \= '' then
  360.     UsePKZip = 0
  361.   when foundPKUnZip \= '' & foundInfoUnZip = '' then
  362.     UsePKZip = 1
  363.   when foundPKUnZip < 93 & foundInfoUnZip \= '' then do
  364.     if AutoMatic = 0 then
  365.       say '0a'x"PKUnZip is old.  Using Info-UnZip."
  366.     UsePKZip = 0
  367.   end
  368.   when foundPKZip = '' & foundInfoZip \= '' then do
  369.     if AutoMatic = 0 then
  370.       say '0a'x"Using Info-Zip/UnZip because PKZip could not be found."
  371.     UsePKZip = 0
  372.   end
  373.   when foundPKZip > 92 & foundPKUnZip > 92 & foundInfoZip = '' then do
  374.     if AutoMatic = 0 then
  375.       say '0a'x"Using PKZip/UnZip because Info-Zip could not be found."
  376.     UsePKZip = 1
  377.   end
  378.   when (foundPKZip > 92 & foundPKUnZip > 92 & foundInfoZip \= '') | (foundPKZip == '' & foundInfoZip == '') then
  379.     if AutoMatic = 0 then do
  380.       Say '0a'x"You seem to have both PKUnZip and Info-UnZip on your system."
  381.       Say "Info-UnZip is probably an OS/2 application and PKUnZip probably is not."
  382.       Say "Therefore, you may have better results with Info-UnZip."
  383.       if UsePKZip = 0 then
  384.         Call CharOut ,"Which would you prefer ('P' for PK, 'I' or <RETURN> for Info) "
  385.       else
  386.         Call CharOut ,"Which would you prefer ('I' for Info, 'P' or <RETURN> for PK) "
  387.       parse upper pull aack
  388.       if Abbrev(aack,'P') then UsePKZip = 1
  389.       else if Abbrev(aack,'I') then UsePKZip = 0
  390.     end
  391.   otherwise nop
  392. end
  393.  
  394. if AutoMatic = 0 then do
  395.   Say '0a'x"If you are used to DOS, you may want a command line."
  396.   Say "If you are a former MacIntosh user or a WPS purist, you probably don't."
  397.   if KeepCommandLineWindow = 1 then
  398.     ans = "Yes"
  399.   else
  400.     ans = "No"
  401.   Call CharOut ,"Would you like to keep a command line? (<RETURN> for" ans") "
  402.   parse upper pull keepAnswer
  403.   if keepAnswer = '' then keepAnswer = ans
  404.   if Left(keepAnswer,1) = 'Y' then do
  405.     KeepCommandLineWindow = 1
  406.     UnzipInCommandLineWindow = 1
  407.   end
  408.   else if Left(keepAnswer,1) = 'N' then do
  409.     KeepCommandLineWindow = 0
  410.     UnzipInCommandLineWindow = 0
  411.   end
  412. end
  413.  
  414. call Directory hold
  415.  
  416. if where \= '.' then do
  417.   from = directory()
  418.   to = directory(where)
  419.   if to = '\' then do
  420.     say where': directory not found'
  421.     exit(1)
  422.   end
  423.   say '0a'x"Copying:    wuz.cmd"
  424.   say "        wuz.ico"
  425.   say "        post-wuz.cmd"
  426.   say "        zipstrip.cmd"
  427.   say "        zip-dir.cmd"
  428.   say "        zip-dir.ico"
  429.   say "        fldzip.ico"
  430.   say "        fldunzip.ico"
  431.   say "        od.cmd"
  432.   say "        open-dir.cmd"
  433.   say "        wpset.cmd"
  434.   say "        kd.cmd"
  435.   say "        kill-dir.cmd to "to
  436.  
  437.   Drive = Left(tempdir,2)
  438.   Call SysFileDelete 'wuz.cmd'
  439.   Call LineOut 'WUZ.cmd',linein('"'from'wuz.tpl"')
  440.   Call LineOut 'wuz.cmd',linein('"'from'wuz.tpl"')
  441.   Call LineOut 'wuz.cmd',linein('"'from'wuz.tpl"')
  442.   Call LineIn '"'from'wuz.tpl"'
  443.   Call LineIn '"'from'wuz.tpl"'
  444.   Call LineIn '"'from'wuz.tpl"'
  445.   Call LineIn '"'from'wuz.tpl"'
  446.   Call LineIn '"'from'wuz.tpl"'
  447.   Call LineIn '"'from'wuz.tpl"'
  448.   Call LineIn '"'from'wuz.tpl"'
  449.   Call LineIn '"'from'wuz.tpl"'
  450.   Call LineOut 'wuz.cmd',"Drive    = '"Drive"'"
  451.   Call LineOut 'wuz.cmd',"DestPath = '"tempdir"'"
  452.   Call LineOut 'wuz.cmd',"IconPath = '"to"'"
  453.   Call LineOut 'wuz.cmd',""
  454.   Call LineOut 'wuz.cmd',"KeepCommandLineWindow =" KeepCommandLineWindow
  455.   Call LineOut 'wuz.cmd',"WaitForUnzip =" WaitForUnzip
  456.   Call LineOut 'wuz.cmd',"UnzipInCommandLineWindow =" UnzipInCommandLineWindow"    /* KeepCommandLineWindow must be 1 for this */"
  457.   Call LineOut 'wuz.cmd',"UsePKZip =" UsePKZip
  458.   do while lines('"'from'wuz.tpl"') > 0
  459.     Call LineOut 'wuz.cmd',LineIn('"'from'wuz.tpl"')
  460.   end
  461.   Call LineOut 'wuz.cmd'
  462.   Call LineOut '"'from'wuz.tpl"'
  463.   '@copy "'from'wuz.ico" WUZ.ico > nul'
  464.  
  465.   if ucnt > 2 | final \= '' then do
  466.     Call SysFileDelete 'post-wuz.cmd'
  467.     Call LineOut 'Post-WUZ.cmd',linein('"'from'Post-wuz.tpl"')
  468.     Call LineOut 'Post-WUZ.cmd',linein('"'from'Post-wuz.tpl"')
  469.     Call LineOut 'Post-WUZ.cmd',linein('"'from'Post-wuz.tpl"')
  470.     Say ''
  471.     if final \= '' then do
  472.       Say "Preserving FinalCommand from" where"Post-WUZ.CMD"
  473.       Say final
  474.       Call LineIn '"'from'Post-wuz.tpl"'
  475.       Call LineOut 'Post-WUZ.cmd',final
  476.     end
  477.     else
  478.       Call LineOut 'Post-WUZ.cmd',linein('"'from'Post-wuz.tpl"')
  479.     if ucnt > 2 then do
  480.       Say "Preserving user lines from" where"Post-WUZ.CMD"
  481.       Call LineIn '"'from'Post-wuz.tpl"'
  482.       Call LineIn '"'from'Post-wuz.tpl"'
  483.       do i=1 to ucnt
  484.         Call LineOut 'Post-WUZ.cmd',user.i
  485.       end
  486.     end
  487.     else do
  488.       Call LineOut 'Post-WUZ.cmd',linein('"'from'Post-wuz.tpl"')
  489.       Call LineOut 'Post-WUZ.cmd',linein('"'from'Post-wuz.tpl"')
  490.     end
  491.     do while lines('"'from'Post-WUZ.tpl"') > 0
  492.       Call LineOut 'Post-WUZ.cmd',LineIn('"'from'post-wuz.tpl"')
  493.     end
  494.     Call LineOut 'Post-wuz.cmd'
  495.     Call LineOut 'Post-wuz.tpl'
  496.   end
  497.   else
  498.     '@copy' '"'from'post-wuz.tpl" Post-WUZ.Cmd > nul'
  499.  
  500.   Call SysFileDelete 'ZipStrip.cmd'
  501.   Call LineOut 'ZipStrip.cmd',linein('"'from'ZipStrip.tpl"')
  502.   Call LineOut 'ZipStrip.cmd',linein('"'from'ZipStrip.tpl"')
  503.   Call LineOut 'ZipStrip.cmd',linein('"'from'ZipStrip.tpl"')
  504.   Call LineIn '"'from'ZipStrip.tpl"'
  505.   Call LineOut 'ZipStrip.cmd',"UsePKZip =" UsePKZip
  506.   do while lines('"'from'ZipStrip.tpl"') > 0
  507.     Call LineOut 'ZipStrip.cmd',LineIn('"'from'ZipStrip.tpl"')
  508.   end
  509.   Call LineOut 'ZipStrip.cmd'
  510.   Call LineOut '"'from'ZipStrip.tpl"'
  511.   Call SysFileDelete 'zip-dir.cmd'
  512.   Call LineOut 'Zip-Dir.cmd',linein('"'from'zip-dir.tpl"')
  513.   Call LineOut 'zip-dir.cmd',linein('"'from'zip-dir.tpl"')
  514.   Call LineOut 'zip-dir.cmd',linein('"'from'zip-dir.tpl"')
  515.   Call LineIn '"'from'zip-dir.tpl"'
  516.   Call LineIn '"'from'zip-dir.tpl"'
  517.   Call LineOut 'zip-dir.cmd',"IconPath = '"to"'"
  518.   Call LineOut 'zip-dir.cmd',"UsePKZip =" UsePKZip
  519.   do while lines('"'from'zip-dir.tpl"') > 0
  520.     Call LineOut 'zip-dir.cmd',LineIn('"'from'zip-dir.tpl"')
  521.   end
  522.   Call LineOut 'zip-dir.cmd'
  523.   Call LineOut '"'from'zip-dir.tpl"'
  524.   '@copy "'from'zip-dir.ico" > nul'
  525.   '@copy "'from'fldzip.ico" > nul'
  526.   '@copy "'from'fldunzip.ico" > nul'
  527.   '@copy "'from'open-dir.cmd" > nul'
  528.   '@copy "'from'open-dir.cmd" od.cmd > nul'
  529.   '@copy "'from'wpset.cmd" > nul'
  530.   '@copy "'from'kill-dir.cmd" > nul'
  531.   '@copy "'from'kill-dir.cmd" kd.cmd > nul'
  532.   Call Directory from
  533. end
  534. else
  535.   to = directory()
  536.  
  537. Call SysDestroyObject '<WorkplaceUnZip>'
  538. Call SysCreateObject "WPProgram", "WPS Unzip", "<WP_DESKTOP>",,
  539.     "OBJECTID=<WorkplaceUnZip>;PROGTYPE=WINDOWABLEVIO;EXENAME="to"wuz.cmd;ASSOCFILTER=*.arc,*.arj,*.lzh,*.tar,*.z,*.zif,*.zip,*.zoo;SET=WUZMIN="keepAnswer
  540. Call SysDestroyObject '<ZipDir>'
  541. here = directory()
  542. Call SysCreateObject "WPProgram", "Zip Directory", "<WP_DESKTOP>",,
  543.     "OBJECTID=<ZipDir>;PROGTYPE=WINDOWABLEVIO;EXENAME="to"zip-dir.cmd"
  544.  
  545. Say '0a'x"Workplace UnZip v1.1 has been successfully installed."
  546. Say "Try it out and see if you like it.  If you do, I would appreciate"
  547. Say "a small cash donation of $20 or at least a note telling me what"
  548. Say "you think.  My Usenet address is scott.maxwell@channel1.com."
  549. Say "Any money should go to:"
  550. Say "                         Patricia Maxwell"
  551. Say "                         1587 E. Modesto Ave."
  552. Say "                         Camarillo, CA 93010 U.S.A."'0a'x
  553.  
  554. Say "You may also rerun Install.Cmd to uninstall."
  555. Say "For more information about Workplace UnZip, read ReadMe.WUZ and WUZ.Doc."
  556. exit(0)
  557.  
  558. Directory: procedure
  559.   arg Name
  560.   Name = Strip(Name,,'"')
  561.   if Length(Name) > 3 then
  562.     if Right(Name,1) = '\' then
  563.       Name = Left(Name,LENGTH(Name)-1)
  564.   n = 'DIRECTORY'(Name)
  565.   if Right(n,1) \= '\' then
  566.     n = n'\'
  567. return n
  568.