diff options
author | stanton <stanton@noemail.net> | 1998-07-24 15:38:57 (GMT) |
---|---|---|
committer | stanton <stanton@noemail.net> | 1998-07-24 15:38:57 (GMT) |
commit | 1e5ae6dd3e0ab4f928d602221cf8d006c727e59a (patch) | |
tree | 4d81b724174ed679775ba1ab918ed7fa6bce099e /win/tclWinInit.c | |
parent | 72396eafee3cb34e2718ca630002b42fec2c6fc9 (diff) | |
download | tcl-1e5ae6dd3e0ab4f928d602221cf8d006c727e59a.zip tcl-1e5ae6dd3e0ab4f928d602221cf8d006c727e59a.tar.gz tcl-1e5ae6dd3e0ab4f928d602221cf8d006c727e59a.tar.bz2 |
changed to use default value instead of "Root"
changed to set tclDefaultLibrary instead of tcl_library
FossilOrigin-Name: 3e7affd2de0b183dc3fdf9cb7ca0744904c454c0
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r-- | win/tclWinInit.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 0610ef6..a86108f 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -18,6 +18,15 @@ #include <winbase.h> /* + * The following macro can be defined at compile time to specify + * an alternate registry key for the default Tcl library path. + */ + +#ifndef TCL_REGISTRY_KEY +#define TCL_REGISTRY_KEY "Software\\Scriptics\\Tcl\\" TCL_VERSION +#endif + +/* * The following declaration is a workaround for some Microsoft brain damage. * The SYSTEM_INFO structure is different in various releases, even though the * layout is the same. So we overlay our own structure on top of it so we @@ -135,30 +144,29 @@ TclPlatformInit(interp) */ if (!isWin32s) { - if ((RegOpenKeyEx(HKEY_LOCAL_MACHINE, - "Software\\Sun\\Tcl\\" TCL_VERSION, 0, KEY_READ, &key) - == ERROR_SUCCESS) - && (RegQueryValueEx(key, "Root", NULL, NULL, NULL, &size) - == ERROR_SUCCESS)) { + if ((RegOpenKeyEx(HKEY_LOCAL_MACHINE, TCL_REGISTRY_KEY, 0, + KEY_READ, &key) == ERROR_SUCCESS) + && (RegQueryValueEx(key, "", NULL, NULL, NULL, &size) + == ERROR_SUCCESS)) { Tcl_DStringSetLength(&ds, size); - RegQueryValueEx(key, "Root", NULL, NULL, + RegQueryValueEx(key, "", NULL, NULL, (LPBYTE)Tcl_DStringValue(&ds), &size); } } else { - if ((RegOpenKeyEx(HKEY_CLASSES_ROOT, - "Software\\Sun\\Tcl\\" TCL_VERSION, 0, KEY_READ, &key) - == ERROR_SUCCESS) + if ((RegOpenKeyEx(HKEY_CLASSES_ROOT, TCL_REGISTRY_KEY, 0, + KEY_READ, &key) == ERROR_SUCCESS) && (RegQueryValueEx(key, "", NULL, NULL, NULL, &size) - == ERROR_SUCCESS)) { + == ERROR_SUCCESS)) { Tcl_DStringSetLength(&ds, size); RegQueryValueEx(key, "", NULL, NULL, (LPBYTE) Tcl_DStringValue(&ds), &size); } } - Tcl_SetVar(interp, "tcl_library", Tcl_DStringValue(&ds), TCL_GLOBAL_ONLY); + Tcl_SetVar(interp, "tclDefaultLibrary", Tcl_DStringValue(&ds), + TCL_GLOBAL_ONLY); if (Tcl_DStringLength(&ds) > 0) { char *argv[3]; - argv[0] = Tcl_GetVar(interp, "tcl_library", TCL_GLOBAL_ONLY); + argv[0] = Tcl_GetVar(interp, "tclDefaultLibrary", TCL_GLOBAL_ONLY); argv[1] = "lib"; argv[2] = NULL; Tcl_DStringSetLength(&ds, 0); @@ -166,7 +174,7 @@ TclPlatformInit(interp) TCL_GLOBAL_ONLY|TCL_LIST_ELEMENT); argv[1] = "lib/tcl" TCL_VERSION; Tcl_DStringSetLength(&ds, 0); - Tcl_SetVar(interp, "tcl_library", Tcl_JoinPath(2, argv, &ds), + Tcl_SetVar(interp, "tclDefaultLibrary", Tcl_JoinPath(2, argv, &ds), TCL_GLOBAL_ONLY); } |