Jump to content

Regedit vs. Ini


Recommended Posts

  • Moderators

Normally, I wont run a program here that has a reg- command in it

8)

Must suck trying to boot up windows then :whistle: J/K

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I think when you have a "serious" program you might want to use the registry... however

for small tasks, info list etc, i would use an ini file

Normally, I wont run a program here that has a reg- command in it

8)

Ok thanks, I've been trying to learn some ways to keep a user from screwing up your program, and if you have an ini file just sitting there it's pretty easy to mess up...

Another question, why wouldn't you run a program with a reg command? From what I understand you can screw up your computer pretty bad if you delete some of those keys, would that be your reason?

Well, thanks for the reply...

Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • Moderators

Ok thanks, I've been trying to learn some ways to keep a user from screwing up your program, and if you have an ini file just sitting there it's pretty easy to mess up...

Another question, why wouldn't you run a program with a reg command? From what I understand you can screw up your computer pretty bad if you delete some of those keys, would that be your reason?

Well, thanks for the reply...

Well... I'm assuming you are thinking registry, because it isn't a file just sitting there, and people are nearly threatened by it, afraid they'll mess something up if they mess around with it, so they don't go looking (I'm talking about non-techies). There are some steps you can take with an Ini file... you could put in a location seldom surfed by non-techies and/or you could Encrypt on Exit and Decrypt on start (doesn't prevent them from playing with it before hand)... or you could (I'd use non-autoit means to do this) Decrypt before calling an Ini function, and Encrypt after (sounds bulky to me).

All in all, it's about what you think you are putting in these data files and how you will be calling them for your convenience that you should concern yourself with.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Well... I'm assuming you are thinking registry, because it isn't a file just sitting there, and people are nearly threatened by it, afraid they'll mess something up if they mess around with it, so they don't go looking (I'm talking about non-techies). There are some steps you can take with an Ini file... you could put in a location seldom surfed by non-techies and/or you could Encrypt on Exit and Decrypt on start (doesn't prevent them from playing with it before hand)... or you could (I'd use non-autoit means to do this) Decrypt before calling an Ini function, and Encrypt after (sounds bulky to me).

All in all, it's about what you think you are putting in these data files and how you will be calling them for your convenience that you should concern yourself with.

i'm sort of a purist about windows folder, and windows registry.. i think they should only be used by windows programs, not third party.. e.g. if your saving window pos, ect in registry that is pretty unnecessary, and a nuisance because i may be going for portability, e.g. run it on another computer.. registry does has advantage that is if you wanted to know what version of the software the user was running, or where it was installed..

err. nevermind

Edited by mrRevoked
Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()
Link to comment
Share on other sites

I believe that the windows registry is overused. It should be used when the information should stay even afer the program uninstalls. For example, I think it was back when I had Norton's Anti-Virus, I uninstalled for some reason and some settings and registration info were kept in the registry so that, when I installed a month later, I didn't have to choose every option again. This was best for the registry because, after uninstalling the program, all of its files should be gone and were. Also, I think that it is good for system information and other information that is unique to that particular computer (or using HKEY CURRENT USER the err...current user.) because files can be copied...and will be...

However, in 9 out of 10 cases, it's best to use files. I use ini sometimes, but frequently I invent file-types which work best for the program.

There are a number of ways to keep a user from messing up a file. My favorite is already mentioned...decrypt on load file, encrypt on write. A user who can get around that, would have an equally easy time getting around something similar in the registry. The registry keeps distance between the non-technical users and the data...but not putting your files in My Documents, etc. could easily do the same thing. However, recently in most of my software, I've been leaning toward the total opposite, I've been working to create open file specifications because I would be more than happy to see others write software which supports my file format.

As for a reminders program, I made one too...a scheduler/reminder program. In early versions it had a sophisticated security and encryption system, but then I realized that it was total overkill. You don't have to be worried if the user can edit their data in notepad if they want to...well, unless you are being reminded of illegal acts. :whistle:

"Everything is vague to a degree you do not realize till you have tried to make it precise." - Bertrand Russell [The Philosophy of Logical Atomism]

Link to comment
Share on other sites

Thanks for the replies, I think I get the general idea about how reg files are used....

@Smoke_N

That makes sense, it would be pretty hard to hide information from a "techie" just because they would know where to look, but I think your solution of putting it somewhere most people won't go is a good idea. Actually that helps a lot, before I was thinking of putting it under program files but that would be pretty easy to find. I think I'll put it under the specific user's application data, that way it will be user specific and also hard to find (due to the fact that "Application Data" is originally hidden...

@mrRevoked

i think they should only be used by windows programs, not third party.. e.g. if your saving window pos, ect in registry that is pretty unnecessary

I agree with you about that, I'm planning (just for the sake of experience) to just write some of the configuration settings to regedit... kind of like minesweeper does now: HKEY_CURRENT_USER\Software\Microsoft\winmine

@Creative

However, in 9 out of 10 cases, it's best to use files. I use ini sometimes, but frequently I invent file-types which work best for the program.

Do you have any simple examples of how to do this? I have really experimented at all with creating my own file types....

unless you are being reminded of illegal acts. biggrin.gif

:whistle: Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

I think I'll put it under the specific user's application data, that way it will be user specific and also hard to find (due to the fact that "Application Data" is originally hidden...

Sounds like a good idea. Create a sub folder with the name of your program and put your ini in there.

:whistle:

Link to comment
Share on other sites

Do you have any simple examples of how to do this? I have really experimented at all with creating my own file types....It's very specific to the type of data that you want to store. The first step is just typing something different after the ". ". Then you'd probably go to 'folder options > filetypes > new' and link the filetype to your program. But then, the most important part, what is actually inside the file...that is different for every situation...I mean, it's just a matter of looking at your data and figuring how to:
  • create a positional or symbol based code in order to abbreviate common data types and values
  • write data in an order that lets you access important bits easily
  • find the best way to write it so that when it is read, it can be easily seperated and sorted
  • create a data structure which can maintain the hiearchy or relations between the data
  • etc
But, as I said...I can't really say much that is useful...it is obviously very specific to the data that you are trying to represent.

"Everything is vague to a degree you do not realize till you have tried to make it precise." - Bertrand Russell [The Philosophy of Logical Atomism]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...