| Run one of the Ensure variants depending on whether a 32-bit version of CLib is running or not

| This script does not assume it is in PlayIt$Path and will reassign PlayIt$Path to point to
| itself /if/ the local version is newer than whatever is at any pre-existing PlayIt$Path.

| Remember out local path since Obey$Dir may well get overwritten shortly.
Set PlayItLocal$Path <Obey$Dir>.

|echo PlayIt$Path is "<PlayIt$Path>"
|echo PlayItLocal$Path is "<PlayItLocal$Path>"
|echo PlayItLocalStacked$Path is "<PlayItLocalStacked$Path>"
|echo PlayIt$Ext is "<PlayIt$Ext>"

| See if there is another PlayIt already seen and run its Ensure if there is.
If "<PlayIt$Ext>" = "" Then If "<PlayIt$Path>" <> "" Then if "<PlayIt$Path>" <> "<PlayItLocal$Path>" Then /PlayItLocal:EnsureExt %*0

| Make a copy of what version got loaded above (or what was already running)
Set PlayIt$CurVersion <PlayIt$Version>

|echo PlayIt$CurVersion is "<PlayIt$CurVersion>"
|echo PlayItLocal$Path is "<PlayItLocal$Path>"

| Do ensure on the local version
Set CLibIs32bit "yes"
RMEnsure SharedCLibrary 5.17 UnSet CLibIs32bit
if "<CLibIs32bit>" = "" Then /PlayItLocal:Ensure26 %*0 Else /PlayItLocal:Ensure32 %*0

| If the local one is newer then point path to here instead.
if "<PlayIt$Version>" > "<PlayIt$CurVersion>" Then Set PlayIt$Path <PlayItLocal$Path>

|echo New PlayIt$Version is "<PlayIt$Version>"
|echo New PlayIt$Path is "<PlayIt$Path>"

Unset CLibIs32bit
Unset PlayItLocal$Path
Unset PlayIt$CurVersion
Unset PlayItLocal$Path
