failat 21

if not exists Emplant
  echo "*n Please change current directory to that of EmplantMagicWB *n or start the installation from the Workbench!*n"
  quit
endif

echo "*n*e[1;32m _________________________________________________________________________"
echo " *e[43m                                                                         *e[0m"
echo " *e[0;32;43m             Welcome to the INSTALLATION of EmplantMagicWB*e[1m               *e[0m"
echo " *e[1;4;43m                                                                         *e[0m"
echo "*n*n This Installation will automatically install *e[32mEmplantMagicWB*e[0m to your"
echo " Emplant: directory. Don't be afraid; the only things that will be replaced"
echo " (overwritten) by this installation are the old (and ugly-looking)"
echo " Icons from Jim Drew. These old Icons will be replaced by far better-looking"
echo " Icons (called XEN-Icons) from this *e[32mEmplantMagicWB*e[0m-Package.*n"
echo " EmplantMagicWB now DOES PRESERVE your old 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."
echo " EmplantMagicWB just REPLACES the IMAGES of your old Icons with those"
echo " magic images from EmplantMagicWB.*n"
echo " After all, you do have the old Icons by Jim Drew 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 re-installing the Emplant again.*n"
echo noline "   [Return]"
set > nil: Return ?
echo "*e[1;1H*e[J"
echo "*e[1;1H*e[J"
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 update/IconUpdate pure
if warn
  echo "*e[32m Installation aborted due to failure of the 'resident' command!*n Please check if you have got the original 'resident' command in C:*n"
  wait 8
  quit
endif


echo noline " Installing EmplantMagicWB-Icons to Emplant..."
list > ram:MWB Emplant:MAC/#?.info lformat "IU > NIL: sdw mac2icons:emplant/%n Emplant:Mac/%n"
failat 21
execute > NIL: ram:MWB
echo "..............*e[33mDONE*e[0m"

if exists Emplant:MAc/Video_Drivers
echo noline " Installing Emplant-Icons to Emplant:Mac/Video_Drivers..."
list > ram:MWB Emplant:Mac/Video_Drivers/#?.info lformat "IU > NIL: sd mac2icons:emplant/Mac/Video_drivers/def_Monitor.info %s%s"
failat 21
execute > NIL: ram:MWB
echo "..*e[33mDONE*e[0m"
EndIf

if exists Emplant:Mac/ROM_Images
echo noline " Installing Emplant-Icons to Emplant:Mac/ROM_Images..."
list > ram:MWB Emplant:Mac/ROM_Images/#?.info lformat "IU > NIL: sd mac2icons:emplant/Mac/ROM_Images/def_Rom.info %s%s"
failat 21
execute > NIL: ram:MWB
echo "..........*e[33mDONE*e[0m"
EndIf

if exists Emplant:Mac/Ext_IO
echo noline " Installing Emplant-Icons to Emplant:Ext_IO..."
list > ram:MWB Emplant:Mac/Ext_IO/#?.info lformat "IU > NIL: sd mac2icons:emplant/Mac/Ext_IO/def_Std_ADB.info %s%s"
failat 21
execute > NIL: ram:MWB
echo "..........*e[33mDONE*e[0m"
EndIf

lab Continue


resident IU remove
assign Magic: remove

Echo "*n*N*n*n*n The installation is now successfully finished."
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[32mEmplantMagicWB*e[0m as the"
echo "  author has planned it to be!"
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 window, 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
quit
