Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving configuration in application' exe file

Status
Not open for further replies.

Cosmin3

Programmer
Dec 9, 2010
10
RO
Hi.
I want to save the configuration of my program into its exe file (directly or in resources).
I know I can use registry or a separate configuration file but I prefer to save in exe.

Could you please help me..?
Thank you in advance.

Best regards, Cosmin
 
Thank you.
I read this thread before writing this one and is not what I'm looking for...
 
You are really better off for using the configuration file or the registry for a very large number of reasons. Consider going this route instead of this route you want to go on now which will only change with time and cause users to not use your application. I know as soon as I figure out what your app is doing it will be OFF of any system I have admin control of.

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
I just had a feeling that I know you already...

I just want to make it lite and portable.
The users will start it from USB stick/key.
It doesn't even have an installer. It's freeware.
I don't like to use registry for various reasons.
I usually use configuration files (ini, cfg) but in this case I prefer not to.

And, wow, this is a forum where people make threats but they say it's a warning.
Relax, I will not Red Flag it.

And you can relax completely, I just talked with my partner and we decided not to use configuration anymore. All will be automatic.

Have a nice day.
 
That is against all practices and standards available. Most AV packages will detect this as being a virus!
When installing your exe on Windows Vista and up (and XP when non-administrator), you won't be able to write to it (when stored in the proper place, like Program Files) because ordinary users don't have write access to that directory and it's subdirs. You won't even be able to write an ini file there!
Use the registry or write the configuration in a file into %appdata%, %userdocs%, etc., (using the proper constants), and do not try to think you know better... :-(
 
First, I have tried good antivirus programs on such files and there wasn't such problems.

Second, seems like you didn't read what I said:
I just want to make it lite and portable.
The users will start it from USB stick/key.
It doesn't even have an installer.
So it will not be stored in such locations as Program Files.
It will be stored where the user will copy it.
If it can't be modified it will notify the user that it can't save configuration.
For normal installed programs you're 100% right. All my other programs are saving configuration in a file into %appdata%.

Third, I don't think I know better. That's why I'm here asking.

But this is all pointless since I decided not to save/load configuration anymore.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top