failat 21

if not exists XEN-Icons
  echo "*n Please change current directory to that of MagicWB *n or start the installation from the Workbench!*n"
  quit
endif

if exists SYS:Prefs/Patterns
  if exists ENVARC:sys/def_kick.info
    echo "*N*N*N*N*N*n*n You have already installed an older version of MagicWB."
    echo " I would recommend you to UPDATE MagicWB rather than install it for new."
    Echo noline "*n Would you like to UPDATE MagicWB? "
    set > nil: InpVar ?

    if $InpVar eq "ja"
      skip update
    endif

    if $InpVar eq "j"
      skip update
    endif

    if $InpVar eq "y"
      skip update
    endif

    if $InpVar eq "yes"
      skip update
    endif

  endif
  echo "*e[1;1H*e[J"
endif


echo "*e[1;32m _________________________________________________________________________"
echo " *e[43m                                                                         *e[0m"
echo " *e[0;32;43m              Welcome to the INSTALLATION of MagicWB v2.0*e[1m                *e[0m"
echo " *e[1;4;43m                                                                         *e[0m"
echo "*n*n This Installation will automatically install *e[32mMagicWB*e[0m to your SYS:"
echo " directory. Don't be afraid; the only things that will be replaced"
echo " (overwritten) by this installation are the old (and ugly-looking) Icons"
echo " from Commodore. These old Icons will be replaced by far better-looking"
echo " Icons (called XEN-Icons) from this *e[32mMagicWB*e[0m-Package.*n"
echo " MagicWB now DOES PRESERVE your original tooltypes, stack and default"
echo " tool settings! So (for your convenience) your personal modifications"
echo " within the Icons WILL NOT be overwritten by this installation. MagicWB"
echo " just REPLACES the IMAGES of your old Icons with those magic images"
echo " from MagicWB (even your snapshot positions will be preserved).*n"
echo " After all, you do have the old Icons by Commodore on your original"
echo " Installation Disks. Therefore you won't lose anything! So, if you dislike"
echo " the XEN-Icons - what I really cannot believe - then you can still replace"
echo " them with the old ones by reinstalling the Workbench again.*n"
echo noline "   [Return]"
set > nil: Return ?
echo "*e[1;1H*e[J"
echo "*n Second, this installation will install THREE new FONTS to your FONTS-"
echo " Drawer called 'XEN', 'XHelvetica' and 'XCourier'.*n"
echo " Third, your font.prefs in the ENVARC:SYS directory will be changed to use"
echo " the three new installed fonts (you can of course reconfigure these settings"
echo " to fit your own personal taste; NOTHING important will be deleted).*n"
echo " Fourth, your palette.ilbm will be changed to fit the XEN-Icons: You will"
echo " need at least 8 colors. This new palette will NOT change the standard"
echo " colors that you are probably using at the moment. These first four"
echo " standard colors are Gray, Black, White and Blue. So, you will have the"
echo " same standard-looking Workbench with its original colors (again: nothing"
echo " will get lost).*n"
echo noline "   [Return]"
set > nil: Return ?
echo "*e[1;1H*e[J"
echo "*n IMPORTANT: The only thing you have to do is to change SCREENMODE-PREFS to"
echo " a proportional resolution with 8 COLORS (e.g. HiRes-Interlaced 8 Colors)"
echo " after this installation is finished!*n"
echo " Finally, TWO Background-Patterns will be installed in the SYS:Prefs/Patterns"
echo " directory (will be created). By default these patterns are 'Marble_CLASSIC'"
echo " and 'MarbleDark'. After this installation you can manually copy all patterns"
echo " or just your desired ones to this directory and configure them via the"
echo " WBPattern-Prefs (only 3.x users) or the program 'NickPrefs' (for 2.x users;"
echo " to be found in the 'MagicWB/Patterns/NickPrefs' drawer of this package).*n"
echo " That's all! You can now proceed with this installation and in a few minutes"
echo " you will be the lucky user of *e[32mMagicWB*e[0m! This installation will be inter-"
echo " active, which means that you will be asked certain questions where you"
echo " can influence this installation.*n"
echo noline " Start the installation? "

set > nil: InpVar ?

if $InpVar eq "ja"
  skip Start
endif

if $InpVar eq "j"
  skip Start
endif

if $InpVar eq "y"
  skip Start
endif

if $InpVar eq "yes"
  skip Start
endif

echo "*n*e[32m Installation aborted! I hope I see you again..."
quit


lab Start

echo "*e[1;1H*e[J"
echo " Installation in progress...*n"

assign Magic: ""
resident IU Magic:Programs/IconUpdate pure
if warn
  echo "*e[32m Installation aborted due to failure of the 'resident' command!*n This failure might be a bug in the Operating System with the*n 'IconX' command. Try to start the 'Install' script via the shell:*n Go to the MagicWB directory (with 'cd') and type 'execute install'."
  wait 20
  quit
endif


echo noline " Installing XEN-Icons to SYS:System..."
list > ram:MWB SYS:System/#?.info lformat "IU > NIL: tsd XEN-Icons/System/%n SYS:System/%n"
failat 21
execute > NIL: ram:MWB

if exists SYS:System/DiskCopy.info
  delete SYS:System/DiskCopy.info  ; Icon was redundant, without function!
endif
if exists SYS:System/CLI.info
  delete SYS:System/CLI.info  ; Icon was redundant.
endif
echo "..............................*e[33mDONE*e[0m"


echo noline " Installing XEN-Icons to SYS:Utilities..."
list > ram:MWB SYS:Utilities/#?.info lformat "IU > NIL: tsdc XEN-Icons/Utilities/%n SYS:Utilities/%n"
failat 21
execute > NIL: ram:MWB
echo "...........................*e[33mDONE*e[0m"


echo noline " Installing XEN-Icons to SYS:Tools..."
list > ram:MWB SYS:Tools/#?.info lformat "IU > NIL: tsdw XEN-Icons/Tools/%n SYS:Tools/%n"
failat 21
execute > NIL: ram:MWB
echo "...............................*e[33mDONE*e[0m"


echo noline " Installing XEN-Icons to SYS:Tools/Commodities..."
list > ram:MWB SYS:Tools/Commodities/#?.info lformat "IU > NIL: tsd XEN-Icons/Tools/Commodities/%n SYS:Tools/Commodities/%n"
failat 21
execute > NIL: ram:MWB
echo "...................*e[33mDONE*e[0m"

echo noline " Installing XEN-Icons to SYS:WBStartup..."
list > ram:MWB SYS:WBStartup/#?.info lformat "IU > NIL: tsdc XEN-Icons/Tools/Commodities/%n SYS:WBStartup/%n"
failat 21
execute > NIL: ram:MWB
IU > NIL: tsdc Programs/Misc/TolleUhr.info SYS:WBStartup/TolleUhr.info
echo "...........................*e[33mDONE*e[0m"


