;
; $VER: MPLS Patch Uninstall v1.85 (27.08.96) Lejardinier Olivier
; Copyright © 1995-96 Lejardinier Olivier
; All Rights Reserved.
;

;***************************************************************************;

;
; English Texts
;

(set #choice-yes "Yes")

(set #choice-no "No")

(set #ask-remove
(cat "\n"
     "Are you sure to want to remove MPLS Patch ?"
))

(set #ask-quit
(cat "\n"
     "Please quit all MPLS Patch programs"
))

(set #ask-drawer-path
(cat "\n"
     "Where do you have installed 'MPLS_Patch' directory ?"
     "\n"
))

(set #drawer-not-found
(cat "\n"
     "Selected directory does not contained 'MPLS_Patch' directory"
))

(set #ask-patch-path
(cat "\n"
     "Where do you have installed 'MPLS_Patch' program ?"
     "\n"
))

(set #patch-not-found
(cat "\n"
     "Selected directory does not contained 'MPLS_Patch' program"
))

(set #ask-prefs-path
(cat "\n"
     "Where do you have installed 'MPLS_Patch_Prefs' program ?"
     "\n"
))

(set #prefs-not-found
(cat "\n"
     "Selected directory does not contained 'MPLS_Patch_Prefs' program"
))

(set #removing-main-program
(cat "\n"
     "Removing main program :"
     "\n\n"
     "'%s'"
))

(set #removing-externals-modules
(cat "\n"
     "Removing externals modules :"
     "\n\n"
     "'LIBS:mpls_patch'"
))

(set #removing-configuration-file
(cat "\n"
     "Removing configuration file :"
     "\n\n"
     "'ENVARC:MPLS_Patch.Prefs'"
))

(set #removing-preferences-editor
(cat "\n"
     "Removing preferences editor :"
     "\n\n"
     "'%s'"
))

(set #removing-others-files
(cat "\n"
     "Removing docs, catalogs, etc.. :"
     "\n\n"
     "'%s'"
))

(set #remove-completed
(cat "\n"
     "Remove completed !"
))

(set #remove-aborted
(cat "\n"
     "Remove aborted !"
))

;***************************************************************************;

;
; French Texts
;

(if (= @language "français")
(

(set #choice-yes "Oui")

(set #choice-no "Non")

(set #ask-remove
(cat "\n"
     "Etes-vous certain de vouloir retirer MPLS Patch ?"
))

(set #ask-quit
(cat "\n"
     "Quittez tous les programmes MPLS Patch, SVP"
))

(set #ask-drawer-path
(cat "\n"
     "Où avez-vous installé le répertoire 'MPLS_Patch' ?"
     "\n"
))

(set #drawer-not-found
(cat "\n"
     "Le répertoire sélectionné ne contient pas le répertoire 'MPLS_Patch'"
))

(set #ask-patch-path
(cat "\n"
     "Où avez-vous installé le programme principal 'MPLS_Patch' ?"
     "\n"
))

(set #patch-not-found
(cat "\n"
     "Le répertoire sélectionné ne contient pas le programme 'MPLS_Patch'"
))

(set #ask-prefs-path
(cat "\n"
     "Où avez-vous installé l'éditeur de préférences 'MPLS_Patch_Prefs' ?"
     "\n"
))

(set #prefs-not-found
(cat "\n"
     "Le répertoire sélectionné ne contient pas l'éditeur de préférences 'MPLS_Patch_Prefs'"
))

(set #removing-main-program
(cat "\n"
     "Effacement du programme principal :"
     "\n\n"
     "'%s'"
))

(set #removing-externals-modules
(cat "\n"
     "Effacement des modules externes :"
     "\n\n"
     "'LIBS:mpls_patch'"
))

(set #removing-configuration-file
(cat "\n"
     "Effacement du fichier de configuration :"
     "\n\n"
     "'ENVARC:MPLS_Patch.Prefs'"
))

(set #removing-preferences-editor
(cat "\n"
     "Effacement de l'éditeur de préférences :"
     "\n\n"
     "'%s'"
))

(set #removing-others-files
(cat "\n"
     "Effacement des docs, catalogues, etc.. :"
     "\n\n"
     "'%s'"
))

(set #remove-completed
(cat "\n"
     "Procédure de désinstallation terminée !"
))

(set #remove-aborted
(cat "\n"
     "Procédure de désinstallation abandonnée !"
))

))

;***************************************************************************;

 (complete 0)

 (if (askbool
      (prompt #ask-remove)
      (help @askbool-help)
      (choices #choice-yes
               #choice-no
      )
     )

;--------------------------------------------------------------------------;

  (
   (if (exists "SYS:Tools/MPLS_Patch")
    (set olddrawer-source "SYS:Tools")
    (
     (set olddrawer-source
      (askdir
       (prompt #ask-drawer-path)
       (help @askdir-help)
       (default "SYS:")
      )
     )

     (if (not (exists (tackon olddrawer-source "MPLS_Patch")))
      (abort #drawer-not-found)
     )

    )
   )

   (complete 12)

;--------------------------------------------------------------------------;

   (if (exists (tackon olddrawer-source "MPLS_Patch/MPLS_Patch"))
    (set oldpatch-source (tackon olddrawer-source "MPLS_Patch"))
  ;else
    (if (exists "SYS:WBStartup/MPLS_Patch")
     (set oldpatch-source "SYS:WBStartup")
   ;else
     (
      (set oldpatch-source
       (askdir
        (prompt #ask-patch-path)
        (help @askdir-help)
        (default "SYS:")
       )
      )

      (if (not (exists (tackon oldpatch-source "MPLS_Patch")))
       (abort #patch-not-found)
      )

     )
    )
   )

   (complete 24)

;--------------------------------------------------------------------------;

   (if (exists "SYS:Prefs/MPLS_Patch_Prefs")
    (set oldprefs-source "SYS:Prefs")
  ;else
    (if (exists (tackon olddrawer-source "MPLS_Patch/MPLS_Patch_Prefs"))
   ;else
     (set oldprefs-source (tackon olddrawer-source "MPLS_Patch"))
     (
      (set oldprefs-source
       (askdir
        (prompt #ask-prefs-path)
        (help @askdir-help)
        (default "SYS:")
       )
      )

      (if (not (exists (tackon oldprefs-source "MPLS_Patch_Prefs")))
       (abort #prefs-not-found)
      )

     )
    )
   )

   (complete 48)

;--------------------------------------------------------------------------;

   (while (run "/SignalPatch")
    (message #ask-quit)
   )

   (working (#removing-main-program oldpatch-source))

   (run ("C:Delete >NIL: \"%s\" FORCE QUIET" (tackon oldpatch-source "MPLS_Patch#?")))
   (run "C:Delete >NIL: ENVARC:MPLS_Patch#?.#? FORCE QUIET")

   (complete 20)

;--------------------------------------------------------------------------;

   (working #removing-externals-modules)

   (run "C:Delete >NIL: LIBS:mpls_patch ALL FORCE QUIET")

   (complete 40)

;--------------------------------------------------------------------------;

   (working #removing-configuration-file)

   (run "C:Delete >NIL: ENVARC:MPLS_Patch#?.Prefs FORCE QUIET")

   (complete 60)

;--------------------------------------------------------------------------;

   (working (#removing-preferences-editor (tackon oldprefs-source "MPLS_Patch_Prefs")))

   (run ("C:Delete >NIL: \"%s\" FORCE QUIET" (tackon oldprefs-source "MPLS_Patch_Prefs#?")))
   (run "C:Delete >NIL: ENVARC:MUI/MPPREFS.#? FORCE QUIET")

   (complete 80)

;--------------------------------------------------------------------------;

   (working (#removing-others-files (tackon olddrawer-source "MPLS_Patch")))

   (run "C:Delete >NIL: LOCALE:help/english/MPLS_Patch.Help FORCE QUIET")
   (run "C:Delete >NIL: LOCALE:help/français/MPLS_Patch.Help FORCE QUIET")
   (run "C:Delete >NIL: LOCALE:catalogs/français/mpls_patch ALL FORCE QUIET")
   (run ("C:Delete >NIL: \"%s\" ALL FORCE QUIET" (tackon olddrawer-source "MPLS_Patch#?")))

   (complete 100)

;--------------------------------------------------------------------------;

   (set @default-dest "")
   (exit #remove-completed)
  )
  (abort #remove-aborted)
 )