1. Application config file location

Forked from RedyCode - new features

ryanj said...
  • Application Config System makes it very easy to store user preferences, settings, etc. The toolbar settings and window positions are automatically stored in the application's default config file, which is automatically generated in the same folder as the app's exw/exe file.
sequence cmdline = command_line() 
sequence DefaultConfigFile = pathname(cmdline[2]) & "\\" & filebase(cmdline[2]) & ".cfg" 

The default behavior of redy's config file system assumes that the program has write access to it's own folder and works as a "portable" program. Is this a good practice?

What about cases where an application should be installed properly and needs to store config files in each user profile? How should a program know whether to store in it's own folder vs. the %APPDATA% folder?

new topic     » topic index » view message » categorize

2. Re: Application config file location

This SO article should help: Difference between Program Data and AppData

richik jaiswal said...

To put it straight, ProgramData contains application data that is not user specific.This data which will be available to all users on the computer. Any global data should be put in here.

AppData folder contains configuration settings, downloaded information/files for a particular user. So, for example any user specific preferences and profile configurations can be stored in the AppData folder. The AppData folder is further divided into three subfolders
Roaming - This folder contains data that can move with your user profile from a computer to another.
Local - This folder contains data that will not move with your user profile.

You can now decide depending on the type of information which would be the best place to store it.

Reference links: Windows CSIDL and AppData

The environment variables to use are as follows:

Variable Default Path
%APPDATA% C:\Users\username\AppData\Roaming
%LOCALAPPDATA% C:\Users\username\AppData\Local
%ProgramData% C:\ProgramData


new topic     » goto parent     » topic index » view message » categorize


Quick Links

User menu

Not signed in.

Misc Menu