if exists SYS:Devs/DataTypes
  echo noline " Installing XEN-Icons to SYS:Devs/DataTypes..."
  list > ram:MWB SYS:Devs/DataTypes/#?.info lformat "IU > NIL: tsdn XEN-Icons/Devs/DataTypes/def_DataType.info %s%s"
  failat 21
  execute > NIL: ram:MWB
  if exists sys:Storage/DataTypes
    list > ram:MWB SYS:Storage/DataTypes/#?.info lformat "IU > NIL: tsdn XEN-Icons/Devs/DataTypes/def_DataType.info %s%s"
    execute > NIL: ram:MWB
  endif
  echo "......................*e[33mDONE*e[0m"
endif


echo noline " Installing XEN-Icons to SYS:Devs/DOSDrivers..."
list > ram:MWB SYS:Devs/DOSDrivers/#?.info lformat "IU > NIL: tsdn XEN-Icons/Devs/DOSDrivers/def_DOSDriver.info %s%s"
failat 21
execute > NIL: ram:MWB
if exists sys:Storage/DOSDrivers
  list > ram:MWB SYS:Storage/DOSDrivers/#?.info lformat "IU > NIL: tsdn XEN-Icons/Devs/DOSDrivers/def_DOSDriver.info %s%s"
  execute > NIL: ram:MWB
endif
echo ".....................*e[33mDONE*e[0m"


echo noline " Installing XEN-Icons to SYS:Devs/Keymaps..."
list > ram:MWB SYS:Devs/Keymaps/#?.info lformat "IU > NIL: tsdn XEN-Icons/Devs/Keymaps/def_Keymap.info %s%s"
failat 21
execute > NIL: ram:MWB
if exists sys:Storage/Keymaps
  list > ram:MWB SYS:Storage/Keymaps/#?.info lformat "IU > NIL: tsdn XEN-Icons/Devs/Keymaps/def_Keymap.info %s%s"
  execute > NIL: ram:MWB
endif
echo "........................*e[33mDONE*e[0m"


echo noline " Installing XEN-Icons to SYS:Devs/Monitors..."
list > ram:MWB SYS:Devs/Monitors/#?.info lformat "IU > NIL: tsdn XEN-Icons/Devs/Monitors/def_Monitor.info %s%s"
failat 21
execute > NIL: ram:MWB
if exists sys:Storage/Monitors
  list > ram:MWB SYS:Storage/Monitors/#?.info lformat "IU > NIL: tsdn XEN-Icons/Devs/Monitors/def_Monitor.info %s%s"
  execute > NIL: ram:MWB
endif
echo ".......................*e[33mDONE*e[0m"


echo noline " Installing XEN-Icons to SYS:Devs/Printers..."
list > ram:MWB SYS:Devs/Printers/#?.info lformat "IU > NIL: tsdn XEN-Icons/Devs/Printers/def_Printer.info %s%s"
failat 21
execute > NIL: ram:MWB
if exists sys:Storage/Printers
  list > ram:MWB SYS:Storage/Printers/#?.info lformat "IU > NIL: tsdn XEN-Icons/Devs/Printers/def_Printer.info %s%s"
  execute > NIL: ram:MWB
endif
echo ".......................*e[33mDONE*e[0m"


echo noline " Installing XEN-Icons to SYS:Prefs..."
list > ram:MWB SYS:Prefs/#?.info lformat "IU > NIL: tsd XEN-Icons/Prefs/%n SYS:Prefs/%n"
failat 21
execute > NIL: ram:MWB
echo "...............................*e[33mDONE*e[0m"


echo noline " Installing XEN-DEFAULT-Icons to ENVARC:Sys..."
copy > NIL: XEN-Icons/Prefs/Env-Archive/Sys/~(PaletteAGA|palette8bit.ilbm|WBPattern.prefs) TO ENVARC:Sys all
echo "......................*e[33mDONE*e[0m"


echo noline " Updating old Drawer-Icons in SYS:..."
list > ram:MWB SYS: dirs all lformat "if exists *"%f%n.info*" *n  list > ram:Length *"%f%n.info*" nohead nodates *n  search > NIL: ram:Length 1233 *n  if not warn *n  else *n    search > NIL: ram:Length 2625 *n    if not warn *n    else *n      IU > NIL: cwn XEN-Icons/Prefs/Env-Archive/Sys/def_Drawer.info *"%f%n.info*" *n    endif *n  endif *nendif*n"
execute > NIL: ram:MWB

if exists SYS:Trashcan.info
  IU > NIL: cw XEN-Icons/Prefs/Env-Archive/Sys/def_trashcan.info SYS:Trashcan.info
endif
echo "...............................*e[33mDONE*e[0m"
delete > NIL: ram:Length


version > NIL: exec.library 39
if warn
  skip Continue
endif
echo "*n Kickstart 3.x detected:*n"
set > NIL: Kick30 yep
echo noline " Installing Palette.prefs and WBPattern.prefs for Kickstart 3.x..."
delete > NIL: envarc:sys/sysfont.prefs ; file redundant for 3.x
delete > NIL: envarc:sys/wbfont.prefs  ; file redundant for 3.x
copy > NIL: XEN-Icons/Prefs/Env-Archive/Sys/PaletteAGA ENVARC:Sys/Palette.prefs CLONE
copy > NIL: XEN-Icons/Prefs/Env-Archive/Sys/WBPattern.prefs ENVARC:Sys
copy > NIL: XEN-Icons/Prefs/Env-Archive/Sys/palette8bit.ilbm ENVARC:Sys
echo "..*e[33mDONE*e[0m*n"

echo noline " Preparing MagicWB for Kickstart 3.x..."
if exists SYS:S/User-Startup
  search > NIL: SYS:S/User-Startup MagicWB-Demon
  if warn
    join Magic:Programs/AllocScript SYS:S/User-Startup TO RAM:User-Startup
    copy > NIL: RAM:User-Startup SYS:S
    delete > NIL: RAM:User-Startup
  endif
else
  copy Magic:Programs/AllocScript TO SYS:S/User-Startup
endif

search > NIL: SYS:S/Startup-Sequence MagicWB-Demon
if warn
  C:EDIT SYS:S/Startup-Sequence WITH Magic:Programs/SSScript
endif

copy > NIL: magic:Programs/MagicWB-Demon SYS:C
copy > NIL: magic:Programs/ataditm sys:s/mti.data
echo "..*e[33mDONE*e[0m*n"



echo "*e[1;1H*e[J"
echo noline "*n*n Do you have the AA (AGA) Chipset? "

