Settings problem on Windows 7

Settings problem on Windows 7

Postby juKay » Sun Jul 04, 2010 5:41 pm

I can't save any settings on Windows 7 since VC is trying to write them to "C:\Program Files (x86)\VoiceChatter", verified with Process Monitor, and ofc normal users don't have write permissions there. A workaround is to give users write permissions in that folder, or run the program as an admin, but those are really bad workarounds in the end.

I thought Windows 7/Vista would handle it by itself and instead try to write them to "C:\Users\USERNAME\AppData\Local\VirtualStore\Program Files (x86)\VoiceChatter" but that is not the case as it seems.

The best solution would be to write the *.conf files to "C:\Users\USERNAME\AppData\Local\VoiceChatter" instead.
juKay
 
Posts: 2
Joined: Sun Jul 04, 2010 5:08 pm

Re: Settings problem on Windows 7

Postby juKay » Mon Jul 05, 2010 5:02 am

After digging around the source code and some MSDN reading I have found out that the code need to be updated to support KNOWNFOLDERID (Windows Vista and Windows 7), CSIDL is still supported as legacy but should not be used.

The following constants have been changed:

CSIDL_APPDATA = FOLDERID_RoamingAppData
CSIDL_LOCAL_APPDATA = FOLDERID_LocalAppData
CSIDL_COMMON_APPDATA = FOLDERID_ProgramData
CSIDL_PROGRAM_FILES = FOLDERID_ProgramFiles

More about those changes here

The following function have been changed as well and need to be updated:
SHGetFolderPath = SHGetKnownFolderPath (manual).

These are all in version 6.0.6000 or later so it should be pretty easy to just check for that function first in ResolveShellFunctions() in "lib/wxWidgets/src/msw/stdpaths.cpp"

Also wouldn't a quick fix for it before having to update that code base be to change:

mConfig.SetConfigFile(wxStandardPaths::Get().GetDataDir().c_str(), "vchat.conf");
to
mConfig.SetConfigFile(wxStandardPaths::Get().GetUserLocalDataDir().c_str(), "vchat.conf");
in
VChat/Globals.cpp

and same thing for serverlist.conf?
juKay
 
Posts: 2
Joined: Sun Jul 04, 2010 5:08 pm

Re: Settings problem on Windows 7

Postby thantik » Fri Jul 09, 2010 6:00 pm

That's really strange, because UAC should be hooking the writes to the folder and redirecting them. It does so on my machine just fine. It may be something to do with 64bit vs 32bit; I'm running 32bit so I don't have the (x86) program files folder like you do.
thantik
 
Posts: 209
Joined: Sun Aug 30, 2009 7:22 pm
Location: Right behind you!


Return to Windows Client

Who is online

Users browsing this forum: No registered users and 1 guest