Pyrdacor / Ambermoon.net

Ambermoon rewrite in C#
GNU General Public License v3.0
425 stars 22 forks source link

[Bug report] Savegames temporarly gone after patching #359

Open Pyrdacor opened 1 year ago

Pyrdacor commented 1 year ago

In general Windows users just start the app with normal privileges (not admin). In this case the app has often no write permissions inside the app folder. In this case the app checks for that and fallbacks to some user application data folder for savegames, screenshots and the configuration file.

However when patching the application explicitly asks for admin rights because it needs to copy files. But then the app itself is also started with admin rights and then might be able to write to the app folder directly.

The problem now is that the saves are inside the user application data folder while the current app instance expects them in the app folder (as it now has write access and can't know that it is only temporary).

It could be fixed by starting the app with normal privileges after patching but this is only half the solution. The user can decide to start the app with admin rights at any time and won't see pre-existing saves then as well.

It might be better to do the following:

There might be a remaining problem. If the last saving case happens and afterwards the user starts with admin rights, the first saving case will prevent from saving inside the app folder forever. However there might be old saves and configs and the user might wonder why they are not updated.

Pyrdacor commented 11 months ago

Needs testing but maybe the patcher now starts the exe with normal privileges after patching.