Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Windows registry keys

From: brian:hawley at: 16-Aug-2002 3:36

At 03:37 AM 8/16/02 +1000, you wrote:
>I am looking into the windows registry > >I wonder if other people have exactly the same >long path element as in below: > >HKEY_USERS\S-1-5-21-1614895754-688789844-1060284298-1000\Software\Rebol > >Are the numbers exactly the same?
That key is a user-specific key on WinNT or above. On those Windows you (when you have administrator access) can see the registry settings of all of the users installed on the your system. They are accessed through coded IDs under HKEY_USERS. One of those branches is ".DEFAULT", a placeholder for the settings that new users are created with. HKEY_CURRENT_USER is a shortcut for the branch associated with the user that is currently using the registry.
>I am interested in making a silent install for rebol.
Well, I for one would be very happy to see it. The current installer for REBOL/View is quite unfriendly to multi-user versions of Windows. That means every version in the NT line, including 2000 and XP in particular. This becomes more of a disadvantage with 2000 and XP. Fortunately the problem is easy to fix. A REBOL/View installation on Windows is currently single- user, since it stores all of its data files in the same directory as its program file. Since REBOL is generally installed in a central location, this means that security settings get in the way of using it. To run REBOL on Win2k you need to be a "Power User", on XP an Administrator. Any other setup can be a major security issue. This is also a factor in installing REBOL on Terminal Server or other true multi-user versions of Windows, like any version of XP. I'm afraid this is what they mean by "logo-compliance". REBOL doesn't need to be installed that way, though. The program file is so small that you can give one to each user, as long as you put it under the user's profile directory. Fortunately that isn't as difficult as it sounds. Once REBOL thinks it is installed the program file you are actually running doesn't have to be in the same directory as the data. As long as the data directory listed in HKEY_CURRENT_USER\Software\Rebol\View:HOME actually exists, REBOL will pop up the user settings dialog and download all of its data files there (yes, including a copy of rebol.exe that can go unused). Watch out though: If the data directory doesn't exist before REBOL tries to save the user preferences, REBOL will crash. I have notified Feedback of this. So a multi-user-clean install of REBOL would go like this: - Copy rebol.exe into a central location like C:\Program Files\REBOL You can get the actual Program Files directory from HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion in the "ProgramFilesDir" value. Create the REBOL dir if needed. - If you want file associations, you can create them like this: - Create HKEY_CLASSES_ROOT\.r - Under this set the default value to "REBOL.Script" (without the quotes), and the "Content Type" (without the quotes) value to "text/x-rebol" (without the quotes). - Create HKEY_CLASSES_ROOT\.r\ShellNew - Under this set the NullFile value to the empty string. - Create HKEY_CLASSES_ROOT\REBOL.Script - Under this set the default value to "REBOL Script" (without the quotes), and the EditFlags value to a REG_BINARY of 0. - Create HKEY_CLASSES_ROOT\REBOL.Script\DefaultIcon - Under this set the default value to the full path of the program file where you copied it earlier, with ",0" appended like this: C:\Program Files\REBOL\rebol.exe,0 - Create HKEY_CLASSES_ROOT\REBOL.Script\shell - Set its default value to View - Create HKEY_CLASSES_ROOT\REBOL.Script\shell\Edit - Set its default value to &Edit - Create HKEY_CLASSES_ROOT\REBOL.Script\shell\Edit\command - Set its default value to Notepad or some such, like this: C:\WINNT\system32\NOTEPAD.EXE %1 You should use the txtfile association if you can. - Create HKEY_CLASSES_ROOT\REBOL.Script\shell\Open - Set its default value to &Open - Create HKEY_CLASSES_ROOT\REBOL.Script\shell\Open\command - Set its default value to the same command as Edit. - Create HKEY_CLASSES_ROOT\REBOL.Script\shell\View - Set its default value to &View - Create HKEY_CLASSES_ROOT\REBOL.Script\shell\View\command - Set its default value to the command to open a file, like: "C:\Program Files\REBOL\rebol.exe" -q "%1" with the quotes this time. - Now for the user-specific settings, for every user, including the default. First do HKEY_CURRENT_USER then each user under HKEY_USERS. Win9x doesn't keep the user settings in keys like the one you mentioned above, just ".DEFAULT", so you should remember to do HKEY_CURRENT_USER first. I'll use <KEY> as a placeholder for HKEY_CURRENT_USER, HKEY_USERS\.DEFAULT, etc. For each user: - Create a "REBOL" directory under the AppData directory. You can get the AppData directory from <KEY>\Software\Microsoft\Windows\ CurrentVersion\Explorer\Shell Folders in the "AppData" value. If the user has a license, you can put it in the directory you created too. - Create <KEY>\Software\Rebol - Create <KEY>\Software\Rebol\Console - Create <KEY>\Software\Rebol\View - Under <KEY>\Software\Rebol\View, create values - HOME : The REBOL version of the AppData REBOL directory you created earlier, such as (on Win2k or above): /C/Documents and Settings/user/Application Data/REBOL/ - Product : The product and version, like "View" without the quotes. - Create a per-user program group and shortcut to the global REBOL program file in "C:\Program Files\REBOL" or whatever the directory turned out to be. While you're at it you can copy that shortcut to the user's desktop folder, which you can get from <KEY>\Software\Microsoft\Windows\ CurrentVersion\Explorer\Shell Folders in the "Desktop" value. Try not to overwrite per-user settings that may already exist, but go ahead and overwrite the global settings. Don't bother using REBOL/View's built in uninstaller as it is not multi-user friendly. If you want to provide a user-accessible uninstaller, go ahead, but just let it remove the per-user registry settings but not the files. If you want an uninstaller to completely clean all of the REBOL settings and program files, it's best to keep it to yourself. I hope this helped. Probably more information than you needed, but if not I'll rig up an Inno Setup script that will generate an installer that behaves as above and post it for you. Brian Hawley