MonoMod / MonoMod.Common

Common code used by MonoMod and other .NET modding libraries. Not to be confused with MonoMod.Utils (for mods).
MIT License
74 stars 32 forks source link

PlatformHelper platform detection falsely detects iOS on Windows #2

Closed JavidPack closed 4 years ago

JavidPack commented 4 years ago

https://github.com/MonoMod/MonoMod.Common/blob/fed55e9634c64da1062f6e85099c0b334668a0f6/Utils/PlatformHelper.cs#L52-L56

The above code incorrectly sets the platform to iOS if the user just happens to have the specified folders in the root of the drive of the current working directory.

To replicate, simply make an Applications and System folder in the drive you are running monomod from.

I don't know what a proper fix would be, but Applications and System are common enough that some users on Windows or other platforms might run into this.

A solution might just be continuing the previous if-else chain, or check if it is still unknown at this point.

0x0ade commented 4 years ago

Fixed with c9e30b0ea5957b1de0740ae4dd13015e75d402cc.