FreeEMS Issues - OLV
View Issue Details
0000718OLVGeneral Featurespublic2012-09-24 15:302013-01-23 06:54
Fred 
Fred 
highminorN/A
assignedopen 
AllAllAll
0.0.3-SNAPSHOT 
ASAP 
0000718: Determin correct home dir for settings on all platforms.
Linux and Mac work by default. Windows sort of works. Some versions of windows do not work. Here's why:

http://bugs.sun.com/view_bug.do?bug_id=4787931 [^]
http://stackoverflow.com/questions/2134338/java-user-home-is-being-set-to-userprofile-and-not-being-resolved [^]
http://www.timehat.com/javas-user-home-is-wrong-on-windows/ [^]

So required behaviour is "if winblows then check different value", not complex, but needs doing.
No tags attached.

Notes
(0002221)
Fred   
2012-09-24 18:11   
The guys are talking about this with respect to the loader and have agreed that the winblows variable %appdata% is correct for settings, and the correct format is %appdata%/settings/* for settings and %appdata%/xyz/ for other things, such as saved logs, ripped firmware, etc, etc.
(0002222)
BenFenner   
2012-09-24 18:17   
(edited on: 2012-11-29 15:53)
You always want to have a directory for your own application within %AppData% so like was mentioned it will be something like
%AppData%\appname\
%AppData%\appname\settings\
%AppData%\appname\logs\

etc.

(0002443)
BenFenner   
2012-11-29 15:52   
(edited on: 2012-11-29 15:53)
Settings that are not user settings, but are system-wide settings should be placed in:

%ProgramData%\appname\


This is for Windows XP/Vista/7.

(0002547)
Fred   
2013-01-21 23:34   
Ben, the logs in appdata thing is totally wrong/unacceptable. appdata is a fucking hidden folder. I'm guessing that you knew that? Or do you always run in admin mode and had forgotten?
(0002548)
BenFenner   
2013-01-22 01:53   
I always run in admin mode. But you can show hidden files without being in admin mode. A person with just user-level privileges could see them, possibly even those with "guest" privileges if that account is setup properly. That said, you're right that we can't expect everyone to be able to see hidden files, nor should we force them to do so just to get at the program logs?

The file locations described are for the program to use for itself, but something a regular user should never have to deal with or retrieve. If we want the logs to be accessible by any Tom/Dick/Harry (who apparently runs Windows in grandma mode) then we'll need to find a new place.

Files like that "belong" in "My Documents" but I shudder to think we'd be using that horrid place. And here's what Wikipedia has to say about that:
"there is no environment variable that refers to the location of the user's My Documents folder, so there is no standard method for setting a program's home directory to be the My Documents folder."

Now, doing some searching and there's this:
"Based on my quick internet and Windows search, there is no environment
variable for "My Documents". I have found that I can use
%UserProfie%\My Documents IF that folder hasn't been changed from it's
default location."

I don't feel that's appropriate either, since that's a poor impl right off the bat.

The path can be had from the registry...

"The My Documents path is stored in the following registry location.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User
Shell Folders

The value named "Personal" contains the full path to the My Documents
folder."

Maybe that helps?



I'm open to suggestions. We could always make something in the home/system drive. I've seen that done plenty of times. A bit ugly, but pretty foolproof if you put it in C:\OpenLogViewer\*
(0002549)
BenFenner   
2013-01-22 02:53   
By the way, "hidden" in Windows does not mean inaccessible. Even with the most restrictive of permissions, if you manually type in a directory or file address you can access it. Just FYI.
(0002551)
BenFenner   
2013-01-22 13:40   
You know, it's entirely possible that Windows is just happy to hide program info from you, including the logs of said program. I mean, they hide the installation directory too (in a different way) by default. Running Windows? You don't get to see program logs, unless you unhide files. Simple as that. That's how MS likes it. If the user doesn't like that, they can show hidden files, and then you're all set. I'm not sure we need or want to circumvent that.
(0002552)
Fred   
2013-01-22 13:41   
You've lost your mind. Log files from a tuning app == .xls and .doc files from M$ Office...
(0002561)
BenFenner   
2013-01-23 00:26   
Well then, you've misunderstood what I was saying when I put "%AppData%\appname\logs\" in my first post.

That was for internal app logs (errors, warnings, etc.)

Actual automotive datalogs are a completely different story. Do we need to determine a correct home directory for those? Because that's not what this issue is about, is it?
(0002563)
Fred   
2013-01-23 06:54   
"such as saved logs, ripped firmware, etc, etc." This issue became about all default dirs just before your first post. This explains the insanity though :-) it was really just confusion.