-
-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mkbundle executable crash #3767
Conversation
In `CKAN.GameInstance.PortableDir (CKAN.Games.IGame game)`: ```cs // Find the directory our executable is stored in. string exeDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); ```` An empty string would be assigned to `exeDir` when ckan is packaged using mkbundle. This caused following method call `game.GameInFolder(new DirectoryInfo(exeDir))` to crash with `System.ArgumentException: The specified path is not of a legal form (empty).`
For anyone else who wasn't familiar with That sounds potentially useful as an alternate download format. Though for this specific fix, it would be better if we could fall back to the path of the mkbundle-generated executable when the executing assembly path can't be found, so users could still put their native-compiled @memchr, would you mind checking the size of the executables generated in this way? I'm not currently in a Mono environment. |
Co-authored-by: HebaruSan <[email protected]>
This might be the way to get the bundle path:
EDIT: Confirmed, with this change I am able to place the native |
Size of executable generated with mono |
Thanks! That's surprisingly reasonable compared to other modern day downloads (even if it's much larger than |
What command line are you using to build? My Ubuntu VM is giving me an error related to
|
The command i am using is: mkbundle --deps -o ckan --simple --machine-config /etc/mono/4.5/machine.config --config /etc/mono/config --simple ckan.exe However this may not work on Ubuntu as I only tested it on Arch. |
Thanks, that also worked on Ubuntu. 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for improving compatibility with mkbundle
!
In
CKAN.GameInstance.PortableDir (CKAN.Games.IGame game)
:An empty string would be assigned to
exeDir
when ckan is packagedusing mkbundle. This caused following method call
game.GameInFolder(new DirectoryInfo(exeDir))
to crash withSystem.ArgumentException: The specified path is not of a legal form (empty).