C7-Game / Prototype

An early-stage, open-source 4X strategy game
https://c7-game.github.io/
MIT License
33 stars 9 forks source link

Crash on Launch on M1 Mac #385

Closed pcen closed 1 year ago

pcen commented 1 year ago

Resolve the following, and log something useful instead of crashing:

E 0:00:01.586   void System.IO.FileSystem.CreateDirectory(System.String ): System.TypeInitializationException: The type initializer for 'Util' threw an exception. ---> System.IO.IOException: Read-only file system
  <C++ Error>   Unhandled exception
  <C++ Source>  :0 @ void System.IO.FileSystem.CreateDirectory(System.String )()
  <Stack Trace> :0 @ void System.IO.FileSystem.CreateDirectory(System.String )()
                :0 @ System.IO.DirectoryInfo System.IO.Directory.CreateDirectory(System.String )()
                :0 @ Microsoft.Win32.KeyHandler..ctor(Microsoft.Win32.RegistryKey , System.String , Boolean )()
                :0 @ Microsoft.Win32.KeyHandler..ctor(Microsoft.Win32.RegistryKey , System.String )()
                :0 @ Microsoft.Win32.KeyHandler Microsoft.Win32.KeyHandler.Lookup(Microsoft.Win32.RegistryKey , Boolean )()
                :0 @ Microsoft.Win32.RegistryKey Microsoft.Win32.UnixRegistryApi.OpenSubKey(Microsoft.Win32.RegistryKey , System.String , Boolean )()
                :0 @ Microsoft.Win32.RegistryKey Microsoft.Win32.RegistryKey.OpenSubKey(System.String , Boolean )()
                :0 @ ()
                :0 @ Microsoft.Win32.RegistryKey Microsoft.Win32.Registry.ToKey(System.String , Boolean )()
                :0 @ System.Object Microsoft.Win32.Registry.GetValue(System.String , System.String , System.Object )()
                Util.cs:49 @ System.String Util.Civ3PathFromRegistry()()
                Util.cs:38 @ System.String Util.GetCiv3Path()()
                Util.cs:10 @ Util..cctor()()
                :0 @ --- End of inner exception stack trace ---()
                MainMenuMusicPlayer.cs:19 @ void MainMenuMusicPlayer._Ready()()
QuintillusCFC commented 1 year ago

Ah, so you are the first person to try C7 on an M1 Mac! Or at least the first one I am aware of.

Looking at the stack trace I'm half-surprised this didn't cause an issue on Linux or Intel Macs.

pcen commented 1 year ago

Yeah so far everything seems to work fine on M1 except for his exception, which I think was failing silently / not throwing on intel mac, which I also find a bit surprising