| !Run file for MBBack
Run <Obey$Dir>.!Boot

| Ensure New Boot structure
If "<Wimp$ScrapDir>" = "" Then Error !Scrap is required for this application
If "<Choices$Path>" = "" Then Error New Boot is required for this application
IfThere <Wimp$ScrapDir>.MBBack Then Else CDir <Wimp$ScrapDir>.MBBack
IfThere <Choice$Write>.MBBack Then Else CDir <Choices$Write>.MBBack
IfThere <Wimp$ScrapDir>.MBBack.Downloads.* Then Wipe <Wimp$ScrapDir>.MBBack.Downloads.* ~C~V Else CDir <Wimp$ScrapDir>.MBBack.Downloads

| Ensure presence of source file
| Discounted if called with -s switch - makes MBBCtrl friendlier for new users
Set MBBack$NoSource 1
IfThere MBBack:Source Then Set MBBack$NoSource 0 Else If "%0" RIGHT 2 = "-s" Then Set MBBack$NoSource 0 Else Create <Choices$Write>.MBBack.Source
If "<MBBack$NoSource>" = "1" Then SetType <Choices$Write>.MBBack.Source &FFF

| RISC OS 6.20 is required to use new-style OS backdrop commands
Set MBBack$RO620 1
RMEnsure UtilityModule 6.20 Set MBBack$RO620 0

| Open source file if application hasn't been run yet, otherwise proceed to
| main part of program
| Now we encourage users to RTFM as well... learnt that one the hard way!
WimpSlot -min 72K -max 72K
If "<MBBack$NoSource>" = "1" Then Filer_Run MBBack:Source
If "<MBBack$NoSource>" = "1" Then Filer_Run <MBBack$Dir>.!Help
If "<MBBack$NoSource>" = "1" Then Error It looks as if you haven't run MBBack before. Please read the manual very carefully before continuing. Else Run <MBBack$Dir>.!RunImage %0
Unset MBBack$NoSource