| !Boot file for !FontMGR2
| This is a little complex as it actually runs the !FontMgr2 program
If "<Wimp$ScrapDir>" = "" Then ERROR Scrap directory cannot be found.
Iconsprites <Obey$Dir>.!Sprites
Set FontMgr2$Dir <Obey$Dir>

| For pre-riscos 3.5, set alias & unalias
If "<Alias$Alias>" = "" Then Set Alias$Alias Set Alias$%%0 %%*1
If "<Alias$UnAlias>" = "" Then Alias UnAlias Unset Alias$%%0 

| Make sure we have the correct toolbox versions
Alias Clean_Up UnAlias Clean_Up|MUnAlias Check_Module|MERROR You need version %%1 of %%0 from the Acorn Toolbox to run !FontMgr2
Alias Check_Module RmEnsure %%0 0.0 IfThere System:Modules.Toolbox.%%2 Then RmLoad System:Modules.Toolbox.%%2|MRmEnsure %%0 %%1 Clean_Up %%0 %%1

Check_Module Toolbox 1.63 Toolbox
Check_Module Window 1.62 Window
Check_Module IconBar 1.20 IconBar
Check_Module Menu 0.36 Menu
Check_Module ProgInfo 0.16 ProgInfo
Check_Module SaveAs 0.17 SaveAs
Check_Module FontMenu 0.22 FontMenu
Check_Module DCS 1.09 DCS_Quit
Check_Module TextGadgets 0.21 TextGadget

UnAlias Check_Module
UnAlias Clean_Up

| If we haven't been called before and aren't being called from the main
| code, then run the code to set up the font paths
If "<File$Type_3f8>" <> "FontMGR" AND "%0" = "" Then /<FontMgr2$Dir>.!RunImage

| Set up the magic types
Set File$Type_3f8 FMScript
Alias @RunType_3f8 Run <FontMgr2$Dir>.!Run %%*0
