|
-
Dec 21st, 2003, 01:50 AM
#1
Thread Starter
Hyperactive Member
Discussion: Registry vs. INI
Anybody want to contribute their thoughts? I'd like to see everyone's perspective on this.
-
Dec 21st, 2003, 04:47 AM
#2
Supreme User
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.
-
Dec 21st, 2003, 04:55 AM
#3
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.
-
Dec 21st, 2003, 05:09 AM
#4
Addicted Member
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.
-
Dec 21st, 2003, 05:18 AM
#5
Supreme User
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
-
Dec 21st, 2003, 05:25 AM
#6
Thread Starter
Hyperactive Member
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!
-
Dec 21st, 2003, 05:38 AM
#7
Addicted Member
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.
-
Dec 21st, 2003, 05:41 AM
#8
-
Dec 21st, 2003, 08:36 AM
#9
Fanatic Member
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
-
Dec 21st, 2003, 09:49 AM
#10
Frenzied Member
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".
-
Dec 21st, 2003, 11:29 AM
#11
Supreme User
Edit: I love to use the registy to pass values from one exe to another..
Was that to confuse him further more?
-
Dec 21st, 2003, 11:37 AM
#12
Using the registry just isn't the way to go.
-
Dec 21st, 2003, 11:47 AM
#13
Supreme User
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
-
Dec 21st, 2003, 02:40 PM
#14
Frenzied Member
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".
-
Dec 21st, 2003, 02:45 PM
#15
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
-
Dec 21st, 2003, 02:48 PM
#16
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
-
Dec 21st, 2003, 02:50 PM
#17
Frenzied Member
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".
-
Dec 21st, 2003, 02:51 PM
#18
-
Dec 21st, 2003, 02:52 PM
#19
Originally posted by Madboy
Isnt this the wrong place to post a discussion anyway?
Um...... yes someone mentioned this already
-
Dec 21st, 2003, 02:53 PM
#20
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
-
Dec 21st, 2003, 02:53 PM
#21
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Dec 21st, 2003, 03:01 PM
#22
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.
-
Dec 21st, 2003, 03:02 PM
#23
-
Dec 21st, 2003, 03:04 PM
#24
Frenzied Member
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".
-
Dec 21st, 2003, 03:06 PM
#25
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.
-
Dec 21st, 2003, 03:11 PM
#26
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)
-
Dec 21st, 2003, 09:19 PM
#27
Frenzied Member
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".
-
Dec 21st, 2003, 10:14 PM
#28
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|