| Run file for StrongED.
|  StrongED developers.

| Set up directory path and load sprites.
Set StrongED$Dir <Obey$Dir>
IconSprites <StrongED$Dir>.Resources.!Sprites
If "<Theme$Name>" <> "" Then IconSprites <Theme$Path>.Apps.StrongED.!Sprites22

| Setup application info
Set StrongED$Description "StrongED Text editor"
Set StrongED$Publisher "StrongED Developers"
Set StrongED$Version "4.68"
Set StrongED$Title "StrongED"
Set StrongED$Help "<StrongED$Dir>.!Help"
Set StrongED$Web "http://www.stronged.iconbar.com"

| Find operating system version.
SetEval StrongED$OSVsn 600
RMEnsure UtilityModule 6.00 SetEval StrongED$OSVsn 500
RMEnsure UtilityModule 5.00 SetEval StrongED$OSVsn 400
RMEnsure UtilityModule 4.00 SetEval StrongED$OSVsn 350
RMEnsure UtilityModule 3.50 SetEval StrongED$OSVsn 310
RMEnsure UtilityModule 3.10 SetEval StrongED$OSVsn 200

| StrongED needs at least RISC OS 3.10 to run.
If StrongED$OSVsn < 310 Then Error 0 StrongED needs RISC OS 3.10 or later.

| Don't use dynamic areas on RISC OS 3.1x or 5.xx
If StrongED$OSVsn >= 350 Then Set StrongED$UseDA 1 Else Set StrongED$UseDA 0
If StrongED$OSVsn >= 500 AND StrongED$OSVsn < 600 Then Set StrongED$UseDA 0

| StrongED uses CallASWI so make sure it's available
RMEnsure UtilityModule 3.70 RMEnsure CallASWI 0.02 RMLoad System:Modules.CallASWI
RMEnsure UtilityModule 3.70 RMEnsure CallASWI 0.02 Error StrongED requires CallASWI 0.02 or later

| Ensure we have a scrap directory
If "<Wimp$ScrapDir>" = "" Then Error 0 Please locate !Scrap
IfThere <Wimp$ScrapDir>.StrongED Then Else CDir <Wimp$ScrapDir>.StrongED
Set StrongED_Scrap$Dir <Wimp$ScrapDir>.StrongED

| Ensure the modules StrongED needs are loaded.
RMEnsure Dialogue    1.12 RMLoad <StrongED$Dir>.Tools.Dialogue
RMEnsure BasicRunner 2.01 RMLoad <StrongED$Dir>.Tools.BasicRun
RMEnsure StrongTask  1.02 RMLoad <StrongED$Dir>.Tools.StrongTask
RMEnsure KeyExtend   0.19 RMLoad <StrongED$Dir>.Tools.KeyExtend
Desktop_KeyExtend

| Set up StrongED's read and write paths.
Obey <StrongED$Dir>.SetupCfg

| Find out some information about BASIC.
WimpSlot -min 64K -max 64K
Run <StrongED$Dir>.Tools.Export

| Run OldTmps so that old Tmp_* variables are set
Run <StrongED$Dir>.Tools.OldTmps

| If there is an Init file in either UserPrefs or Defaults then run it.
IfThere StrongED_Read:Init Then Obey StrongED_Read:Init

| If there is a Claim file in either UserPrefs or Defaults then run it.
IfThere StrongED_Read:ClaimFiles Then Obey StrongED_Read:ClaimFiles

| Run ResFind to figure out which set of resources to use.
| We need to reset Obey$Dir to this file because the above calls
| altered it and ResFind uses it to set StrongED$Dir (ugly, I know).
WimpSlot -min 64K -max 64K
Set Obey$Dir <StrongED$Dir>
Run <StrongED$Dir>.Tools.ResFind StrongED

| Finally set wimpslot and run StrongED.
WimpSlot -min 512K -max 512K
Run <StrongED$Dir>.!RunImage %*0