A new idea for the windows registry and Longhorn
A good modification to a newer version of windows (Longhorn) would be to change the registry a bit. Instead of having all programs edit one main, central registry, and having tons and tons of values, never knowing for sure what pertains to what, you should break up the registry into separate files that then interact with a registry API. Each program would have its own registry file stored in the same directory where the program’s files are stored instead of just adding entries to a huge central registry.
For example, when a program is installed, all registry entries usually made in the windows registry for the settings of the program and any modifications it made to windows itself (like adding an entry into add/remove programs, adding a control panel icon, or adding a right click option like Winzip does, etc.) would instead be stored in a file. A file such as settings.reg would be created in the program’s directory.
One big advantage of this is that now you know exactly where to look for all the registry settings for a program. If the program is in C:\program files\prog, you know you can find all the possible registry entries the program uses in a registry file in that directory. In addition, you could actually entirely delete a program from just deleting the program’s directory, being sure that every program setting and all modifications made to windows were deleted, without the worry of affecting any other part of your system. The only thing that could be left is some old shortcuts, which windows could be triggered to search for automatically (just the job for an OFS). This would then be another way to uninstall programs in addition to the add/remove programs panel.
It is also great because if somehow, the registry for a program is corrupted and there are registry errors, it will be easy to pinpoint where the problem is. You will not have to worry about your whole registry breaking and possibly reinstalling windows. In addition, it would be very simple to copy a .reg file to make a quick backup and then make modifications to the programs .reg file. When editing one of these .reg files it would look very much similar to the present windows registry, except a mini version since it is only the entries for one program.
The way in which windows manages registry files can be very simple, windows would maintain a database of all the registry files on your computer and what programs and such they are for (perfect task for an OFS). You could actually check and uncheck from the database which registry files you want windows to load at startup! This would be excellent for troubleshooting purposes and determining if a piece of software is giving your computer trouble.
When the computer starts all the registry files that were selected to load would be loaded up into a “virtual main registry” in memory, if not memory then windows would just create a “virtual main registry” on the hard disk. If it were in memory, it would access much faster, but if it took up too much memory windows could just create one main registry on the hard disk. The point is that wherever this “virtual main registry” is, it would not be a standing one, meaning that it is perpetually rebuilt from many individual program .reg files, which the database says to load. This would happen every time your computer starts up and every time the “virtual main registry” is refreshed. It can be refreshed when a program installs, when the user does it manually, or when windows just does it on its own.
It is important for windows to have its own .reg file in the windows directory, say windows.reg. This registry file would contain only the basic settings the windows OS makes that pertain to the OS itself (i.e. appearance settings, maybe basic hardware settings too, etc). No other program’s settings would ever be allowed to be entered into this file. However, this does not mean that there could not be programs and power tools that tweak these windows settings to the user’s liking. It just means that all the settings for another program would be in its own .reg file in its directory.
Here is an example of how all this can work. Take the program Winzip. When you install it, along with all the files for the program, a .reg file, say settings.reg, would also be created in the program’s folder. In this settings.reg file, the necessary values would be present to tell the registry API to add an entry to the add\remove programs list, add a new option when you right click on a file to zip it up, etc. It would also contain all the settings for the program and when the program looked for any entries it needed, the API would direct it through the “virtual main registry”, either in memory or on the hard disk, to where it needs to look for its settings.reg entries. If you accessed the main database and unchecked this registry file, the next time your computer restarted or the “virtual main registry” was refreshed, none of the values from settings.reg would be loaded.
Of course, when modifying what registries to load in the database, and if you ever try to delete a registry file, windows will give all sorts of warnings and flashing red lights. For compatibility, the registry API could be programmed to deal with older programs attempting to make registry entries the old-fashioned way. It can make a .reg file for the program in the program’s directory on its own, with the proper entries the program needs. When the program tries to access entries the old way, the API can direct the program and trick it into thinking it is dealing with the traditional registry.
By default, registry files WOULD NOT automatically be loaded up into the “virtual main registry”. The database would know it was there but .reg files would have to be enabled, perhaps by right clicking on the .reg file to access the database and enable it. What this means is that just because you copied, created, or downloaded a .reg file, it will not automatically be loaded. If this were not the case, it is easy to see how this could be a problem. If a new program were being installed however, windows would be smart enough to enable the .reg file that is installed with the program.
This would much improve the way programs are stored and operate on your computer. This would also take advantage of the planned OFS. In addition, since a new file system is being developed, perhaps the C: drive letter idea should be taken out. That is kind of a legacy from MS-DOS and is not necessary. Just start drives with a root directory (i.e. main\...).
|