stride3d / stride

Stride Game Engine (formerly Xenko)
https://stride3d.net
MIT License
6.32k stars 917 forks source link

fix: getting app exe path when using PublishSingleFile #2352

Closed Basewq closed 2 days ago

Basewq commented 4 days 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 2 days ago

Thanks !