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!
#Getting Everest Version Information
41 messages · Page 1 of 1 (latest)
Is this a mod, or running standalone?
standalone, a powershell script
Powershell has some C# capabilities right? You might be able to interface with Celeste.exe to get the version from everest
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
Yes, all of Everest gets injected into Celeste.exe
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
Couldn't you just import it and do Celeste.Mod.Everest.VersionString
possibly? I guess with a script it's not an issue to "dynamically" import it
hm, interesting. thank you!
how can i import it? sorry if it's a rudimentary question 😅
Look up how you dynamically load an assembly in C#1066849078262104075 I've done it before, but I forget the details
cool, thanks
lmao the thread mention
Whack
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
Do you have everest installed?
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
Could you show the code you've tried?
Celeste.xml's associated assembly is literally Celeste.exe
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
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
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."```
Might be because Celeste on Windows is 32-bit
https://intellitect.com/blog/loadfrom-exception-an-attempt-was-made-to-load-a-program-with-an-incorrect-format/
To correct the problem, recompile the assembly using a more appropriate platform target or run the 32-bit version of PowerShell
Yep, using the 32-bit version of powershell fixed it for me, although that's not a very good solution for a script
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
Probably works well enough
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
yup, it works 
Marked this as resolved