

| Run file for Cassia






| Set path
Set Cassia$Dir <Obey$Dir>

| Load sprites
IconSprites <Cassia$Dir>.!Sprites
RMEnsure UtilityModule 5.00 IconSprites <Cassia$Dir>.FileIcons

| Acorn URI protocol
Set Alias$Open_URI_http <Cassia$Dir>.!Run --nowindow
Set Alias$Open_URI_https <Cassia$Dir>.!Run --nowindow
Set Alias$Open_URI_file <Cassia$Dir>.!Run --nowindow

| ANT URI protocol
Set Alias$URLOpen_http <Cassia$Dir>.!Run %%*0
Set Alias$URLOpen_https <Cassia$Dir>.!Run %%*0
Set Alias$URLOpen_file <Cassia$Dir>.!Run %%*0

| Claim HTML and URI files
Set Alias$@RunType_FAF <Cassia$Dir>.!Run -file %%*0
Set Alias$@RunType_F91 <Cassia$Dir>.!Run -file %%*0
Set Alias$@RunType_B28 <Cassia$Dir>.!Run -file %%*0

| Set up the path on which the Application and Resources reside
Set Cassia$Path <Cassia$Dir>.,<Cassia$Dir>.Resources.

Set Cassia$OS 0
RMEnsure UtilityModule 5.00 Set Cassia$OS 1
If "<Cassia$OS>" = "0" Then Set Cassia$Path <Cassia$Dir>.Resources.Res5.,<Cassia$Path>,
Unset Cassia$OS

| Find the Configuration files
Set Cassia$Resources <Cassia$dir>.Resources
Set CassiaFonts$Path <Cassia$Dir>.Resources.Fonts.,<TrueTypeFont$Path>

| Check we are running on the correct version of RISC OS
RMEnsure UtilityModule 3.50 Error This application requires RISC OS 3.50 or later

| Ensure CallASWI is installed
RMEnsure UtilityModule 3.70 RMEnsure CallASWI 0.02 RMLoad System:Modules.CallASWI
RMEnsure UtilityModule 3.70 RMEnsure CallASWI 0.02 Error This application requires CallASWI 0.02 or later

| Ensure the floating point emulator is installed
RMEnsure FPEmulator 4.03 RMLoad System:Modules.FPEmulator
RMEnsure FPEmulator 4.03 Error This application requires FPEmulator 4.03 or later

| Ensure the 32bit CLib is installed
RMEnsure SharedCLibrary 5.45 RMLoad System:Modules.CLib
RMEnsure SharedCLibrary 5.45 Error This application requires SharedCLibrary 5.45 or later

| Ensure we have audio support
Set Cassia$Sound "yes"
RMEnsure SharedSound 1.04 RMLoad System:Modules.SSound
RMEnsure SharedSound 1.04 Set Cassia$Sound "no"

| Load Cassia's own modules
Obey Cassia:Modules.LoadMods

| Check for mime map module
If "<InetDBase$Path>" = "" Then Error Inet databases can not be found
If "<Inet$MimeMappings>" = "" Then Set Inet$MimeMappings InetDBase:MimeMap
RMEnsure MimeMap 0.10 RMLoad System:Modules.Network.MimeMap
RMEnsure MimeMap 0.10 Error This application requires MimeMap 0.10 or later

| Ensure that the Toolbox modules are available
RMEnsure Toolbox 1.45 RMLoad System:Modules.Toolbox.Toolbox
RMEnsure Window 1.59 RMLoad System:Modules.Toolbox.Window
RMEnsure IconBar 1.18 RMLoad System:Modules.Toolbox.IconBar
RMEnsure Menu 0.35 RMLoad System:Modules.Toolbox.Menu
RMEnsure ProgInfo 0.15 RMLoad System:Modules.Toolbox.ProgInfo
RMEnsure SaveAs 0.16 RMLoad System:Modules.Toolbox.SaveAs

RMEnsure Toolbox 1.45 Error This application requires the Toolbox
RMEnsure Window 1.59 Error Failed to load Window Module
RMEnsure Iconbar 1.18 Error Failed to load IconBar Module
RMEnsure Menu 0.35 Error Failed to load Menu Module
RMEnsure ProgInfo 0.15 Error Failed to load ProgInfo Module
RMEnsure SaveAs 0.16 Error Failed to load SaveAs Module

| And Ensure that !ConfiX is booted
Filer_Run <Cassia$Dir>.!ConfiX.!Boot

Set Cassia$Running "Yes"

WimpSlot -Min 5000K -Max 5000K
<Cassia$Dir>.!RunImage %*0
Unset Cassia$Running
