home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / ovladace / xdiag / mvdxdiag.exe / UNINSTAL.DAT < prev   
Encoding:
Text File  |  1995-03-20  |  4.6 KB  |  168 lines

  1. include qcfgglb.dat
  2. include tcdglb.dat
  3.  
  4. set u_file    type str ""
  5. set u_files    type str ""
  6. set u_stuckfile    type str ""
  7. set u_dir    type str ""
  8. set u_dirs    type str ""
  9. set u_stuckdir    type str ""
  10.  
  11. menu YNUninstallSoftware dims 25,80 bc wh tc bla bo do sh na " Uninstall Software "
  12.     runscript ReadINSTALLINIFILE
  13.     text
  14.     text at ,-1 "This procedure will remove the sound board software originally installed."
  15.     text
  16.     text at ,-1 "Any empty directories will then be removed."
  17.     text 
  18.     text at ,-1 "No user-created files will be removed."
  19.     text 
  20.     text 
  21.     text
  22.     text at ,-1 "Would you like to continue?"
  23.     text
  24.     box at ,-1 dims 4,20 bo do sh
  25.     item at ,-1 " No, I Don't! " return 1
  26.     item at ,-1 "  Yes, I Do.  " menu PWUninstallSoftware return 1
  27.     text
  28.  
  29. menu PWUninstallSoftware at -1,-1 item " Please Wait... " script UninstallSoftware
  30. script UninstallSoftware
  31.     set u_files `file filelist.txt fixspace
  32.     trim u_files
  33.     set u_dirs `file dirslist.txt  fixspace
  34.     trim u_dirs
  35.  
  36.     cd ..
  37.  
  38.     :nextfile
  39.     set u_file     "$u_files" - "\w*$$"
  40.     set u_files     "$u_files" - "^*\w"
  41.     if ! $_strop     goto donefile
  42.     runscript UninstallFile     
  43.     goto nextfile
  44.     :donefile
  45.     
  46.     local dirstoremove type str "$u_dirs"
  47.     :nextdir
  48.     set u_dir     "$u_dirs" - "\w*$$"
  49.     set u_dirs     "$u_dirs" - "^*\w"
  50.     if ! $_strop    goto donedir
  51.     runscript UninstallDir
  52.     goto nextdir
  53.     :donedir
  54.  
  55.     set u_dirs    "$dirstoremove"
  56.     set u_stuckdir    ""
  57.     :nextdir1
  58.     set u_dir     "$u_dirs" - "\w*$$"
  59.     set u_dirs     "$u_dirs" - "^*\w"
  60.     if ! $_strop    goto donedir1
  61.     runscript UninstallDir
  62.     goto nextdir1
  63.     :donedir1
  64.  
  65.     set u_dirs    "$dirstoremove"
  66.     set u_stuckdir    ""
  67.     :nextdir2
  68.     set u_dir     "$u_dirs" - "\w*$$"
  69.     set u_dirs     "$u_dirs" - "^*\w"
  70.     if ! $_strop    goto donedir2
  71.     runscript UninstallDir
  72.     goto nextdir2
  73.     :donedir2
  74.  
  75.     set u_dirs    "$dirstoremove"
  76.     set u_stuckdir    ""
  77.     :nextdir3
  78.     set u_dir     "$u_dirs" - "\w*$$"
  79.     set u_dirs     "$u_dirs" - "^*\w"
  80.     if ! $_strop    goto donedir3
  81.     runscript UninstallDir
  82.     goto nextdir3
  83.  
  84.     :donedir3
  85.     runscript UninstallWindowFiles
  86.     if ! issame "$u_stuckfile" ""    runmenu displaystuckfile
  87.     if ! issame "$u_stuckdir" ""    runmenu displaystuckdir
  88.  
  89.     local ourdir type str ""
  90.     set ourdir `pwd
  91.     cd ..
  92.     rd $ourdir
  93.  
  94.     return
  95.  
  96. script UninstallWindowFiles
  97.  
  98.     if isfile ${v_winpath}\system\${win_drvwav}    del    ${v_winpath}\system\${win_drvwav}
  99.     if isfile ${v_winpath}\system\${win_drvmix}    del    ${v_winpath}\system\${win_drvmix}
  100.     if isfile ${v_winpath}\system\${win_drvfms}    del    ${v_winpath}\system\${win_drvfms}
  101.     if isfile ${v_winpath}\system\${win_drvmpu}    del    ${v_winpath}\system\${win_drvmpu}
  102.     if isfile ${v_winpath}\system\${win_386}    del    ${v_winpath}\system\${win_386}
  103.     if isfile ${v_winpath}\system\${win_mcicda}    del    ${v_winpath}\system\${win_mcicda}
  104.     if isfile ${v_winpath}\system\${win_mixdll}    del    ${v_winpath}\system\${win_mixdll}
  105.     if isfile ${v_winpath}\system\${win_drvwft}    del    ${v_winpath}\system\${win_drvwft}
  106.  
  107.     if isfile ${v_winpath}\mv.ini        del    ${v_winpath}\mv.ini        
  108.     if isfile ${v_winpath}\midisoft.ini    del    ${v_winpath}\midisoft.ini
  109.     if isfile ${v_winpath}\audio.ini    del    ${v_winpath}\audio.ini    
  110.  
  111.     return
  112.  
  113.  
  114. script UninstallFile
  115.                 display u_file         at 24,16 dims 1,62 bc blu tc wh
  116.     if ! isfile $u_file     display "- Mising!  "     at 24,2  dims 1,14 bc blu tc wh
  117.  
  118.     del $u_file
  119.  
  120.     if isfile $u_file     display "- Stuck!   "     at 24,2 dims 1,14 bc blu tc wh
  121.     if ! isfile $u_file     display "- Removed! "     at 24,2 dims 1,14 bc blu tc wh
  122.  
  123.     if isfile $u_file    set u_stuckfile "$u_stuckfile    $u_file"    
  124.     return
  125.  
  126. script UninstallDir
  127.                 display u_dir         at 24,16 dims 1,62 bc blu tc wh
  128.     if ! isdir $u_dir     display "- Mising!  "     at 24,2  dims 1,14 bc blu tc wh
  129.  
  130.                 rd $u_dir
  131.  
  132.     if isdir $u_dir     display "- Stuck!   "     at 24,2 dims 1,14 bc blu tc wh
  133.     if ! isdir $u_dir     display "- Removed! "     at 24,2 dims 1,14 bc blu tc wh
  134.  
  135.     if isdir $u_dir        set u_stuckdir "$u_stuckdir    $u_dir"    
  136.     return
  137.  
  138. menu displaystuckfile at -1,-1 dims 25,80 bc blu tc wh bo no name " Stuck Files "
  139.     text at ,2
  140.     text "For some reason, these files could not be removed:"
  141.     text 
  142.     text 
  143.     display u_stuckfile at ,-1 dims 10,60
  144.  
  145. menu displaystuckdir  at -1,-1 dims 25,80 bc blu tc wh bo no name " Stuck Directories "
  146.     text at ,2
  147.     text "For some reason, these directories could not be removed:"
  148.     text
  149.     text 
  150.     display u_stuckdir  at ,-1 dims 10,60 
  151.  
  152. # from QCFG.DAT ! 
  153. script ReadINSTALLINIFILE
  154.     local buf type str "windir=c:\windows                                           "
  155.     local ptr type ptr &buf
  156.     if isfile install.ini then
  157.         nullit buf
  158.         sedit -I . install.ini setup windir d put $ptr
  159.         trim buf
  160.             set v_winpath "$buf" - "*=" 
  161.         set v_winpath "${v_winpath}:h"
  162.     endif
  163.     return
  164.  
  165. include qcfgini.dat
  166.  
  167. 
  168.