Sign in to follow this  
Followers 0
Champak

registry vs ini

12 posts in this topic

Which is better to use as far as efficiency, speed, resource and all of that good stuff, to use as the thing to read your program info from and write to?

Share this post


Link to post
Share on other sites



I believe .ini is most common

to use as the thing to read your program info from and write to?


While Alive() {
	 DrinkWine();
}
AutoIt Programmer

Share this post


Link to post
Share on other sites

registry is faster that's why Microsoft switched windows over to it(it used to be ini files)


[size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N

Share this post


Link to post
Share on other sites

Even though registry might be faster i would still prefer Ini's, cause some peoples like me, hates when something tampers with the registry

Just my 2 cents


My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! you’re the best in town Fight!

Share this post


Link to post
Share on other sites

i made script that monitors a regkey every 1 min, if its chances, it sets it back to what it mus be

what is the best to use? if its going to be done every minute

RegWrite ("HKCU\Software\Microsoft\Windows\CurrentVersion\myapp\", "dden", "REG_DWORD", "2")oÝ÷ Ù«­¢+Ø%¥II ÅÕ½Ðí!-
TÀäÈíM½ÑÝÉÀäÈí5¥É½Í½ÐÀäÈí]¥¹½ÝÌÀäÈí
ÕÉɹÑYÉÍ¥½¸ÀäÈíµåÁÀÀäÈìÅÕ½Ðì°ÅÕ½Ðí¸ÅÕ½Ð줱ÐìÐìÅÕ½ÐìÈÅÕ½Ðì($%I]É¥Ñ ÅÕ½Ðí!-
TÀäÈíM½ÑÝÉÀäÈí5¥É½Í½ÐÀäÈí]¥¹½ÝÌÀäÈí
ÕÉɹÑYÉÍ¥½¸ÀäÈíµåÁÀÀäÈìÅÕ½Ðì°ÅÕ½Ðí¸ÅÕ½Ðì°ÅÕ½ÐíI}]=IÅÕ½Ðì°ÅÕ½ÐìÈÅÕ½Ðì¤(%¹%

Share this post


Link to post
Share on other sites

i made script that monitors a regkey every 1 min, if its chances, it sets it back to what it mus be

what is the best to use? if its going to be done every minute

RegWrite ("HKCU\Software\Microsoft\Windows\CurrentVersion\myapp\", "dden", "REG_DWORD", "2")oÝ÷ Ù«­¢+Ø%¥II ÅÕ½Ðí!-
TÀäÈíM½ÑÝÉÀäÈí5¥É½Í½ÐÀäÈí]¥¹½ÝÌÀäÈí
ÕÉɹÑYÉÍ¥½¸ÀäÈíµåÁÀÀäÈìÅÕ½Ðì°ÅÕ½Ðí¸ÅÕ½Ð줱ÐìÐìÅÕ½ÐìÈÅÕ½Ðì($%I]É¥Ñ ÅÕ½Ðí!-
TÀäÈíM½ÑÝÉÀäÈí5¥É½Í½ÐÀäÈí]¥¹½ÝÌÀäÈí
ÕÉɹÑYÉÍ¥½¸ÀäÈíµåÁÀÀäÈìÅÕ½Ðì°ÅÕ½Ðí¸ÅÕ½Ðì°ÅÕ½ÐíI}]=IÅÕ½Ðì°ÅÕ½ÐìÈÅÕ½Ðì¤(%¹%
Why would you want to monitor a single registry key? I don't know much about the registry...

However, I do use the registry for values, I prefer it because it's more likely to not be tampered with by users. I use .ini files for lists that, if they get corrupted, won't matter too much...


My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

@kimurtus, do not hijack posts, make your own.

@rambo3889, I'm kind of the same way, but I figure that if they don't want the software don't use it. But besides that, I'm just looking at efficiency.

If it's reasonable to use registry over ini, that's something I would be interested in investigating. I figure I'd just have to relearn a few things. Are there any real differences? ...reasons I shouldn't use registry over ini?

Edited by Champak

Share this post


Link to post
Share on other sites

It's depend on what you want to accomplish. You also might want to know that in some cases (security issues) IniWrite will not work, one case is when user will run your app without having rights to write files to hard drive (system drive for example), or he runs your app on unwritable device (CD-ROM).

And also if your program will write something rapidly to the ini-file, and it will run on USB-drive, it can do some demage to the USB-drive :).


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

What about corrupted registry files? I've done some quick google searches and a few people have mentioned about registries getting corrupted. I know people cry Armageddon when little things happen to them, and I don't recall it happening to me, but has anyone here had experience with their registry getting corrupted?

I don't expect people to put this app on a USB drive or CD-Drive.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

has anyone here had experience with their registry getting corrupted?

Well, yes, registry can be corrupted, but thinking that way you will never find a perfect solution :)

One more tip: If you want to store some setting about your app, better store them as default values inside the script, so if something from outside is corrupted, your app will still work (with default settings)...

Something like that:

...
$Default_Title = "My Default Title"
$Title_Settings = IniRead("Config.ini", "Main Prefs", "App Title", $Default_Title)
If $Title_Settings = "" Then $Title_Settings = $Default_Title
...
Edited by MsCreatoR

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

i made script that monitors a regkey every 1 min, if its chances, it sets it back to what it mus be

what is the best to use? if its going to be done every minute

RegWrite ("HKCU\Software\Microsoft\Windows\CurrentVersion\myapp\", "dden", "REG_DWORD", "2")oÝ÷ Ù«­¢+Ø%¥II ÅÕ½Ðí!-
TÀäÈíM½ÑÝÉÀäÈí5¥É½Í½ÐÀäÈí]¥¹½ÝÌÀäÈí
ÕÉɹÑYÉÍ¥½¸ÀäÈíµåÁÀÀäÈìÅÕ½Ðì°ÅÕ½Ðí¸ÅÕ½Ð줱ÐìÐìÅÕ½ÐìÈÅÕ½Ðì($%I]É¥Ñ ÅÕ½Ðí!-
TÀäÈíM½ÑÝÉÀäÈí5¥É½Í½ÐÀäÈí]¥¹½ÝÌÀäÈí
ÕÉɹÑYÉÍ¥½¸ÀäÈíµåÁÀÀäÈìÅÕ½Ðì°ÅÕ½Ðí¸ÅÕ½Ðì°ÅÕ½ÐíI}]=IÅÕ½Ðì°ÅÕ½ÐìÈÅÕ½Ðì¤(%¹%
i would use the one with the if statement. less cpu usage :)

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

@MsCreatoR

Why did you do that code that way instead of just

$Title_Settings = IniRead("Config.ini", "Main Prefs", "App Title", "Whatever")

?

It seems like unnecessary coding unless there is something I don't know.

I think I'm going to stick with ini, since no one has given any real reason to use registry that would apply to this apps environment. I did a quick unscientific test and the ini and registry both save the same amount of data as fast as each other(around 80 values----I didn't do a read and set test.).

Edited by Champak

Share this post


Link to post
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
Sign in to follow this  
Followers 0