Skip to content
This repository was archived by the owner on Aug 15, 2022. It is now read-only.

Conversation

@NoTuxNoBux
Copy link

This happens immediately on startup, even if nothing is logged, because the folders are created and their path is inside the application directory in e.g. Data/Logs, which is read-only for security reasons on UWP - and will likely also be read-only when an app is installed versions on Linux distributions.

The exact error is:

UnauthorizedAccessException: Access to the path "C:/data/Programs/WindowsApps/unity-app_1.0.0.0_foo_abcdefghijk/Data/Logs" is denied.`

System.IO.Directory.CreateDirectoriesInternal (System.String path) <...>
System.IO.Directory.CreateDirectory (System.String path) <...>
BMSLogger.Init () <...>

This changes the path to use the persistent data path, which is writable, and on Windows something like LocalAppData\unity-app_1.0.0.0_foo__abcdefghijk\LocalState\Logs\bmslog.txt.

This happens because the path is inside the application directory in
e.g. "Data/Logs", which is read-only for security reasons on UWP - and
will likely also be read-only when an app is installed versions on Linux
distributions.

The exact error is:

```
UnauthorizedAccessException: Access to the path "C:/data/Programs/WindowsApps/unity-app_1.0.0.0_foo_abcdefghijk/Data/Logs" is denied.`

System.IO.Directory.CreateDirectoriesInternal (System.String path) <...>
System.IO.Directory.CreateDirectory (System.String path) <...>
BMSLogger.Init () <...>
```

This changes the path to use the persistent data path, which is
writable, and on Windows something like
`LocalAppData\unity-app_1.0.0.0_foo__abcdefghijk\LocalState\Logs\bmslog.txt`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant