-
Notifications
You must be signed in to change notification settings - Fork 84
Description
The Windows Store version of Skyrim Special Edition doesn't play nice right now. It's installed to the Program Files\ModifiableWindowsApps location, which has some special write permissions. The main folder we cannot write to (without some serious permission editing - more than just taking ownership, etc), but subfolders (ie: the Data folder) are perfectly writable.
MSStore apps function very differently than we're used to:
- The actual data files for the program are stored in a virtual file system, called a
PackageVolume, which are stored in single files per volume underWindowsApps\MSIXVC. You can query the registry to see what Package Volumes exist, they're listed in the keyHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\PackageVolumes. Subkeys and nodes there give information about where the volume shows up as a directory in the file system. - We can query the
InstallLocationfor these apps with some Powershell commands:
Get-AppxPackage | Where-Object {$_.publisherid -eq "3275kfvn8vcwc" } | Select Name, InstallLocationqueries for all apps from Bethesda (3275kfvn8vcwc is their PublisherID).Get-AppxPackage | Where-Object {$_.name -Like "*SkyrimSE*" } |Select Name, InstallLocationqueries for all apps with a name containing "SkyrimSE" in it. We can use logical operators to combine this with the above if there are problems with non-Bethesda apps that have the game name in them (maybe mods on the windows store?).- In the registry under, well, many locations:
HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\PackageRepository\Packages\BethesdaSoftworks.SkyrimSE-PC_1.11.0.0_x64__3275kfvn8vcwcfor example.
- The location that is writable is the
ModifiableWindowsApps\{game folder}location. This again points into the virtual file system, so takes up no actual space in the real file system. However, editing/writing files will create actual files there (which override the ones in the virtual filesystem). We can find the Modifiable folder by determining the InstallLocation, then "going up" one directory and looking for a ModifiableWindowsApp directory, then finding the game directory in there.This actually doesn't work in all cases. See the wiki for the updated method.- Load order is stll in a
plugins.txt, but this edition looks for it in two locations:
%LOCALAPPDATA%\Skyrim Special Edition MS\Plugins.txt%LOCALAPPDATA%\Packages\BethesdaSoftworks.SkryimSE-PC_3275kfvn8vcwc\LocalCache\Local\Skyrim Special Edition MS
It seem that if the Packages one is not present, then the first is read in for Load Order, but then deleted/moved to the Packages directory. So we need to handle this case.
Other changes:
- The My Games folder is
My Games\Skyrim Special Edition MS - The Game folder is
Skyrim Special Edition (PC)
Note: different names, so we can't useGameInfo.fsNamefor both of these.
There are file permission issues involved: it's very hard to get write access to the top level of ModifiableWindowsApps, as well as WindowsApps (all of it). So we have to use (currently) as bash.ini to move the Skyrim Special Edition Mods folder out of those protected areas. The relavent ini entries are sOblivionMods, sBashModData, and sInstallersData.
OK, action items:
- Write the code that parses the registry to finds the installed
- Write the code that parses the registry to find the games' mutable locations
- Split
GameInfo.fsNameinto two attributes, one for the game folder, one for the my games folder - Write code to handle two possible
plugins.txtlocation: Read from Packages location first, fallback to the usual location. Always write to the Packages location. - Deal with Morrowind and Oblivion language variations: each language has a seperate install as a subfolder of the main install.
-
Figure out if we can use IFileOperation only for changing modification timeMaybe...IFileOperation seems a non-starter. We could instead move the file to a location on the same drive outside of the protected locations, modify the times, then move them back. This would be the most efficient IO wise, but is not atomic. The safer "atomic-like" operation would be to copy the file to a non-protected location, modify it, then move it into the game directory. I'm marking this one as a "put off til later" issue. We don't have a good non-admin way to modify times, and admin mode works. - The vanilla files need updating, SSE, FO4, Morrowind, and Oblivion ship all the files for all languages now (we should have done that before, poor non-English users :P)
- Implement a method to determine game version that does not rely on reading the EXE for the game (EXE files are non-accessible even for the mutable location). The easiest way will probably be to modify
WinStoreFinderto read in all possible information about a windows store app, the version is accessible in the registry. - Use the above version detection to implement
CompareGameVersionin Wizard scripts. - Use the above version detection to implement version detection in FOMOD scripts.
- Update the Readme with applicable information, and common errors/issues that can pop up when managing a WS game.