Hello,
You are always welome!
Glad my explanation was helpful!
Question: What is the point of putting the readonly XML files into the ProgramData folder? Is that supposed to be a best practice? Why? Why can't they be located in the same folder structure as for MSIX? (I find the MSIX way of doing things more convenient anyway).
Regarding your new question, well, MSIX and MSI are quite different.
For instance, MSIX is installed by default in the following location:
This is a system location that Windows Explorer does not have access to by default (e.g. you can not open it in the UI).
An MSIX is installed, by default, only for the user that performs the installation (i.e. it will not be available to other users from the same machine unless you use a specific PowerShell cmdlet).
On the other hand, the MSI can be installed, by default, for both per-user or per-machine.
ProgramData is per-machine and is not easily writeable - needs admin permissions at installation time.
A little correction here. It is indeed a per-machine location, but not one that requires admin privileges - it is quite special in that way.
Now, to come back to your question, I believe we can already see why it is used to store the application settings files. Say we have an application that you installed for all users. If that application needs to access a settings file that is in the Program Files folder and the user does not have admin privileges, it will ask for the administrator credentials. On the other hand, if the files are in the ProgramData folder, it should not.
However, this is more like a corner case to be honest. Even Microsoft does not recommend using the
ProgramData folder:
Warning We don’t recommend using this setting, except perhaps in a test environment. The following are known issues
With that being said, I think you should be just fine placing your files in a subfolder in the installation folder (Program Files).
Hope things are clearer now!
Best regards,
Catalin