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

system/options/home on Windows /Core 2.5.6

 [1/5] from: brian:hawley at: 12-Aug-2003 13:08


Hey all, I already sent this to Feedback, but maybe some of you can figure this out: <feedback> Depending on the answer, this could be a documentation question or a bug fix request. What is the actual search process for %rebol.r and %user.r, what is the default setting for system/options/home and how do you change it (REBOL_HOME doesn't work)? Your Changes doc says the order of search is current dir first, then system/options/home. Your Setup doc says current then the dir of the executable. If both are true then this implies that system/options/home is by default the dir of the executable (this would be great) but my tests show it to be set to the current directory instead. If possible, please fix REBOL to match the docs (make system/options/home by default the dir of the executable) as that behavior is much better than its current behavior. It would be preferable to perform the search separately for each file so as to be able to put %rebol.r and %user.r in different dirs for both global and local settings. </feedback> Now the problem of changing the default for system/options/home before %rebol.r and %user.r are run is a difficult one if the REBOL_HOME environment variable is ignored. You can't pass it in a --do parameter because that is now evaluated after those two files are. I don't see much of a workaround other than hard-coding a settings directory in every script and then clicking Yes to a lot of security questions. Am I wrong? This situation arose because I was trying to test whether using a slightly different method of searching for the startup files included searching for each of them separately, an enhancement request I've repeatedly made in various forms for a few years now. This feature would make multi-user use of REBOL much easier, allowing global configuration to be in a central location while having local configuration in a user-specific directory (user profile, home directory, etc). As this affects security on multi-user systems, I think that this is a big deal. What do you all think? Brian Hawley

 [2/5] from: carl:rebol at: 12-Aug-2003 13:47


System/options/home is set according to the first of these that succeeds: 1. Windows registry (in view, link) 2. HOME envr variable 3. Current directory at boot (but may be different than exe dir) Linux/Unix systems often set HOME to the home dir of the user, so multi-user systems will work fine with a single REBOL exe. Each user can have their own user.r files. However, perhaps the problem would be that REBOL.r also uses the same paths, where it might be good to add a check for it in the exe directory first. Which the user may not be able to write, thus you can force specific startup for all REBOL users. Is that what you are suggesting? -Carl

 [3/5] from: maximo:meteorstudios at: 13-Aug-2003 14:26


> -----Original Message----- > From: The master crafter (carl.S) > Sent: Tuesday, August 12, 2003 4:48 PM
[...]
> > However, perhaps the problem would be that REBOL.r also uses > the same paths, where it might be good to add a check for it in the > exe directory first. Which the user may not be able to write, thus you > can force specific startup for all REBOL users.
yess this would be nice! -max

 [4/5] from: carl:rebol at: 13-Aug-2003 18:21


Regarding system/options/home... I've updated the CORE docs to do a better job at explaining the HOME variable, especially with regard to setup. You are correct, the docs were out of date on that issue. -Carl PS: We'll update the .zip file later today when we get a chance.

 [5/5] from: brian:hawley at: 15-Aug-2003 13:53


At 01:47 PM 8/12/03 -0700, [carl--rebol--com] wrote:
>System/options/home is set according to the first of these >that succeeds:
<<quoted lines omitted: 4>>
>so multi-user systems will work fine with a single REBOL exe. >Each user can have their own user.r files.
Sounds great! With Windows, things are clearly not that simple. When Windows is set up as a multi-user system (all the time on the NT platform, optional on 9x) the equivalent to HOME is the user profile directory. NT generates an automatic environment variable USERPROFILE to get at this directory; 9x doesn't make it that easy. Applications like REBOL usually store their data in an app-specific subdirectory of "Application Data", a place accessible on all versions of Windows. This directory can be discovered in the registry value "AppData" in the key: HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders On NT this value is also accessible from the environment in the variable APPDATA. Looking all that up on every REBOL startup seems a bit much. If you would change startup at all, I would suggest that you have the environment lookup for the user home directory (to put in system/user/home) check for USERPROFILE if the check for HOME fails. That's what many other programs that use Unix- like settings on Windows do, such as Java and the GIMP. The View install should definitely put its data in the %AppData%\REBOL\View directory by default though - but use the registry value for portability. The only trick is to remember to install only one copy of the View exe in some central directory (like C:\Program Files\REBOL\View) for file association purposes, separate from the user's data, and make the Add/Remove Programs uninstaller deal only with the program and associations. The uninstaller in the View interface should just remove the user settings in the registry, leaving the global settings alone. That's how I'd do it anyway. And will for you if you send me a copy of the installer code - I've some free time but no SDK to check myself for said code. I'd be willing to follow the SDK license restrictions on such code if you like, so there should be no worries for you. Just offering.
>However, perhaps the problem would be that REBOL.r also uses >the same paths, where it might be good to add a check for it in the >exe directory first. Which the user may not be able to write, thus you >can force specific startup for all REBOL users. > >Is that what you are suggesting?
Basically, yes. On Unix there are global settings directories that can be used for such purposes, but on Windows these global settings are generally in the program directory, the Common AppData directory, the WINDOWS directory or the registry. The program directory seems to be the most workable for REBOL in a cross-platform way. By the way, this is what I meant when I did that huge feedback about Windows logo compliance back on 20-Sep-2000, #4412 at the time.
>-Carl
Thanks for the answer, Carl! Brian Hawley

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted