Are there actually any Windows PC's set up to deny access to the HKEY_CURRENT_USER branch of the registry?
AGS doesn't try to write to the LOCAL_MACHINE key, and CURRENT_USER should always succeed, unless the sysadmin has gone crazy with their permission restrictions...
:o That is not the reason for writing this code change.
The idea is that if you are working from a USB drive, removable harddisk, etc., the user settings, i.e. Recent games list, image editor, etc. may not always be available if the settings are read from HKEY_CURRENT_USER branch of the registry, as the data will reside on the machine and not on the removable drive.
If, on the other hand, the settings are stored on the removable device itself, then it does away with the need to set up the editor preferences if you plug your removable drive into a different machine. Also, the code change is such that paths on the removable drive can be reconstructed whenever required.
For example, let us say that when the Portable (no install) version is run for the first time, there will be no settings.xml, and the editor will start with the default settings. Now the user configures the editor as required. Also, most of the times, the image editor and games folders will also reside on the removable drive.
While saving the settings, the drive letter (along with the colon) will be replaced with a placeholder, and while reading,
it will be replaced with the drive letter which Windows has assigned to the removable drive, thus ensuring that the paths stay valid on any machine.
To make this point more clearer, please take a look at the below example, given in more detail (this is also briefly explained in the Readme available in the download archive):
Let drive letter of the removable drive is say J:.
User is running the editor for the first time. The preferences are entered and the game folder is J:\Projects\TheGame. The image editor path is J:\editors\imageedit.exe.
When the preferences are saved, the paths will be saved as {*_XMLRegistry_Drive_Replacement_String_*}\Projects\TheGame and {*_XMLRegistry_Drive_Replacement_String_*}\editors\imageedit.exe respectively.
Now suppose a different machine is used the next time, and Windows assigns K: as the drive letter to the removable drive. Then while reading from the XML, {*_XMLRegistry_Drive_Replacement_String_*} will be replaced by K:, resulting in paths which are valid on the new machine. This means that the editor will show the game folder in the 'Continue a recently edited game' dialog, as well as launch the image editor when the user wants to edit any sprites from within the editor.
Both these things cannot be possible if the settings are stored in the Windows registry under HKEY_CURRENT_USER. Also, even if the removable drive is plugged into the same machine always, there is no guarantee that it will be assigned the same drive letter all the times (e.g. a new hard disk was added, and hence the letter earlier assigned to the drive is now used for a hard disk partition, or multiple USB drives are plugged into the machine, etc.).