stride3d / stride

Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
https://stride3d.net
MIT License
6.65k stars 957 forks source link

fix: getting app exe path when using PublishSingleFile #2352

Closed Basewq closed 5 months ago

Basewq commented 5 months ago

PR Details

Use PlatformFolders.ApplicationExecutablePath instead of Assembly.GetEntryAssembly().Location

https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli#api-incompatibility Under 'API incompatibility' Assembly.Location is not available with single file deployment. https://learn.microsoft.com/en-us/dotnet/api/system.environment.processpath?view=net-8.0 Environment.ProcessPath can be used as a fallback, but do note that even that can return null.

Related Issue

Fixes #2304 where Icon is set via GameContext.ProductLocation

Also fixes the super secret LeftCtrl + C+ F1 screenshot command in PublishSingleFile.

Types of changes

Checklist

Eideren commented 5 months ago

Thanks !