| !Run file for PopStop

| Standard stuff. CarryOn is used later as a way of stopping PopStop from here,
| without having to resort to a nasty, non-multitasking Error command
Set PopStop$Dir <Obey$Dir>
Set PopStop$CarryOn "True"
IconSprites <PopStop$Dir>.!Sprites

| Internationalisation stuff
Run <PopStop$Dir>.Resources.ResFind PopStop

| Set up the location of the Help variables
Set PopStop$Meta PopStopRes:!Meta

| We need RISC OS 3 at least (prequit flag)
RMEnsure UtilityModule 3.0 Run PopStopRes:MultiError -l PopStop -t PopStopRes:Templates -m PopStopRes:Messages -k error_minimumos
RMEnsure UtilityModule 3.0 UnSet PopStop$CarryOn

| Need to RmEnsure 1.07 of SUL
|RMEnsure SharedUnixLibrary 1.07 IfThere System:Modules.SharedULib Then RMLoad System:Modules.SharedULib
|RMEnsure SharedUnixLibrary 1.07 Run PopStopRes:MultiError -l PopStop -t PopStopRes:Templates -m PopStopRes:Messages -k error_minimumunixlib
|RMEnsure SharedUnixLibrary 1.07 UnSet PopStop$CarryOn

| Need up to date SCL
RMEnsure SharedCLibrary 5.17 IfThere System:Modules.Clib Then RMLoad System:Modules.CLib
RMEnsure SharedCLibrary 5.34 PopStopRes:MultiError -l PopStop -t PopStopRes:Templates -m PopStopRes:Messages -k run_minclib
RMEnsure SharedCLibrary 5.34 UnSet PopStop$CarryOn

| Check if AcornURI is present, try to load it, if it's still not there set a variable to use in !RunImage
Set PopStop$AcornURITest "Present"
RMEnsure AcornURI 0.12 IfThere System:Modules.Network.URI Then Filer_Run System:Modules.Network.URI
RMEnsure AcornURI 0.12 UnSet PopStop$AcornURITest

| We require SysLog. It needs all sorts of convolusion to check if it can be loaded, then load it.
| Combining this with the use of MultiError gives a quite messy result... :-(
If "<SysLog$Dir>" = "" Then PopStopRes:MultiError -l PopStop -t PopStopRes:Templates -m PopStopRes:Messages -k error_needsyslog
If "<SysLog$Dir>" <> "" Then RMEnsure SysLog 0.17 IfThere <SysLog$Dir>.!Run Then Run <SysLog$Dir>.!Run
If "<SysLog$Dir>" <> "" Then RMEnsure SysLog 0.17 PopStopRes:MultiError -l PopStop -t PopStopRes:Templates -m PopStopRes:Messages -k error_needsyslog

WimpSlot -Min 460k -Max 460k
If "<PopStop$CarryOn>" = "True" Then Run <PopStop$Dir>.!RunImage
| %*0 2><PopStop$Dir>.ErrorLog
Unset PopStop$AcornURITest
UnSet PopStop$CarryOn
IfThere <Wimp$ScrapDir>.PopStop.UpdateScript Then Filer_Run <Wimp$ScrapDir>.PopStop.UpdateScript