#Getting Everest Version Information

41 messages · Page 1 of 1 (latest)

grave gazelle
#

Hey, I'm writing a little script to initialise a mod folder structure and files, just for fun. I'm wondering if there's a best way to find what the user's current Everest version is on their computer, for the .yaml creation. I'm working from the /Celeste folder down in steamapps, is there something in there that I can reference? Thanks!

lofty hatch
#

Is this a mod, or running standalone?

grave gazelle
#

standalone, a powershell script

lofty hatch
#

Powershell has some C# capabilities right? You might be able to interface with Celeste.exe to get the version from everest

grave gazelle
#

ohh yeah you’re right, i’ll give that a try. there’s probably a way to extract version info from the app itself with C#. this might betray my lack of knowledge about how everest mounts onto celeste, but is it true that everest information will be contained in the celeste executable? i always wondered if it was a sort of standalone clone or something

lofty hatch
#

Yes, all of Everest gets injected into Celeste.exe

surreal marsh
#

you can either use something like Olympus using mono.cecil to inspect the CIL properly, or do something like mons and just look for the appropriate string constant

lofty hatch
#

Couldn't you just import it and do Celeste.Mod.Everest.VersionString

surreal marsh
#

possibly? I guess with a script it's not an issue to "dynamically" import it

grave gazelle
#

hm, interesting. thank you!

grave gazelle
lofty hatch
#

Look up how you dynamically load an assembly in C#1066849078262104075 I've done it before, but I forget the details

grave gazelle
#

cool, thanks

lofty hatch
#

Whack

grave gazelle
#

hm. really at a sticking point here. i've managed to load the dll into my script, but i'm at a loss as to how to actually interact with it. i see Celeste.Mod.Everest.VersionString in Celeste.Mod.mm.xml, but I'm not sure how to access it via the DLL itself. Even disassembled the DLL but didn't find reference to VersionString

lofty hatch
#

Do you have everest installed?

grave gazelle
#

yes i do

#

it seems that when the DLL is loaded there aren't any accessible members 🤷

#

this is in Celeste.Mod.mm.xml as well as Celeste.xml, which does not have an associated DLL

<member name="F:Celeste.Mod.Everest.BuildString">
            <summary>
            The currently installed Everest build in string form.
            </summary>
        </member>
#

worst comes to worst i'll just have people input their everest version. they'll probably have olympus handy anyways to view it

lofty hatch
#

Could you show the code you've tried?

lofty hatch
grave gazelle
#

fair lol

#

i've got this:

$dllPath = Join-Path $PSScriptRoot 'Celeste.Mod.mm.dll'

$everest = [System.Reflection.Assembly]::LoadFrom($dllPath)

Write-Host $everest.DefinedTypes
#

$everest prints metadata about the dll, so it's definitely being loaded in, but .DefinedTypes doesn't return anything

lofty hatch
#

Try $everest::GetType("Celeste.Mod.Everest")::GetField("VersionString", /*something with binding flags here, not sure*/)::GetValue(null)

#

Oh wait

#

You loaded the wrong file

#

You loaded Celeste.Mod.mm.dll, not Celeste.exe

grave gazelle
#

hmm, it's not happy about me trying to load an exe instead of a dll

#
(x86)\Steam\steamapps\common\Celeste\Celeste.exe' or one of its dependencies. An attempt was made to load a program with an   
incorrect format."```
lofty hatch
#

Yep, using the 32-bit version of powershell fixed it for me, although that's not a very good solution for a script

grave gazelle
#

yeah, definitely.

#

i really appreciate all of your help, I think it may be time to put this to rest unfortunately

#

ok i'm going to just read from log.txt instead 🙂 grab the everest minor number from VersionCelesteString

lofty hatch
#

Probably works well enough

grave gazelle
#

yeah. i figure at worst it’ll be a run of everest behind. for instance i’ve just updated everest, and so it probably won’t work. but next time hopefully it’ll update

grave gazelle
#

yup, it works pumbs_up

lofty hatch
#

Marked this as resolved