Results 1 to 28 of 28

Thread: Discussion: Registry vs. INI

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington, DC
    Posts
    422

    Discussion: Registry vs. INI

    Anybody want to contribute their thoughts? I'd like to see everyone's perspective on this.

  2. #2
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    This should be in chit chat, but...

    Personally ini. It saves the ini file in the path of your program and can be deleted easily when coming to un-installing.

    Registry however is good as it easy to use GetSetting and SaveSetting. Only problem is make sure you dont delete any thing else, dont want it becoming corrupt. Bad thing about it is, if your app doesnt have an un-installer it can be a pain removing the registry keys.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    With the registry, you have the advantage that each user of the computer can have his or her own settings. But the easier thing about INI files is that an advanced user can just open the damn thing up in notepad, and edit it. Or if you're supporting your software at a later point in time and the user runs into trouble, they just send you the contents of the INI file.

    If there were a vote, I'd vote for a text file (or INI file, whatever).

    But I've also heard that Win32 apps are supposed to work with the registry instead of INIs.

    Hope I've confused you enough.

  4. #4
    Addicted Member imbue's Avatar
    Join Date
    Aug 2002
    Location
    Midwest USA
    Posts
    155
    I would say the storing stuff in the registry is easier to program. Storing stuff in an INI file is probably easier to upkeep and easier for the end user. Also if the end user ever wants to install the program on a new computer and transfer the settings then INI is a lot better.

    I have heard that Microsoft says not to use the registry for important information because it could become corrupted. Now you should be even more confused.

  5. #5
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    Value:
    Corrup
    Defined:
    Corruption, to become unstable, high risk of data loss,computer may require formatting, chance of restoring a corrupt registry - approximately 15% integer chance. Though id probably win the lottery before restoring my registry.
    Advice
    Back up your registry before dealing with it, most importantly know how the hell to restore it

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington, DC
    Posts
    422
    I personally like using INI better than registry. I've got an app that is about read to ship, and I just wanted to hear everyone's own experience with their pros and cons. Keep discussing!

  7. #7
    Addicted Member imbue's Avatar
    Join Date
    Aug 2002
    Location
    Midwest USA
    Posts
    155
    Originally posted by Madboy
    Though id probably win the lottery before restoring my registry.
    Heh, I've restored two backups in the last year. Both times Windows couldn't load and the corruption was caused by malware.

  8. #8
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    well, sometimes its better to just have a clean refresh. Though, if you have data that is not backed up, quickly make sure you can back it up. Actually formatting is often worse than restoring a registry. It took me a day before to work out that a wire was slightly loose on my graphics, and i was looking forever to see if the drivers were installed correctly

  9. #9
    Fanatic Member laserman's Avatar
    Join Date
    Jan 2002
    Location
    Wales U.K
    Posts
    775
    Use INI first. As mentioned you change the Registry which is easily done if not vey experienced and your in some trouble


    There are many INI examples but if you also look for GET settings under Martin Liss signature it will show you how to do it that way also.

    I would try a few small INI examples first though until your are happy.

    Cheers

  10. #10
    Frenzied Member RudyL's Avatar
    Join Date
    Mar 2001
    Location
    Chicago
    Posts
    1,519
    I use both of them..

    I try to put the very program specific stuff in the registry, and stuff like encrypted passwords..

    I then use INI files for everyting and anything that will have a setting... Especiall is there is a lot..

    Although I do use the registy for this one program, but it only has a few things to store and didn't want to deal with an INI file for it...

    Now if that doesn't confuse you I don't know what will

    Edit: I love to use the registy to pass values from one exe to another..
    10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".

  11. #11
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    Edit: I love to use the registy to pass values from one exe to another..

    Was that to confuse him further more?

  12. #12
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Using the registry just isn't the way to go.

  13. #13
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    I agree kasracer, its usually ini for me. But if i want to lock the data in the ini go for something like dat. dat is just a file with an extension you make. Well its not even an extension, just a filename with a.dot on the end.

    So, yeah, Ini rules

  14. #14
    Frenzied Member RudyL's Avatar
    Join Date
    Mar 2001
    Location
    Chicago
    Posts
    1,519
    Originally posted by Madboy
    Edit: I love to use the registy to pass values from one exe to another..

    Was that to confuse him further more?
    No.. I really do use the registry that way.. Example.

    One main program manages 2 other programs. Those two programs ask the main for permission to do things. All of the communication is done in the registry.
    10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".

  15. #15
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by RudyL
    No.. I really do use the registry that way.. Example.

    One main program manages 2 other programs. Those two programs ask the main for permission to do things. All of the communication is done in the registry.
    Ewww that is fairly inefficient.

    Program Child A writes 3 values in registry, Program Child B writes 2 entries in the registry. Program main checks entries and then writes 5 entries to the registry. Program Child A checks registry and reads 3 lines, Program Child B checks and reads 2 lines.

    not only is that inefficient, but you also just made a mess of my registry

    ini should always be used over registry. Some people like to take their settings with them, not hunt them down in the registry just to use them on another computer. Also, the settings should NOT be hidden from the user.

    Mainly just my opinion, but I really really loath applications that mess with my registry

  16. #16
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Correct me if I'm wrong (please), but I don't think you can control ini files with permissions the way you can with registry keys. That's one plus in my opinion.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  17. #17
    Frenzied Member RudyL's Avatar
    Join Date
    Mar 2001
    Location
    Chicago
    Posts
    1,519
    That is the main reason we use the registry for program communication. Other wise I would have to create a lock file everytime I access the INI, then destroy it afterwards... Way to much overhead.. And way to inefficient..
    10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".

  18. #18
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    Isnt this the wrong place to post a discussion anyway?

  19. #19
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by Madboy
    Isnt this the wrong place to post a discussion anyway?
    Um...... yes someone mentioned this already

  20. #20
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Originally posted by RudyL
    That is the main reason we use the registry for program communication. Other wise I would have to create a lock file everytime I access the INI, then destroy it afterwards... Way to much overhead.. And way to inefficient..
    I think kas is implying that either way would be inefficient in that scenario. I would look into sending custom messages between the apps over registry or ini "communication".
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  21. #21
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Originally posted by Madboy
    Isnt this the wrong place to post a discussion anyway?
    Someone will be along to move it to chit chat if they fell its necessary.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  22. #22
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by RudyL
    That is the main reason we use the registry for program communication. Other wise I would have to create a lock file everytime I access the INI, then destroy it afterwards... Way to much overhead.. And way to inefficient..
    Like said, neither would be efficient in that situation. I feel that the program shouldn't be hidden from the user, lock files are a waste.

  23. #23
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    I though you were a moderator cryptcblade

  24. #24
    Frenzied Member RudyL's Avatar
    Join Date
    Mar 2001
    Location
    Chicago
    Posts
    1,519
    Originally posted by kasracer
    Like said, neither would be efficient in that situation. I feel that the program shouldn't be hidden from the user, lock files are a waste.
    Nothing is hidden.. They are running the main program. THe other mini programs are done that way so that, one it easily managed (Code that is), and 2, we can more easily upgrade things with out having to upgrade everything.. I guess one could say that we should have used DLL's instead of EXE's..
    10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".

  25. #25
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by crptcblade
    I would look into sending custom messages between the apps over registry or ini "communication".
    Neither are a good idea because either way, you are accessing the hard drive. INI file should be quicker than registry communication because the registry is stored differently than most files so whatever you put in isn't simply written to a file, it is specially formatted and written.

    There are better alternatives than writting to the hard drive for cross-program communication.

  26. #26
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by RudyL
    Nothing is hidden..
    Make up your mind. You were talking about using "lock files". I would assume you were writting the message to a file and encrpyting it, then reading it and deleting it.

    If nothing is hidden from the user, just throw it into a text file and then delete it when you're done (if you must communicate in this manner)

  27. #27
    Frenzied Member RudyL's Avatar
    Join Date
    Mar 2001
    Location
    Chicago
    Posts
    1,519
    Originally posted by kasracer
    Make up your mind. You were talking about using "lock files". I would assume you were writting the message to a file and encrpyting it, then reading it and deleting it.

    If nothing is hidden from the user, just throw it into a text file and then delete it when you're done (if you must communicate in this manner)
    NO.. Th elock file was so that if one program was trying to get info, but the lock file was present it knew to wait so that it would have accurate info.... I encrypt password/user info, thats all I said..

    I could use a text file, but that would be the same as an INI, or DAT, or any other text file.. I stil need to create a lock file.. Time consuming.. and in efficient.. The registry wsa the best way we could come up with..
    10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".

  28. #28
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by RudyL
    I could use a text file, but that would be the same as an INI, or DAT, or any other text file.. I stil need to create a lock file.. Time consuming.. and in efficient.. The registry wsa the best way we could come up with..
    You do realize that the registry would be slower and even more inefficient than a simple text file, right? Also, why are you even making a "lock file"? It is pointless, just add a simple key to the text file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width