| This version of the RISC OS 4.02 !Boot.Utils.BootRun 
| is patched to correctly load the UnplugTBox program
| Previously the UnplugTBox program was incorrectly BootLoaded instead of BootRun
| 18/11/03

FX 247 2_10101010
FX 229 1
<Boot$Dir>.Library.apppath Run$Path <Boot$Dir>.Library.

| Modules we definately require
If Boot$OSVersion >= 300 then RMEnsure VProtect 2.37 RMLoad Boot:Utils.VProtect
If Boot$OSVersion <  370 Then RMEnsure CallASWI   0.00 RMLoad Boot:Utils.CallASWI
If Boot$OSVersion >= 360 then RMEnsure AppPatcher 0.00 RMLoad Boot:Utils.PatchApp

| If there's a territory manager, load that
IfThere <Boot$Dir>.^.!Territory Then /<Boot$Dir>.^.!Territory

| The choices paths and related things
If Boot$OSVersion >= 350 then WimpSlot -next 256K
If Boot$OSVersion >= 350 then /Boot:Utils.FreePool
Obey -c <Boot$Dir>.Utils.SetChoices

| The aliases for pre-desktop initialisation
Set Alias$BootLoad Echo %%*0|mLoad %%*0|mEcho |<11>|<23>|<8>|<5>|<6>|<0>|<0>|<0>|<0>|<0>|<0>|<11>|m
Set Alias$BootRun  Echo %%*0|m/%%*0|mEcho |<11>|<23>|<8>|<5>|<6>|<0>|<0>|<0>|<0>|<0>|<0>|<11>|m
Set Alias$BootObey Obey -c %%*0
Set Alias$@LoadType_FEB BootObey %%*0
Set Alias$@LoadType_FF8 /%%*0
Set Alias$@LoadType_FF9 IconSprites %%*0
Set Alias$@LoadType_FFA RMLoad %%*0
Set Alias$@LoadType_FFB BASIC -quit %%*0
Set Alias$@LoadType_FFC /%%*0

| Pre-desktop initialisation
/Boot:Utils.HOn
/Boot:Utils.AddToRMA 256
IF "<System$Path>"   = "" Then IfThere <BootResources$Dir>.!System Then /<BootResources$Dir>.!System
IF "<Wimp$ScrapDir>" = "" Then IfThere <BootResources$Dir>.!Scrap  Then /<BootResources$Dir>.!Scrap
IfThere <BootResources$Dir>.!Fonts  Then /<BootResources$Dir>.!Fonts.!Boot

| Boot !Internet so we can see the MimeMap file
| Then reinitialise MimeMap so it can read its mapping file
| At each stage check that everything is valid so it can't die with an error
If Boot$OSVersion >= 400 Then IfThere <BootResources$Dir>.!Internet Then /<BootResources$Dir>.!Internet.!Boot
If (Boot$OSVersion >= 400) AND ("<InetDBase$Path>" <> "") AND ("<Inet$MimeMappings>" = "") Then Set Inet$MimeMappings InetDBase:MimeMap
If (Boot$OSVersion >= 400) AND ("<Inet$MimeMappings>" <> "") Then IfThere <Inet$MimeMappings> Then RMReInit MimeMap

| Load the registration details banner module
RMEnsure OwnerBanner 4.00 RMLoad Boot:Utils.Banner
BootRun Boot:Utils.UnplugTbox
BootObey Choices:Boot.PreDesktop
Repeat BootLoad <Choices$Dir>.Boot.PreDesk -files
Repeat BootRun  <Choices$Dir>.Boot.PreDesk -directories

| Now reset the variables to their original state
Unset Alias$@LoadType_FEB
Unset Alias$@LoadType_FF8
Set   Alias$@LoadType_FF9 SLoad %%0
Set   Alias$@LoadType_FFA RMLoad %%*0
Set   Alias$@LoadType_FFB Basic -load |"%%0|" %%*1
Unset Alias$@LoadType_FFC
Unset Alias$BootLoad
Unset Alias$BootRun
Unset Alias$BootObey

/Boot:Utils.ShrinkRMA

FX 247 1
FX 229 0
/Choices:Boot.Desktop
