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

Fix log folder generation failing with UnauthorizedAccessError on UWP #390

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Commits on Dec 1, 2020

  1. Fix log folder generation failing with UnauthorizedAccessError on UWP

    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`.
    NoTuxNoBux committed Dec 1, 2020
    Configuration menu
    Copy the full SHA
    ba3fa36 View commit details
    Browse the repository at this point in the history