Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config files are being hard coded to local appdata not common appdata #39

Open
gclarke42 opened this issue Apr 26, 2021 · 1 comment
Open

Comments

@gclarke42
Copy link

It seems like the only way to configure this server for multiple users is to copy over the config files for every user to %user/local.
Could you add a check to see if there are config files in CSIDL_COMMON_APPDATA (often C:\programdata\ in win10) and then if there is no config present check local user for the files. This allows for a common config regardless of the user and allows for a cleaner installation on systems with active directly or other such login schemes.

@gclarke42
Copy link
Author

Something sort of like this would probably do the trick. FYI Not tested just imagined.

if( SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA | CSIDL_FLAG_CREATE,
NULL, SHGFP_TYPE_CURRENT, str) == S_OK )
{
WorkDir = IncludeTrailingPathDelimiter(str) + "visualsyslog\";
if( ! DirectoryExists(WorkDir) )
if( SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA | CSIDL_FLAG_CREATE,
NULL, SHGFP_TYPE_CURRENT, str) == S_OK )
{
WorkDir = IncludeTrailingPathDelimiter(str) + "visualsyslog\";
if( ! DirectoryExists(WorkDir) )
if( ! CreateDir(WorkDir) )
ReportError2("Error creating directory: "%s"", WorkDir.c_str());
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant