Obsidian icon indicating copy to clipboard operation
Obsidian copied to clipboard

Invalid executable path under certain conditions

Open ndelta0 opened this issue 2 years ago • 2 comments

Using Assembly.Get***Assembly().Location will return an empty value when the project is packed into a single file executable.

https://github.com/ObsidianMC/Obsidian/blob/9ff5df4421ef319753d3cd7a8335f104bb8276bd/Obsidian/Program.cs#L32

The way to prevent this is to use AppContext.BaseDirectory which will return a valid path under all conditions.

ndelta0 avatar Nov 01 '21 22:11 ndelta0

We should make sure that we don't use APIs incompatible with single file builds.

Seb-stian avatar Nov 01 '21 22:11 Seb-stian

We shouldn't query for binary locations, especially considering Linux conventions where programs are in a read-only binary directory, instead we should use the working directory like every other program.

Craftplacer avatar Nov 06 '21 19:11 Craftplacer

Closing this as its been fixed.

Tides avatar Jan 03 '23 08:01 Tides