zdoom -config zdoom.ini %*gzdoom -config zdoom.ini %*FString FGameConfigFile::GetConfigPath (bool tryProg)
{
const char *pathval;
FString path;
pathval = Args->CheckValue ("-config");
if (pathval != NULL)
{
return FString(pathval);
}
#ifdef _WIN32
path = NULL;
HRESULT hr;
TCHAR uname[UNLEN+1];
DWORD unamelen = countof(uname);
// Because people complained, try for a user-specific .ini in the program directory first.
// If that is not writeable, use the one in the home directory instead.
hr = GetUserName (uname, &unamelen);
if (SUCCEEDED(hr) && uname[0] != 0)
{
// Is it valid for a user name to have slashes?
// Check for them and substitute just in case.
char *probe = uname;
while (*probe != 0)
{
if (*probe == '\\' || *probe == '/')
*probe = '_';
++probe;
}
path = progdir;
path += "zdoom-";
path += uname;
path += ".ini";
if (tryProg)
{
if (!FileExists (path.GetChars()))
{
path = "";
}
}
else
{ // check if writeable
FILE *checker = fopen (path.GetChars(), "a");
if (checker == NULL)
{
path = "";
}
else
{
fclose (checker);
}
}
}
if (path.IsEmpty())
{
if (Args->CheckParm ("-cdrom"))
return CDROM_DIR "\\zdoom.ini";
path = progdir;
path += "zdoom.ini";
}
return path;
#elif defined(__APPLE__)
char cpath[PATH_MAX];
FSRef folder;
if (noErr == FSFindFolder(kUserDomain, kPreferencesFolderType, kCreateFolder, &folder) &&
noErr == FSRefMakePath(&folder, (UInt8*)cpath, PATH_MAX))
{
path = cpath;
path += "/zdoom.ini";
return path;
}
// Ungh.
return "zdoom.ini";
#else
return GetUserFile ("zdoom.ini");
#endif
}A simple "it doesn't work that way" would have sufficed.Remember how Graf Zahl wrote:No. It will always write to the user specific file.
Caligari_87 wrote:To the best of my knowledge, yes. It would require some mucking around in the file types box (something I've come to lothe), but it's possible.
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 3 guests