set > nil: AGA ?
echo "*e[1;1H*e[J"
if $AGA eq "ja"
  skip InstallAGA
endif
if $AGA eq "j"
  skip InstallAGA
endif
if $AGA eq "y"
  skip InstallAGA
endif
if $AGA eq "yes"
  skip InstallAGA
endif
skip Continue


lab InstallAGA

echo "*n MagicWB offers a special goody to all AGA-Users:*n"
echo " If you want, MagicWB will install a very special Background-Picture. This"
echo " Background-Picture will be an IntelOutside-Logo :) with a beautiful, blue"
echo " gradient on your WB (having more than 520 colors)! You can of course change"
echo " the colors of the gradient.*n"
echo " The magic thing about it is, that it will only need 50KB of Chip-Mem! And"
echo " the result is breathtaking. Second, it will need at least a 16-color-"
echo " screenmode.*n"
echo " If you are not sure about this, just try it out! You may always change this"
echo " configuration afterwards if you won't like it (but you will! ;).*n"
echo noline " Do you want to have this special AGA-Background installed? "

set > nil: AGAPic ?
echo "*e[1;1H*e[J"
if $AGAPic eq "ja"
  skip DoAGA
endif
if $AGAPic eq "j"
  skip DoAGA
endif
if $AGAPic eq "y"
  skip DoAGA
endif
if $AGAPic eq "yes"
  skip DoAGA
endif
skip Continue

lab DoAGA
echo "*e[1;1H*e[J"
echo noline "*n*n Installing AGA-Background..."

if not exists SYS:Prefs/Patterns
  makedir SYS:Prefs/Patterns
endif
copy > NIL: Magic:Patterns/IntelOutside_AGA SYS:Prefs/Patterns
if exists SYS:WBStartup/WBVerlauf
  makedir > NIL: SYS:WBStartup/WBVerlaufOLD
  copy > NIL: SYS:WBStartup/WBVerlauf#? TO SYS:WBStartup/WBVerlaufOLD
  delete > NIL: SYS:WBStartup/WBVerlauf#?
  copy > NIL: Magic:Programs/MagicCopper#? SYS:WBStartup
else
  copy > NIL: Magic:Programs/MagicCopper#? SYS:WBStartup
endif
copy > NIL: Magic:Programs/WBPatternAGA.prefs ENVARC:SYS/WBPattern.prefs
echo ".................................*e[33mDONE*e[0m*n"

echo " You MUST now select a 16 color screenmode (or higher if you want)."
echo " This is important to correctly display the AGA-Background on your"
echo " WB. By pressing <RETURN>, the screenmode preferences will appear"
echo " now and you will have to select 16 or more colors and click the"
echo " button SAVE. If a requester appears saying something like *"you must"
echo " now close all windows...*", just ignore it, move it aside and wait"
echo " until this update is finished. The requester will then disappear."
echo " Please press *e[32m<RETURN>*e[0m now."
set > NIL: Return ?
SYS:Prefs/Screenmode
set > NIL: AGAInstalled yep



lab Continue

echo " Installing XEN-SPECIAL-Icons:"
echo noline "     Installing Preset-Default-Icon to SYS:Prefs/Presets..."
copy > NIL: XEN-Icons/SPECIAL/Misc/Preset.info SYS:Prefs/Presets
echo ".........*e[33mDONE*e[0m"


echo noline "     Installing RAM-Icon to S:RAM.info......"
if exists SYS:S/RAM.info
  IU > NIL: dcw XEN-Icons/SPECIAL/Devices/RAM.info SYS:S/RAM.info
else
  copy > NIL: XEN-Icons/SPECIAL/Devices/RAM.info SYS:S
endif
if exists SYS:S/User-Startup
  search > NIL: SYS:S/User-Startup SYS:S/RAM.info
  if warn
    join Magic:Programs/RAMScript SYS:S/User-Startup TO RAM:User-Startup
    copy > NIL: RAM:User-Startup SYS:S
    delete > NIL: RAM:User-Startup
  endif
else
  copy > NIL: Magic:Programs/RAMScript TO SYS:S/User-Startup
endif
echo "........................*e[33mDONE*e[0m"


if exists SYS:Disk.info
  echo noline "*n Installing HardDisk-Icon to SYS:..."
  IU > NIL: dcw XEN-Icons/SPECIAL/Devices/HD.info SYS:Disk.info
  echo "................................*e[33mDONE*e[0m*n"
else
  lab Path
  echo noline "*n Please enter the PATH where the HardDisk-Icon should*n be installed (i.e. 'DH0:'): "
  set > NIL: Path ?
  if > NIL: not exists $Path
    echo " Wrong path, path does not exist! Try again...*n"
    skip back path
  endif
  echo noline " Installing HardDisk-Icon to $Path..."
  cd $Path
  IU > NIL: dcw Magic:XEN-Icons/SPECIAL/Devices/HD.info Disk.info
  cd Magic:
  echo "..*e[33mDONE*e[0m*n"
endif


lab HardDisk

echo noline " Do you want to have the HardDisk-Icon installed to other partitions? "
set > nil: HardDisk ?
echo "*e[1;1H*e[J"
if $HardDisk eq "ja"
  skip InstallHardDisk
endif
if $HardDisk eq "j"
  skip InstallHardDisk
endif
if $HardDisk eq "y"
  skip InstallHardDisk
endif
if $HardDisk eq "yes"
  skip InstallHardDisk
endif
skip Continue

lab InstallHardDisk
echo noline "*N Please enter the NAME of the desired partition (i.e. 'DH1:'): "
set > nil: Device [Return]
set > nil: Device ?
if not exists $Device
  echo " Wrong device, $Device does not exist! Try again..."
  skip back InstallHardDisk
endif
echo noline "*n Installing HardDisk-Icon to $Device..."
cd $Device
if exists Disk.info
  IU > NIL: dcw Magic:XEN-Icons/SPECIAL/Devices/HD.info Disk.info
else
  copy > NIL: Magic:XEN-Icons/SPECIAL/Devices/HD.info Disk.info
endif
cd Magic:
echo "................................*e[33mDONE*e[0m*n"
skip back HardDisk


lab Continue
echo "*e[1;1H*e[J"
echo noline "*n Do you have a SYQUEST (removable cartridge disk drive)? "
set > nil: Syquest ?
if $Syquest eq "ja"
  skip InstallSyquest
endif
if $Syquest eq "j"
  skip InstallSyquest
endif
if $Syquest eq "y"
  skip InstallSyquest
endif
if $Syquest eq "yes"
  skip InstallSyquest
endif
skip Continue

lab InstallSyquest
echo noline "*n Please enter the NAME of your Syquest (for example 'DH1:'): "
set > NIL: Dev [Return]
set > NIL: Dev ?
if not exists $Dev
  echo " Wrong device, $Dev does not exist! Try again..."
  skip back InstallSyquest
