;
; newNET 1.20 installer script
;                      By Alfredo Soro
;

; *** English strings
(if (= @language "english") (
   (set fiche-lang "ENGLISH/newNET.LANG")
   (set help-newne "The main program must be in C: to make possible it can be executed in any time.")
   (set punter-copi "newNET executable is going to be copied into C:")
   (set punter-lang "Copying language file in S:")
   (set help-lang "newNET.LANG will be copied to S:")
   (set mensaje-bienvenida "   Wellcome to newNET 1.20 installer\n\n   This   script  will  install  newNET\nprogram  in your system, in the way that\nall  needed  files will be checked to be\ncorrectly installed.\n\nnewNET 1.20 © Alfredo Soro. 1997\nnewNET is freeware\n\n  newNET  HAS  NOT ANY WARRANTY.  AUTHOR\nCAN'T  BE  LIABLE  OF ANY PROBLEM CAUSED\nDIRECTLY OR INDIRECTLY BY THIS PROGRAM.\n")
   (set fichero-moos "\nChecking rexxMOOS.library\n")
   (set ficheros-base64 "\nChecking Base64coders files\n")
   (set ficheros-uu "\nChecking uuInOut files\n")
   (set copi-newne "\nCopying newNET")
   (set copi-lang "\nCopying newNET.LANG")
   (set cop-doc "\nCopying documentation")
   (set fichero-ok "\nFile correctly installed.")
   (set fichero-confi "newNET.ENGLISH")
   (set fichero-incorrecto "\n\nis NOT correctly installed!\nPlease, read documentation for what files\nare REQUIRED to run newNET.\n")
   (set mensa-insufi "\nYou have not enough free space\nin your SYSTEM partition. Please, you\nmay leave 50 KB. of free space in SYS:\n")
   (set fuen-docu "ENGLISH")
   (set copi-docu "Copying documentation...")
   (set eli-docu "Select destination for the documentation")
   (set queno-haydocu "READ documentation before use newNET\nfor first time!")
   (set guide-doc "ENGLISH/newNET.guide")
   (set eli-guidir "Where must be copied the newNET documentation?")
   (set ayu-exper "newNET.guide is documentation in Amigaguide format\nnewNET.manual is documentation in printable text format")
    )
)

; *** Spanish strings
(if (= @language "español") (
   (set fiche-lang "ESPAÑOL/newNET.LANG")
   (set punter-copi "Se va a copiar el ejecutable newNET en C:")
   (set help-newne "El programa principal debe estar en C: para que pueda ser ejecutado en cualquier momento.")
   (set punter-lang "Copiar fichero de lenguaje en S:")
   (set help-lang "newNET.LANG sera copiado a S:")
   (set mensaje-bienvenida "Bienvenido al instalador de newNET 1.20\n\n  Este script instalará el programa newNET\n en tu sistema, probando que todos los\nficheros necesarios estan correctamente\ninstalados.\n\nnewNET 1.20 © Alfredo Soro. 1997\nnewNET es freeware\nnewNET   NO   OFRECE   NINGUN   TIPO  DE\nGARANTIA.   POR LO QUE EL AUTOR NO PUEDE\nSER  RESPONSABILIZADO DE NINGUN PROBLEMA\nCAUSADO  DIRECTA  O  INDIRECTAMENTE  POR\nESTE PROGRAMA.")
   (set fichero-moos "\nComprobando librería rexxMOOS.library\n")
   (set ficheros-base64 "\nComprobando base64coders\n")
   (set ficheros-uu "\nComprobando ficheros uuInOut\n")
   (set copi-newne "\nCopiando newNET")
   (set copi-lang "\nCopiando newNET.LANG")
   (set cop-doc "\nCopiando documentación")
   (set fichero-ok "\nFichero instalado correctamente.")
   (set fichero-confi "newNET.ESPAÑOL")
   (set fichero-incorrecto "\n\nno esta correctamente instalado!\nPor favor, lee que ficheros son REQUERIDOS\npara que funcione newNET, en la documentación. \nComprueba versión del fichero y que \nno este infectado con virus.\n")
   (set mensa-insufi "\n No tienes suficiente espacio en tu\npartición del SISTEMA. Por favor, intenta\ndejar 50 KB. de espacio libre en SYS:\n")
   (set fuen-docu "ESPAÑOL")
   (set copi-docu "Copiando documentación...")
   (set eli-docu "Elige directorio para la documentación")
   (set queno-haydocu "LEE la documentación antes de usar newNET\npor primera vez!")
   (set guide-doc "ESPAÑOL/newNET.guide")
   (set eli-guidir "¿Dónde debe copiarse la documentación de newNET?")
   (set ayu-exper "newNET.guide es la documentación en formato Amigaguide\nnewNET.manual es la documentación en formato de texto imprimible")
  )
)

(complete 0)
(message mensaje-bienvenida (all))
(complete 5)
(working fichero-moos)
(set wi-cuf "LIBS:rexxMOOS.library")

(if (= (getsize wi-cuf) 7256)
 (set f-rm 1)
 (
  (abort wi-cuf fichero-incorrecto)
 )
)
(complete 10)
(working ficheros-base64)

(set wi-cuf "C:base64decode")
(if (= (getsize wi-cuf) 1940)
 (set f-rm 2)
 (
  (abort wi-cuf fichero-incorrecto)
 )
)

(complete 15)

(set wi-cuf "C:base64encode")
(if (= (getsize wi-cuf) 1104)
 (set f-rm 2)
 (
  (abort wi-cuf fichero-incorrecto)
 )
)

(complete 20)
(working ficheros-uu)

(set wi-cuf "C:uuin")
(if (= (getsize wi-cuf) 4560)
 (set f-rm 3)
 (
  (abort wi-cuf fichero-incorrecto)
 )
)

(complete 25)

(set wi-cuf "C:uuout")
(if (= (getsize wi-cuf) 4736)
 (set f-rm 4)
 (
  (abort wi-cuf fichero-incorrecto)
 )
)

(complete 30)
(working copi-newne)

(set nn-bina (pathonly @icon))
(set nn-newn (tackon nn-bina "newNET"))

(if (< (getdiskspace 'SYS:') 50000)
 (abort mensa-insufi)
(if (= @user-level 2)
 (
  (copylib (source nn-newn) (dest 'C:') (confirm) (prompt punter-copi) (help help-newne) (nogauge))
 )
 (
  (copylib (source nn-newn) (dest 'C:') (nogauge))
 )
)
)
(complete 50)
(working copi-lang)

(set nn-lang (tackon nn-bina fiche-lang))

(if (= @user-level 2)
 (
  (copylib (source nn-lang) (dest 'S:') (newname 'newNET.LANG') (prompt punter-lang) (help help-lang) (confirm) (nogauge))
 )
 (
  (copylib (source nn-lang) (dest 'S:') (newname 'newNET.LANG') (nogauge))
 )
)
(complete 70)
(working cop-doc)


(if (= @user-level 2)
 (
  (copyfiles
   (prompt copi-docu)
   (source fuen-docu)
   (pattern "~(#?.LANG)")
   (dest
    (askdir
     (prompt eli-docu)
     (help ayu-exper)


     (default @default-dest)
    )
   )
   (infos)
   (help @copyfiles-help)
   (confirm)
  )
 )
 (
  (copyfiles
   (source guide-doc)
   (dest
    (askdir
     (prompt eli-guidir)
     (help @askdir-help)
     (default @default-dest)
    )
   )
   (help @copyfiles-help)
   (infos)
  )
 )
)

(complete 90)

(message queno-haydocu (all))

(complete 100)
