Re: Registry verses INI




"Brian" <bkstigler@xxxxxxx> wrote in message news:%23pLAx2w8GHA.4288@xxxxxxxxxxxxxxxxxxxxxxx
I've seen various post suggest that an INI file is preferred to using the registry for saving application configuration data. My question is this... If a user doesn't have admin rights on the PC, where is the best place to store the INI file?

With the registry, I can tell the app to write to the HKEY_CURRENT_USERS area. So wouldn't this be a better place to store configuration data when a user has limited rights?

Just trying to get some clarification on this issue before driving down one path or the other. The data I need to store isn't too extensive... just a handful of items and parameters.


There's no cut and dry answer to that. Blame Microsoft for changing "standards" and not even following their own "suggested standard". When Win95 first came out, MS said "Don't use INI files anymore. Use the Registry". 11 years later, Microsoft STILL uses INI files an awful lot.

Bottom line is that it's up to you. Many people are against using the Registry because it just bloats it. Other programmers prefer one or the other for various reasons....and some use both depending on the circumstances.

If you use an INI file, though, you do have to be careful about where you write it. If you use the Win32API functions for writing INI files, I *believe* write permissions are inherent. But don't quote me on that. Personally, I'm one of those that sometimes uses INI files and sometimes uses the Registry. When I use INI files, I either write them to that user's Application Data folder or the "All Users" Application Data folder(depending on whether the saved settings should apply to all users or just that user). To get the path to either folder, use the SHGetSpecialFolderPath Win32 API function.


--
Mike
Microsoft MVP Visual Basic

.



Relevant Pages

  • Re: Registry verses INI
    ... With the registry, I can tell the app to write to the HKEY_CURRENT_USERS ... So wouldn't this be a better place to store configuration data ... Blame Microsoft for changing ... MS said "Don't use INI files anymore. ...
    (microsoft.public.vb.general.discussion)
  • Re: Best Programming Practice?
    ... correctly it shouldn't matter if it's registry, ini, xml or whatever. ... Storing preferences in files does not necessarily equal ini files. ... "new and improved" version of ini files are XML files. ... Paged Pool memory use under windows 2000. ...
    (microsoft.public.windows.terminal_services)
  • Re: .ini .dat or registry question
    ... > Which is better used to store 2 or 3 simple program settings, an ini file, dat file or the registry. ... implementing this with INI files is possible but not as clean. ... you should be fairly restrained about what and how much information you do store in the registry - there ...
    (microsoft.public.vb.winapi)
  • Re: Registry vs .ini Win 2000
    ... * Faster access ... Registry can hold anything (just keep the size down ... * Allows complete removal of settings, porting, network distribution ... ini files with different syntax) ...
    (microsoft.public.win2000.registry)
  • Re: change system boot drive letter E to C ?
    ... it (that you could find by researching) - but anyone with experience in this ... The subst will work in most cases, but some applications will still know the ... Option 3 - use the methods of searching the registry and ini files to change ...
    (microsoft.public.windowsxp.setup_deployment)