endif
echo noline "*n Installing Syquest-Icon to $Dev..."
cd $Dev
IU > NIL: dcw Magic:XEN-Icons/SPECIAL/Devices/Syquest.info Disk.info
cd Magic:
echo "...*e[33mDONE*e[0m"
wait 6

lab Continue


echo "*e[1;1H*e[J"
Echo noline "*n Installing new Image-Drawer-Icons..."

IU > NIL: cw XEN-Icons/Special/ImageDrawers/DataTypes.info SYS:Devs/DataTypes.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/DataTypes.info SYS:storage/DataTypes.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/DOSDrivers.info SYS:Devs/DOSDrivers.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/DOSDrivers.info SYS:storage/DOSDrivers.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Keymaps.info SYS:Devs/Keymaps.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Keymaps.info SYS:storage/Keymaps.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Monitors.info SYS:Devs/Monitors.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Monitors.info SYS:storage/Monitors.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Printers.info SYS:Devs/Printers.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Printers.info SYS:storage/Printers.info

IU > NIL: cw XEN-Icons/Special/ImageDrawers/Presets.info SYS:Prefs/Presets.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Commodities.info SYS:Tools/Commodities.info

IU > NIL: cw XEN-Icons/Prefs.info SYS:Prefs.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/System.info SYS:System.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Tools.info SYS:Tools.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Utilities.info SYS:Utilities.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Devs.info SYS:Devs.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Storage.info SYS:Storage.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/WBStartup.info SYS:WBStartup.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Expansion.info SYS:Expansion.info

echo "..................*e[33mDONE*e[0m"


echo noline "*n Installing MagicWB-Fonts to FONTS:..."
copy > NIL: Fonts/#? TO FONTS: all
echo ".................*e[33mDONE*e[0m"


if not exists SYS:Prefs/Patterns
  makedir SYS:Prefs/Patterns
endif
version >NIL: exec.library 39
if warn
  echo noline "*N*n*n Installing ONE PATTERN to SYS:Prefs/Patterns*n (drawer will be created)..."
  copy > NIL: Patterns/Marble_CLASSIC TO SYS:Prefs/Patterns
else
  echo noline "*N*n*n Installing TWO PATTERNS to SYS:Prefs/Patterns*n (drawer will be created)..."
  SYS:Prefs/WBPattern FROM Magic:Programs/WBPattern.pre USE
  copy > NIL: Patterns/Marble_CLASSIC TO SYS:Prefs/Patterns
  copy > NIL: Patterns/MarbleDark TO SYS:Prefs/Patterns
endif
echo "..*e[33mDONE*e[0m"

wait 5

echo "*e[1;1H*e[J"
echo "*n*n Do you want to install the MagicWB-Dock-Images to SYS:Prefs/MagicWB-Images?"
echo " The assign 'MagicWB:' for this directory will be added to 'S:User-Startup'"
echo " so that you only need to append the supplied MagicWB-Docks ToolManager-"
echo " configuration to your own ToolManager-config to enjoy the MagicWB-Docks."
echo noline "*n Would you like to have them installed? "
set > nil: docks ?
if $docks eq "ja"
  skip Installdocks
endif
if $docks eq "j"
  skip Installdocks
endif
if $docks eq "y"
  skip Installdocks
endif
if $docks eq "yes"
  skip Installdocks
endif
skip Continue

lab InstallDocks

echo noline "*n*n Installing Dock-Images to SYS:Prefs/MagicWB-Images..."
makedir > NIL: sys:prefs/MagicWB-Images
copy > NIL: magic:xen-icons/Dock-Brushes/#?.brush SYS:Prefs/MagicWB-Images
echo "..............*e[33mDONE*e[0m"
echo noline "*n Appending MagicWB: assign to SYS:S/User-Startup..."
if exists SYS:S/User-Startup
  search > NIL: SYS:S/User-Startup "assign >NIL: MagicWB:"
  if warn
    echo >>sys:s/user-startup "assign >NIL: MagicWB: SYS:Prefs/MagicWB-Images"
  endif
else
  echo >sys:s/user-startup "assign >NIL: MagicWB: SYS:Prefs/MagicWB-Images"
endif
echo ".................*e[33mDONE*e[0m"
wait 2
echo "*n*n The Dock-Images are now properly installed. Please use the ToolManager,"
echo " append the supplied configuration for the images (can be found as *e[32mXEN-"
echo " Icons/Dock-Brushes/MagicWB-Docks*e[0m) and configure the Docks to fit your"
echo " own personal taste."

wait 10


lab continue

Echo "*n*N*n*n*n The installation is now successfully finished."
echo > ENVARC:MagicWB "2.0"
echo "*n*n     [Return]"
set > nil: Return ?
echo "*e[1;1H*e[J"
echo "*n [4mFinally some important information:[0m*n"
echo "*n There are some things you immediately have to do after this installation"
echo " is finished."
echo "*n- You have to change the SCREENMODE-Preferences to a proportional resolution"
echo "  with at least 8 COLORS! Proportional resolutions are for example: 640x480,"
echo "  640x512, 800x600, 1024x768, 1280x1024 etc. But NOT a resolution like"
echo "  640x256 (=MedRes Pal) or similar resolutions where the horizontal pixels"
echo "  are nearly twice as much than the vertical amount of pixels. With these"
echo "  'non-square-pixel' resolutions the Icons and Fonts are being distorted."
echo "  So you have to use a proportional resolution to enjoy *e[32mMagicWB*e[0m as the"
echo "  author has planned it to be!"

if $AGAInstalled eq "yep"
  echo noline "*n     [Return]"
  set > nil: Return ?
  skip continue
endif

echo "*n  And you MUST select at least an 8 COLOR Workbench!"
echo "*e[J*n*e[32m  Now, by pressing RETURN, the ScreenMode-Prefs will appear. Please select"
echo "  a square-pixel-screenmode with 8 colors and click 'SAVE'...*e[0m"
echo "  (if a system requester asks you to close all windows, just move the"
echo "  requester aside and wait until this installation is finished, then"
echo "  it will disappear)"
echo noline "*n     [Return]"
set > nil: Return ?
SYS:Prefs/Screenmode

lab continue

echo "*e[1;1H*e[J*n*n- Second, you can find the patterns 'Marble_CLASSIC' and 'MarbleDark'"
echo "  in the SYS:Prefs/Patterns directory. These are the only patterns that have"
echo "  been installed to save diskspace. There are plenty of other patterns in"
echo "  the MagicWB/Patterns directory (over 50 patterns!) that you can copy"
echo "  to SYS:Prefs/Patterns if required.*n"

