Settings files in User's Profile

A private forum for us Super-Humans, I even trust you to be able to edit your own posts =)

Moderator: Moderators

Locked
yilard
Posts: 66
Joined: 2003-01-11 06:04
Location: Slovakia

Settings files in User's Profile

Post by yilard » 2003-04-06 06:30

I hate having any user editable files in "Program Files" folder. Having multiple instance of DC++ install directory for each user seems to be quite stupid as well.

So I have made little tweak that make DC++ to store DCPlusPlus.xml, ADLSearch.xml, Favorites.xml, Queue.xml and exceptioninfo.txt in "/DC++/" subdirectory of particular user's "Application Data" directory.

The Logs, Filelists and Downloads folders also default to subfolder of an "Application Data/Dc++/*". I'm currently testing it and seems to be working well. As a side effect this will make hub passwords and addresses secret which is also good thing (In WinNT only of course).

Would you like to see it in official release or find it unnecessary?? I can think of only one drawback, that such a change can trigger whole bunch of lame "I can't connect. Help me!"-style queries in the forum. Although I made it at least a bit lamer friendly as it tries to copy existing config files from program files directory, if it can't find particular file in user's profile.
In the age of super-boredom/hype and mediocrity/celebrate relentlessness/menace to society --KMFDM

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2003-04-06 07:45

I think this has some merit. Someon else requested this on the RFE tracker, too, so you're not alone.

I voiced my only concern there: what about Win9x? I know there is a way to set it up for multiple users (though few DC++ users probably know how), so can the settings-in-profile code work on that platform as well?

yilard
Posts: 66
Joined: 2003-01-11 06:04
Location: Slovakia

Post by yilard » 2003-04-06 08:01

GargoyleMT wrote: I voiced my only concern there: what about Win9x? I know there is a way to set it up for multiple users (though few DC++ users probably know how), so can the settings-in-profile code work on that platform as well?
I have already tested DC++ with this modification this in Win98SE. It seems it has "Application Data" folder under C:\Windows folder. However there is only one such profile globally for system, but it is transparent and the same code works as in Windows NT and higher.

I would like to ask how to setup W9x to work with multiple users (aside from network server login)? So I can check that. I didn't used W9x for 5 years. Please just PM me.
In the age of super-boredom/hype and mediocrity/celebrate relentlessness/menace to society --KMFDM

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-04-06 08:06

%APPDATA% is empty on 9x I think.
that should give dc++ a clue wether or not to move the files.

and although I like the idea,
I would also like an option to disable it.
personally (I don't think it's the best way, but it works) I install all programs that don't need registry settings and files in different places on one drive, so a format/reinstall relieves me of any worries about those applications.
so.. I don't think I will use the feature until "G:\Documents and Settings" is called /home ;)
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

yilard
Posts: 66
Joined: 2003-01-11 06:04
Location: Slovakia

Post by yilard » 2003-04-06 08:10

Sedulus wrote:%APPDATA% is empty on 9x I think.
that should give dc++ a clue wether or not to move the files.
The API function I use to obtain APP_DATA folder returns "C:\Windows\Application Data" in Win98 SE (I used no user profiles so far)... I think it will work everywhere where there is at least internet explorer 4.0 installed (according to msdn).
In the age of super-boredom/hype and mediocrity/celebrate relentlessness/menace to society --KMFDM

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-04-06 08:16

uh.. that's possible. but I don't think it is a nice idea to put stuff in directories people don't know existed.

i.e. if there is no %APPDATA%, I guess there are no/only-a-few programs that will use it. and anything in the WINDOWS dir is highly likely to be removed in the monthly j/k win9x reinstall. in these circumstances I think it'd be best to leave the files where they are now.

nt users are hopefully aware enough of their Appdata dir to back them up when necessary. but 9x users... I don't think so.
[edit](especially if they need an API function to find their Appdata dir ;) )[/edit]
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

yilard
Posts: 66
Joined: 2003-01-11 06:04
Location: Slovakia

Post by yilard » 2003-04-06 08:18

Ahh I see some comand line switch would be handy to disable this feature. I'm a bit afraid of additional bloat introduced by using command line parser (I hope there is something like getopt)... It can be useful for other things also (e.g. switch for overriding autoconnect).

But as far as I know lame users the best solution would be to completely turn off this feature in Win9X.
In the age of super-boredom/hype and mediocrity/celebrate relentlessness/menace to society --KMFDM

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-04-06 08:25

hm.. no need for the command line..
just have those that don't want it add an <DisablePerProfileConfiguration>1</DisablePerProfileConfiguration> to the xml.

and.. it'd be nice if the feature was disabled by default for debug builds.
Last edited by Sedulus on 2003-04-06 08:25, edited 1 time in total.
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2003-04-06 08:25

How exactly would we turn this feature off? Registry setting? A mini-DCPlusPlus.xml setting?

My first reaction was that it should be an option, but I think that more and more applications are going to this method of storing user settings (was there a best practice UI dictate by Microsoft?), and I don't see it as a change for the worse (I'm not change resistant).

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-04-06 08:41

forgive me for not elaborating on that,
it's a bit ugly unfortunately,
but I thought something along the lines of.
- look for dcpluplus.xml in ./
- does it have the disable option? yes->done
- else, look for *.xml in appdata. exists->use it, else, copy from old location
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

cologic
Programmer
Posts: 337
Joined: 2003-01-06 13:32
Contact:

Post by cologic » 2003-04-07 08:48

I like the idea... Just as long as it lets one run multiple copies of DC++ within the same profile, but Sedulus's search order allows for that.

Locked