;*****************************************************************************
;      _   _                       __     ______ ______
;     / \_/ \                     / /    / __  // ____/
;    / \__/ /______ _____ ______ / /___ / / / // /___
;   / /  / // __  // .__// __  // __  // / / //___  /
;  / /  / // /_/ // /   / /_/ // / / // /_/ /____/ /
; /_/  /_//_____//_/   / ____//_/ /_//_____//_____/
;                     / /                  
;                    /_/                  
;
; MorphOS ©2000 by Ralph Schmidt and Frank Mariak
; Update/Upgrade MorphOS Installer ©2000 by Robert C. Reiswig 
; $VER: V0.05 (14-Aug-00)
; 
; If you wish to use any part of this installer you must ask. May not be 
; integrated/placed into any other package! You may NOT change this in an way!
; You man NOT take or use the ENV definitions and use them without direct
; permission from me! Changes, suggestions or problems: morphos@vgr.come  
;********************************************************************************

;(set vernum1 (getversion "MetalWEB")) (set ver1 (/ vernum1 65536))
;(set rev1 (- vernum1 (* ver1 65536) ) ) (set MetalWEBver (cat ver1 "." rev1))
;(if (= ver1 0) (set MetalWEBver "4.0"))


;********************************************************************************
;English Strings
;********************************************************************************
(set #intro "\nWelcome to MorphOS beta release.\n\nCurrently the installer will copy the MorphOS files to a directory you select.\n\nYou will need to read the docs to set up MorphOS for your hardware. When you install .elf files use the ones that are copied to your MorphOS dir as they will have the correct file protection bits set.")
(set #whereMorphOS "Where would you like to install MorphOS? A directory called MorphOS will be create there.")
(set #updateinstaller "\nJust to let you know ESCOM AG has released a new version of the installer program.\n\n\nVersion 43.3 can be found on Aminet in:\n\n/util/misc/Installer-43_3.lha\n\n\nYou might want to upgrade soon, as most current scripts will need it to work correctly.")

;********************************************************************************
;German Strings by the King!
;********************************************************************************
(if (= @language "deutsch")
 (
  (set #intro "\n\nDer")
 )
)

;********************************************************************************
; Welcome
;********************************************************************************
(message  #intro)
(welcome)

;********************************************************************
; Check on New installer 
;********************************************************************
(set InstallerVer 0)
(set vernum1 @installer-version) (set ver1 (/ vernum1 65536)) 
(set rev1 (- vernum1 (* ver1 65536) ) ) (set InstallerVer (cat ver1 "." rev1))
(set current_installer "43.3")
(if (< InstallerVer current_installer) (message #updateinstaller) )


;*******************************************************************
;  Ask where To install MorphOS dir
;*******************************************************************
(set whereMorphOS   (askdir (prompt #whereMorphOS)
		        (help   #whereMorphOS)
     		        (default "Work:")
               )  
)


 (if (< (exists (tackon whereMorphOS "MorphOS")) 2) (makedir (tackon whereMorphOS "MorphOS") (infos)) )    
 (set where (tackon whereMorphOS "MorphOS"))

 (if (< (exists (tackon where "MorphOS")) 2) (makedir (tackon where "MorphOS") (infos)) )    
 (copyfiles (source (tackon "" "morphos")) (dest (tackon where "MorphOS")) (all) (infos) )

 (if (< (exists (tackon where "notes")) 2) (makedir (tackon where "Notes") (infos)) )    
 (copyfiles (source (tackon "" "Notes")) (dest (tackon where "Notes")) (all) (infos) )

 (if (< (exists (tackon where "docs_user")) 2) (makedir (tackon where "Docs_User") (infos)) )    
 (copyfiles (source (tackon "" "Docs_User")) (dest (tackon where "Docs_User")) (all) (infos) )


 (if (< (exists (tackon where "qstartup")) 2) (makedir (tackon where "qstartup") (infos)) )    
 (copyfiles (source (tackon "" "qstartup")) (dest (tackon where "qstartup")) (all) (infos) )
 (protect (tackon where "qstartup/startup") "+e -s")


 (if (< (exists (tackon where "cybergfxppc")) 2) (makedir (tackon where "CybergfxPPC") (infos)) )    
 (copyfiles (source (tackon "" "CybergfxPPC")) (dest (tackon where "CybergfxPPC")) (all) (infos) )
    (foreach (tackon where "CybergfxPPC/devs/monitors") "#?.elf"
      (if (< @each-type 0) (protect (tackon (tackon where "CybergfxPPC/devs/monitors") @each-name) "-s")  )
    )
    (foreach (tackon where "CybergfxPPC/libs") "#?.elf"
      (if (< @each-type 0) (protect (tackon (tackon where "CybergfxPPC/libs") @each-name) "-s")  )
    )



 (if (< (exists (tackon where "amigaextensions")) 2) (makedir (tackon where "AmigaExtensions") (infos)) )    
 (copyfiles (source (tackon "" "AmigaExtensions")) (dest (tackon where "AmigaExtensions")) (all) (infos) )
    (foreach (tackon where "AmigaExtensions/apps") "#?.elf"
      (if (< @each-type 0) (protect (tackon (tackon where "AmigaExtensions/apps") @each-name) "-s")  )
    )
    (foreach (tackon where "AmigaExtensions/devs") "#?.elf"
      (if (< @each-type 0) (protect (tackon (tackon where "AmigaExtensions/devs") @each-name) "-s")  )
    )
    (foreach (tackon where "AmigaExtensions/libs") "#?.elf"
      (if (< @each-type 0) (protect (tackon (tackon where "AmigaExtensions/libs") @each-name) "-s")  )
    )
    (foreach (tackon where "AmigaExtensions/datatypes") "#?.elf"
      (if (< @each-type 0) (protect (tackon (tackon where "AmigaExtensions/datatypes") @each-name) "-s")  )
    )


;********************************************************************************
; Exit
;********************************************************************************
(set @default-dest where)

(if (> (exists ("c:multiview")) 0) (set #mpath "c:") )
(if (> (exists ("sys:Utilities/multiview")) 0) (set #mpath "sys:Utilities") )
(run (cat "run " #mpath "/multiview ReadMeFirst_!REALLY!.txt") ) 

(exit)

