Nitrox
Nitrox copied to clipboard
Add "Service" project that handles system configuration, which demands admin permissions
Situation
Nitrox doesn't have permission to the directory C:\Program Files (x86)\Steam\steamapps\common\Subnautica
by default. Currently, we request Nitrox to run as admin in its entirety to mitigate, which is a security concern.
Proposal
Add a new Nitrox.Service project that is executed by the launcher to grant the necessary permissions to the launcher executable. The Service project must only contain specific code to help Nitrox, not to allow general access to system config by non-Nitrox code.
We should also add an "uninstall record" via this Service project, so that Windows users can stick to the convention of using the "Add or remove program" feature to remove Nitrox.
Remarks
The JetBrains Rider IDE and Rockstar Game Launcher both use this design. They install a "Windows Service" process, which is running as the SYSTEM
user on Windows. This allows them to make changes without requesting admin.
Related: #1474
Through digging, the things ive discovered about steam, Steam Game folders are created by default with read, write, and execute permission for the AuthenticatedUsers group, which all users on a Windows Operating System who have Signed in are a part of, The NitroxLauncher inherits this group when being launched as well by default.
Thus, we should have no reason to be requesting admin permission for Steam games, Epic Games also likely follows the same format. The only reason admin permissions should be required is in the event of files being created by Nitrox in the past due to improper advice and a lack of forethought on our part regarding the issue.
As for one of the first instances of Administrator being recommended as a fix, https://gyazo.com/dbc9feb77333708d72d8a99c19695a34 it was for Epic Games and even Epic Games https://gyazo.com/482d5f4fae40bd21cc0dd6b34ccffb68 failed to manage the folder.