Thanks, Mats
So far I have been doing:
set shellFoldersKey \
{HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Explorer\User Shell Folders}
set appData [registry get $shellFoldersKey AppData]
I only got to run the program once in Vista RC2 but it didn't complain
and, so far, I haven't got any bug reports about it.
Andres
But I need a place to store the complete prefs file in a well defined
place, or alternatively, code to set & get a complete file
transparently with Tk option database syntax. I haven't seen any code
that does this. Shouldn't be that difficult to make, but better to get
some tested code.
/Mats
Well, you could store it in the registry.
--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
The $appData directory shown in the above code is where all applications
store their data. Create a subdirectory there for your application, and
put the file in it.
(There's actually an API call to get this information without groping
the registry, in case future versions of Windows store that info
elsewhere, but groping the registry is built into Tcl already. Also as
an aside, this is often something like C:\Documents and
Settings\Frank\Application Data. Take a look.)
I'm not sure what is the problem you have that isn't solved by this?
--
Darren New / San Diego, CA, USA (PST)
New horror show, now only in Las Vegas:
HANNIBAL LUXOR!
I didn't know that you could complete files in the registry.
Thanks for this tip. Will test it.
/Mats
I wasn't suggesting you put complete files in the registry. The
suggestion here is to look up in the registry where you should be
storing your files.
If you don't put them in the right place, bad things start to happen
when you get into more sophisticated situations. Either your
configuration overwrites someone else's, or when you log into a
different machine with the same account, your configuration doesn't
follow along.
One of my users sent in a screenshot of an error message they get on
Vista. The program in question is attempting to copy .dll's and
generate prefs files into the current working directory, but it's
throwing a "permission denied" error. I'm going to install Vista and
hopefully find a simple solution. I'll let you know if I find out
anything useful.
If the current working directory is under \Program Files, then that's
pretty much to be expected. Unless you have administrative permissions
(or, under Vista, maybe not even then), you can't just randomly write to
directories.
What's the CWD at that point in the program?