if $Kick30 eq "yep"
  skip continue
endif

echo "  If you are user of the OS2.0 or OS2.1 you will have to install the program"
echo "  NickPrefs to use the Patterns of *e[32mMagicWB*e[0m. Please consult the documentation.*n"

lab continue

echo "- Programmers should take a look into the MagicWB/XEN-Icons/SPECIAL drawer!"
echo "  Here you can find Icons for your programs that have logically not been"
echo "  installed with this installation: AmigaGuide, ReadMe, templates,"
echo "  device icons, over 50 Image-Drawers etc.*n"
echo "- And everybody MUST take a look into the XEN-Icons/Dock-Brushes drawer!"
echo "  (The files in this drawer have NOT been installed to your system)"
echo "  Here you will find all the general purpose Images you will need in"
echo "  conjunction with ToolManager (or any other similar program) and MagicWB"
echo "  to get a really magic Workbench feeling!  ;)"
echo "*n*n     [Return]"
set > nil: Return ?
echo "*e[1;1H*e[J"
echo "*n*N*n Thank you for supporting the author of *e[32mMagicWB*e[0m by your registration, making"
echo " future versions of *e[32mMagicWB*e[0m possible. Always remember:"
echo "*n*n*e[1;32m          ______________________________________________________[0m"
echo "          [32;7m [0m                                                     [31;7m [0m"
echo "          [32;7m [0m A PRODUCT WORTH USING IS ALSO WORTH BEING SUPPORTED [31;7m [0m"
echo "          [32;7m [0m*e[1;31m_____________________________________________________[0;31;7m [0m"
echo "*n*N                 MagicWB © 1992-94 by Martin Huttenloher"
echo "*n                        - Released as SHAREWARE -*n*n"
echo "*e[32m    MagicWB 2.0 MUST NOT BE DISTRIBUTED! Remember: Your address and name"
echo "        are encoded in this personalized version. Do not spread it!*e[0m"
echo "*n*n    [Return]"
set > nil: Return ?
echo "*e[1;1H*e[J"
echo "*n*n*n Now have much fun with *e[32mMagicWB*e[0m...*n*n To enjoy MagicWB immediately you have to reset your AMIGA first,*n so that all configurations will be set properly!*n*n Bye, bye...*n*N"
echo "*n*n     [Return]"
set > nil: Return ?

resident > NIL: IU remove
assign > NIL: Magic: remove
delete > NIL: ram:MWB
cd documents/
run >NIL: AboutMagicWB
quit

;##################################################################################################
;##################################################################################################

lab update
echo "*e[1;1H*e[J"

echo "*e[1;32m ______________________________________________________________________"
echo " *e[43m                                                                      *e[0m"
echo " *e[0;32;43m               Welcome to MagicWB v2.0: UPDATE MAGICWB*e[1m                *e[0m"
echo " *e[1;4;43m                                                                      *e[0m"
echo "*n*n This update will provide you with the most comfortable way of updating"
echo " all other MagicWB versions prior to version 2.0 of MagicWB."
echo "*n This installation should only be done if you have already installed a"
echo " previous version (1.0, 1.2p or 1.5) of MagicWB."
echo "*n To get to know about all the changes between version 2.0 and an older"
echo " version, please read the CHANGES chapter in the MagicWB.guide."

echo noline "*n*n Start the UPDATE? "

set > nil: InpVar ?

if $InpVar eq "ja"
  skip Start
endif

if $InpVar eq "j"
  skip Start
endif

if $InpVar eq "y"
  skip Start
endif

if $InpVar eq "yes"
  skip Start
endif

echo noline "*n*e[32m Update aborted."
quit

lab Start
assign Magic: ""
resident IU Magic:Programs/IconUpdate pure
if warn
  echo "*e[32m Update aborted due to failure of the 'resident' command!*n This failure might be a bug in the Operating System with the*n 'IconX' command. Try to start the 'Install' script via the shell:*n Go to the MagicWB directory (with 'cd') and type 'execute install'."
  wait 15
  quit
endif

echo "*e[1;1H*e[J"
echo " Update in progress...*n"


echo noline " Updating XEN-Icons in SYS:System..."
list > ram:MWB SYS:System/#?.info lformat "IU > NIL: tsdc Magic:XEN-Icons/System/%n SYS:System/%n"
failat 21
execute > NIL: ram:MWB

if exists SYS:System/DiskCopy.info
  delete SYS:System/DiskCopy.info  ; Icon was redundant, without function!
endif
if exists SYS:System/CLI.info
  delete SYS:System/CLI.info  ; Icon was redundant.
endif
echo "..............................*e[33mDONE*e[0m"


echo noline " Updating XEN-Icons in SYS:Utilities..."
list > ram:MWB SYS:Utilities/#?.info lformat "IU > NIL: tsdc Magic:XEN-Icons/Utilities/%n SYS:Utilities/%n"
failat 21
execute > NIL: ram:MWB
echo "...........................*e[33mDONE*e[0m"


echo noline " Updating XEN-Icons in SYS:Tools..."
list > ram:MWB SYS:Tools/#?.info lformat "IU > NIL: tsdcw Magic:XEN-Icons/Tools/%n SYS:Tools/%n"
failat 21
execute > NIL: ram:MWB
echo "...............................*e[33mDONE*e[0m"


echo noline " Updating XEN-Icons in SYS:Tools/Commodities..."
list > ram:MWB SYS:Tools/Commodities/#?.info lformat "IU > NIL: tsdc Magic:XEN-Icons/Tools/Commodities/%n SYS:Tools/Commodities/%n"
failat 21
execute > NIL: ram:MWB
echo "...................*e[33mDONE*e[0m"

echo noline " Updating XEN-Icons in SYS:WBStartup..."
list > ram:MWB SYS:WBStartup/#?.info lformat "IU > NIL: tsdcw Magic:XEN-Icons/Tools/Commodities/%n SYS:WBStartup/%n"
failat 21
execute > NIL: ram:MWB
IU > NIL: tsdc Programs/Misc/TolleUhr.info SYS:WBStartup/TolleUhr.info
echo "...........................*e[33mDONE*e[0m"


if exists SYS:Devs/DataTypes
  echo noline " Updating XEN-Icons in SYS:Devs/DataTypes..."
  list > ram:MWB SYS:Devs/DataTypes/#?.info lformat "IU > NIL: tsdcn Magic:XEN-Icons/Devs/DataTypes/def_DataType.info *"%s%s*""
  failat 21
  execute > NIL: ram:MWB
  if exists sys:Storage/DataTypes
    list > ram:MWB SYS:Storage/DataTypes/#?.info lformat "IU > NIL: tsdcn Magic:XEN-Icons/Devs/DataTypes/def_DataType.info *"%s%s*""
    execute > NIL: ram:MWB
  endif
  echo "......................*e[33mDONE*e[0m"
