UltraStar-Deluxe / USDX

The free and open source karaoke singing game UltraStar Deluxe, inspired by Sony SingStarâ„¢
https://usdx.eu
GNU General Public License v2.0
879 stars 162 forks source link

Windows: Install location might not be writable at runtime #924

Open DeinAlptraum opened 2 days ago

DeinAlptraum commented 2 days ago

Actual behaviour

The config.ini is located in the installation directory, and it is overwritten when options are changed, including every time one passes through the player-selection screen. Depending on the install location and the executing user's permissions, this might fail, thus crashing the game with an error "Unable to create file".

Expected behaviour

Under Windows, programs are expected to save their relevant configurations etc. to ProgramData or similar user folders. This should ensure that config.ini is writable, allowing the player to change options and play the rest of the game without crashing.

Steps to reproduce

Disclaimer: I haven't encountered this issue myself, but seen it brought up by Windows users several times.

I assume it could be recreated by e.g. letting an admin user install USDX, and then letting a regular user start the game or similar.

Details

Provide some additional information:

basisbit commented 2 days ago

UAC since Windows Vista will relay writes to a non-writeable Programs folder into the users AppData folder (which behaves as a virtual overlay). This should only break on systems where UAC is turned off (usually by a sysadmin on purpose) or when users manually copy the USDX folder to the Programs folder.

Admin user installing USDX and then a non-admin opening it works fine on Windows. The way how USDX since 1.3 does it is exactly how applications should behave since Windows Vista.