endif


echo noline " Updating XEN-Icons in SYS:Devs/DOSDrivers..."
list > ram:MWB SYS:Devs/DOSDrivers/#?.info lformat "IU > NIL: tsdcn Magic:XEN-Icons/Devs/DOSDrivers/def_DOSDriver.info %s%s"
failat 21
execute > NIL: ram:MWB
if exists sys:Storage/DOSDrivers
  list > ram:MWB SYS:Storage/DOSDrivers/#?.info lformat "IU > NIL: tsdcn Magic:XEN-Icons/Devs/DOSDrivers/def_DOSDriver.info %s%s"
  execute > NIL: ram:MWB
endif
echo ".....................*e[33mDONE*e[0m"


echo noline " Updating XEN-Icons in SYS:Devs/Keymaps..."
list > ram:MWB SYS:Devs/Keymaps/#?.info lformat "IU > NIL: tsdcn Magic:XEN-Icons/Devs/Keymaps/def_Keymap.info %s%s"
failat 21
execute > NIL: ram:MWB
if exists sys:Storage/Keymaps
  list > ram:MWB SYS:Storage/Keymaps/#?.info lformat "IU > NIL: tsdcn Magic:XEN-Icons/Devs/Keymaps/def_Keymap.info %s%s"
  execute > NIL: ram:MWB
endif
echo "........................*e[33mDONE*e[0m"


echo noline " Updating XEN-Icons in SYS:Devs/Monitors..."
list > ram:MWB SYS:Devs/Monitors/#?.info lformat "IU > NIL: tsdcn Magic:XEN-Icons/Devs/Monitors/def_Monitor.info %s%s"
failat 21
execute > NIL: ram:MWB
if exists sys:Storage/Monitors
  list > ram:MWB SYS:Storage/Monitors/#?.info lformat "IU > NIL: tsdcn Magic:XEN-Icons/Devs/Monitors/def_Monitor.info %s%s"
  execute > NIL: ram:MWB
endif
echo ".......................*e[33mDONE*e[0m"


echo noline " Updating XEN-Icons in SYS:Devs/Printers..."
list > ram:MWB SYS:Devs/Printers/#?.info lformat "IU > NIL: tsdcn Magic:XEN-Icons/Devs/Printers/def_Printer.info %s%s"
failat 21
execute > NIL: ram:MWB
if exists sys:Storage/Printers
  list > ram:MWB SYS:Storage/Printers/#?.info lformat "IU > NIL: tsdcn Magic:XEN-Icons/Devs/Printers/def_Printer.info %s%s"
  execute > NIL: ram:MWB
endif
echo ".......................*e[33mDONE*e[0m"


echo noline " Updating XEN-Icons in SYS:Prefs..."
list > ram:MWB SYS:Prefs/#?.info lformat "IU > NIL: tsdc Magic:XEN-Icons/Prefs/%n SYS:Prefs/%n"
failat 21
execute > NIL: ram:MWB
echo "...............................*e[33mDONE*e[0m"


echo noline " Updating XEN-DEFAULT-Icons in ENVARC:Sys..."
copy > NIL: Magic:XEN-Icons/Prefs/Env-Archive/Sys/~(PaletteAGA|palette8bit.ilbm|WBPattern.prefs|font.prefs|sysfont.prefs|wbfont.prefs) TO ENVARC:Sys all
echo "......................*e[33mDONE*e[0m"


echo " Updating XEN-SPECIAL-Icons:*n"
echo noline "     Updating Preset-Default-Icon in SYS:Prefs/Presets..."
copy > NIL: Magic:XEN-Icons/SPECIAL/Misc/Preset.info SYS:Prefs/Presets
echo ".........*e[33mDONE*e[0m"


echo noline "     Updating RAM-Icon in S:RAM.info......"
if exists SYS:S/RAM.info
  IU > NIL: dcw Magic:XEN-Icons/SPECIAL/Devices/RAM.info SYS:S/RAM.info
else
  copy > NIL: Magic:XEN-Icons/SPECIAL/Devices/RAM.info SYS:S
endif
if exists SYS:S/User-Startup
  search > NIL: SYS:S/User-Startup SYS:S/RAM.info
  if warn
    join Magic:Programs/RAMScript SYS:S/User-Startup TO RAM:User-Startup
    copy > NIL: RAM:User-Startup SYS:S
    delete > NIL: RAM:User-Startup
  endif
else
  copy > NIL: Magic:Programs/RAMScript TO SYS:S/User-Startup
endif
echo "........................*e[33mDONE*e[0m"


if exists SYS:Disk.info
  echo noline "*n Updating HardDisk-Icon in SYS:..."
  IU > NIL: dcw Magic:XEN-Icons/SPECIAL/Devices/HD.info SYS:Disk.info
  echo "................................*e[33mDONE*e[0m*n"
else
  lab Path
  echo noline "*n Please enter the PATH where the HardDisk-Icon is located (i.e. 'DH0:'): "
  set > NIL: Path ?
  if > NIL: not exists $Path
    echo " Wrong path, path does not exist! Try again...*n"
    skip back path
  endif
  echo noline " Updating HardDisk-Icon in $Path..."
  cd $Path
  IU > NIL: dcw Magic:XEN-Icons/SPECIAL/Devices/HD.info Disk.info
  cd Magic:
  echo "..*e[33mDONE*e[0m*n"
endif


lab HardDisk

echo noline " Do you have the HardDisk-Icon on other partitions? "
set > nil: HardDisk ?
echo "*e[1;1H*e[J"
if $HardDisk eq "ja"
  skip InstallHardDisk
endif
if $HardDisk eq "j"
  skip InstallHardDisk
endif
if $HardDisk eq "y"
  skip InstallHardDisk
endif
if $HardDisk eq "yes"
  skip InstallHardDisk
endif
skip Continue

lab InstallHardDisk
echo noline "*N Please enter the NAME of the desired partition (i.e. 'DH1:'): "
set > nil: Device [Return]
set > nil: Device ?
if not exists $Device
  echo " Wrong device, $Device does not exist! Try again..."
  skip back InstallHardDisk
endif
echo noline "*n Updating HardDisk-Icon in $Device..."
cd $Device
if exists Disk.info
  IU > NIL: dcw Magic:XEN-Icons/SPECIAL/Devices/HD.info Disk.info
else
  copy > NIL: Magic:XEN-Icons/SPECIAL/Devices/HD.info Disk.info
endif
cd Magic:
echo "............................*e[33mDONE*e[0m*n"
skip back HardDisk


lab Continue
echo "*e[1;1H*e[J"
echo noline "*n Do you have a SYQUEST (removable cartridge disk drive)? "
set > nil: Syquest ?
if $Syquest eq "ja"
  skip InstallSyquest
endif
if $Syquest eq "j"
  skip InstallSyquest
endif
if $Syquest eq "y"
  skip InstallSyquest
endif
if $Syquest eq "yes"
  skip InstallSyquest
endif
skip Continue

lab InstallSyquest
echo noline "*n Please enter the NAME of your Syquest (for example 'DH1:'): "
set > NIL: Dev [Return]
set > NIL: Dev ?
if not exists $Dev
  echo " Wrong device, $Dev does not exist! Try again..."
  skip back InstallSyquest
endif
echo noline "*n Updating Syquest-Icon in $Dev..."
cd $Dev
IU > NIL: dcw Magic:XEN-Icons/SPECIAL/Devices/Syquest.info Disk.info
cd Magic:
echo "............................*e[33mDONE*e[0m"


wait 6


lab Continue
echo "*e[1;1H*e[J"

Echo noline "*n Installing new Image-Drawer-Icons..."

IU > NIL: cw XEN-Icons/Special/ImageDrawers/DataTypes.info SYS:Devs/DataTypes.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/DataTypes.info SYS:storage/DataTypes.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/DOSDrivers.info SYS:Devs/DOSDrivers.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/DOSDrivers.info SYS:storage/DOSDrivers.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Keymaps.info SYS:Devs/Keymaps.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Keymaps.info SYS:storage/Keymaps.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Monitors.info SYS:Devs/Monitors.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Monitors.info SYS:storage/Monitors.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Printers.info SYS:Devs/Printers.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Printers.info SYS:storage/Printers.info

IU > NIL: cw XEN-Icons/Special/ImageDrawers/Presets.info SYS:Prefs/Presets.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Commodities.info SYS:Tools/Commodities.info

IU > NIL: cw XEN-Icons/Prefs.info SYS:Prefs.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/System.info SYS:System.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Tools.info SYS:Tools.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Utilities.info SYS:Utilities.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Devs.info SYS:Devs.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Storage.info SYS:Storage.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/WBStartup.info SYS:WBStartup.info
IU > NIL: cw XEN-Icons/Special/ImageDrawers/Expansion.info SYS:Expansion.info

echo "...............................*e[33mDONE*e[0m"


echo noline "*n Updating old Drawer-Icons in SYS:..."
list > ram:MWB SYS: dirs all lformat "if exists *"%f%n.info*" *n  list > ram:Length *"%f%n.info*" nohead nodates *n  search > NIL: ram:Length 1233 *n  if not warn *n  else *n    search > NIL: ram:Length 2625 *n    if not warn *n    else *n      IU > NIL: cwn XEN-Icons/Prefs/Env-Archive/Sys/def_Drawer.info *"%f%n.info*" *n    endif *n  endif *nendif*n"
execute > NIL: ram:MWB
if exists SYS:Trashcan.info
  IU > NIL: cw Magic:XEN-Icons/Prefs/Env-Archive/Sys/def_trashcan.info SYS:Trashcan.info
endif
echo "...............................*e[33mDONE*e[0m"
delete > NIL: ram:Length


echo noline "*n Updating MagicWB-Fonts in FONTS:..."
copy > NIL: Magic:Fonts/#? TO FONTS: all
echo "................................*e[33mDONE*e[0m"

echo noline "*n Updating old patterns in SYS:Prefs/Patterns to the new format..."
version >NIL: exec.library 39
if warn
  copy > NIL: Patterns/Marble_CLASSIC TO SYS:Prefs/Patterns
else
  SYS:Prefs/WBPattern FROM Magic:Programs/WBPattern.pre USE
  list > ram:MWB SYS:Prefs/Patterns/#? files lformat "copy > NIL: Magic:Patterns/%n SYS:Prefs/Patterns/%n"
  execute > NIL: ram:MWB
  delete > NIL: SYS:Prefs/Patterns/NickPrefs.info
  wait 2
  SYS:Prefs/WBPattern FROM envarc:sys/WBPattern.prefs USE
endif
echo "...*e[33mDONE*e[0m"
echo "*n*n*e[32m ATTENTION:*e[0m  With  MagicWB 2.0  the  patterns  have another color format."
echo " Please  delete  all older MagicWB patterns in any other directories and"
echo " use the new ones in SYS:Prefs/Patterns and MagicWB/Patterns."
wait 10

;------------------------ OS3.x, AGA section, START ---------------------------
version > NIL: exec.library 39
if warn
  skip Continue
endif
echo "*n*n*n Kickstart 3.x detected:*n"


echo noline " Updating MagicWB for Kickstart 3.x..."
if exists SYS:S/User-Startup
  search > NIL: SYS:S/User-Startup MagicWB-Demon
  if warn
    join Magic:Programs/AllocScript SYS:S/User-Startup TO RAM:User-Startup
    copy > NIL: RAM:User-Startup SYS:S
    delete > NIL: RAM:User-Startup
  endif
else
  copy Magic:Programs/AllocScript TO SYS:S/User-Startup
endif

search > NIL: SYS:S/Startup-Sequence MagicWB-Demon
if warn
  C:EDIT SYS:S/Startup-Sequence WITH Magic:Programs/SSScript
endif

copy > NIL: magic:Programs/MagicWB-Demon SYS:C
copy > NIL: magic:Programs/ataditm sys:s/mti.data
list > RAM:PaletteCheck envarc:sys/palette.prefs
search > NIL: RAM:PaletteCheck AGA
if warn
  copy > NIL: magic:XEN-Icons/Prefs/Env-Archive/Sys/PaletteAGA ENVARC:Sys/Palette.prefs CLONE
endif
delete > NIL: RAM:PaletteCheck
copy > NIL: magic:XEN-Icons/Prefs/Env-Archive/Sys/palette8bit.ilbm ENVARC:Sys
echo "..............................*e[33mDONE*e[0m*n"


echo noline " Do you have the AA (AGA) Chipset? "

set > nil: AGA ?
echo "*e[1;1H*e[J"
if $AGA eq "ja"
  skip InstallAGA
endif
if $AGA eq "j"
  skip InstallAGA
endif
if $AGA eq "y"
  skip InstallAGA
endif
if $AGA eq "yes"
  skip InstallAGA
endif
skip Continue


lab InstallAGA

echo "*n MagicWB offers a special goody to all AGA-Users:*n"
echo " If you want, MagicWB will install a very special Background-Picture. This"
echo " Background-Picture will be an IntelOutside-Logo :) with a beautiful, blue"
echo " gradient on your WB (having more than 520 colors)! You can of course change"
echo " the colors of the gradient.*n"
echo " The magic thing about it is, that it will only need 50KB of Chip-Mem! And"
echo " the result is breathtaking. Second, it will need at least a 16-color-"
echo " screenmode.*n"
echo " If you are not sure about this, just try it out! You may always change this"
echo " configuration afterwards if you won't like it (but you will! ;).*n"
echo noline " Do you want to have this special AGA-Background installed? "

set > nil: AGAPic ?
echo "*e[1;1H*e[J"
if $AGAPic eq "ja"
  skip DoAGA
endif
if $AGAPic eq "j"
  skip DoAGA
endif
if $AGAPic eq "y"
  skip DoAGA
endif
if $AGAPic eq "yes"
  skip DoAGA
endif
skip Continue

lab DoAGA
echo "*e[1;1H*e[J"
echo noline "*n*n Installing AGA-Background..."

copy > NIL: Magic:Patterns/IntelOutside_AGA SYS:Prefs/Patterns
if exists SYS:WBStartup/WBVerlauf
  makedir > NIL: SYS:WBStartup/WBVerlaufOLD
  copy > NIL: SYS:WBStartup/WBVerlauf#? TO SYS:WBStartup/WBVerlaufOLD
  delete > NIL: SYS:WBStartup/WBVerlauf#?
  copy > NIL: Magic:Programs/MagicCopper#? SYS:WBStartup
else
  if exists SYS:WBStartup/MagicCopper
    makedir SYS:WBStartup/MagicCopperBackup
    copy > NIL: SYS:WBStartup/MagicCopper.info SYS:WBStartup/MagicCopperBackup
    copy > NIL: Magic:Programs/MagicCopper.info SYS:WBStartup
    skip cop
  endif
  copy > NIL: Magic:Programs/MagicCopper#? SYS:WBStartup
endif
lab cop
copy > NIL: Magic:Programs/WBPatternAGA.prefs ENVARC:SYS/WBPattern.prefs
echo ".................................*e[33mDONE*e[0m*n"

echo " You MUST now select a 16 color screenmode (or higher if you want)."
echo " This is important to correctly display the AGA-Background on your"
echo " WB. By pressing <RETURN>, the screenmode preferences will appear"
echo " now and you will have to select 16 or more colors and click the"
echo " button SAVE. If a requester appears saying something like *"you must"
echo " now close all windows...*", just ignore it and move it aside and wait"
echo " until this update is finished. The requester will then disappear."
echo " Please press *e[32m<RETURN>*e[0m now."
set > NIL: Return ?
SYS:Prefs/Screenmode
;------------------------ OS3.x, AGA section, END ---------------------------


lab Continue
echo "*e[1;1H*e[J"
echo "*n*n Do you want to install the MagicWB-Dock-Images to SYS:Prefs/MagicWB-Images?"
echo " The assign 'MagicWB:' for this directory will be added to 'S:User-Startup'"
echo " so that you will only need to append the supplied MagicWB-Docks ToolManager-"
echo " configuration to your own ToolManager-config to enjoy the MagicWB-Docks."
echo noline "*n Would you like to have them installed? "
set > nil: docks ?
if $docks eq "ja"
  skip Installdocks
endif
if $docks eq "j"
  skip Installdocks
endif
if $docks eq "y"
  skip Installdocks
endif
if $docks eq "yes"
  skip Installdocks
endif
skip Continue

lab InstallDocks

echo noline "*n*n Installing Dock-Images to SYS:Prefs/MagicWB-Images..."
makedir >NIL: sys:prefs/MagicWB-Images
copy > NIL: magic:xen-icons/Dock-Brushes/#?.brush SYS:Prefs/MagicWB-Images
echo "..............*e[33mDONE*e[0m"
if exists SYS:S/User-Startup
  search > NIL: SYS:S/User-Startup "assign >NIL: MagicWB:"
  if warn
    echo noline "*n Appending MagicWB: assign to SYS:S/User-Startup..."
    echo >>sys:s/user-startup "assign >NIL: MagicWB: SYS:Prefs/MagicWB-Images"
    echo ".................*e[33mDONE*e[0m"
  endif
else
  echo noline "*n Creating SYS:S/User-Startup with MagicWB: assign..."
  echo >sys:s/user-startup "assign >NIL: MagicWB: SYS:Prefs/MagicWB-Images"
  echo "................*e[33mDONE*e[0m"
endif
wait 4
echo "*n*n The Dock-Images are now properly installed. Please use the ToolManager,"
echo " append the supplied configuration for the images (can be found as *e[32mXEN-"
echo " Icons/Dock-Brushes/MagicWB-Docks*e[0m) and configure the Docks to fit your"
echo " own personal taste."

wait 18

lab continue
echo "*e[1;1H*e[J"
echo "*n*e[32m Update is finished.*e[0m*n"
echo > ENVARC:MagicWB "2.0"
echo " In short the new features of MagicWB 2.0:*e[32m*n"
echo "   - MagicWB is now 2-3 times faster than any previous version"
echo "   - It needs over 67% less Chip-Mem compared to previous versions"
echo "   - New color allocation system provides a better color management"
echo "     for icons and patterns. There should be no color problems anymore"
echo "   - Higly improved palette especially for AGA- and graphics board users"
echo "   - All icons (also third-party-MWB-Icons) now have the right colors"
echo "     under any screenmode and screen depth and on all graphic boards"
echo "   - Patterns now work under any Kickstart and are displayed much faster"
echo "   - New standard for drawers introducing content-specific image-drawers"
echo "     and a pool of over 50 different image-drawers for personal use"
echo "   - New XEN/11 font for higher resolutions (this time it is complete)"
echo "   - Many new beautiful patterns and a special AGA-support for a smashing"
echo "     IntelOutside-FullScreen-Pattern with more than 520 colors on-screen"
echo "   - More icons, default icons and dock-brushes"
echo "   - Overall improvement and rework of all MWB-Icons (Prefs, Devices...)"
echo "   - Support-Programs have been improved a lot (-> IconUpdate...)*e[0m"
echo "*n Please read the CHANGES chapter in the MagicWB.guide for detailed info.*n"
echo " [Return]"
set > NIL: Return ?
echo "*e[1;1H*e[J"
echo "*n*n*n NOTE: This installation has only updated the Drawer-Icons in your SYS:"
echo " directory (and of course all sub-directories of SYS:). So you may still find"
echo " old MagicWB-Drawers in other directories/partitions. If you also want to up-"
echo " date these Drawer-Icons (and make them less diskspace-consuming and faster),"
echo " please use the *"UPDATE DRAWERS*" installation of MagicWB. Thank you."
echo "*n [Return]"
set > NIL: Return ?

delete > NIL: ram:MWB
resident > NIL: IU remove
assign > NIL: magic: remove
cd documents/
run >NIL: AboutMagicWB
quit
