I'm looking for a way to save the configuration of my program and embed it to the executable file at runtime. By the way, if there is a better way to save the configuration of a program without any external files, then please tell me about it. My main goal is to make a program that is not using any external files, and is able to save it's configuration regardless of it's location. For example, we can configurate it on the pc.1 and then copy the exe file (yes, it's meant to be written for Windows) to pc.2 and run it with the previously saved configuration.
Asked
Active
Viewed 744 times
0
-
Can't you store the configuration on the network? – Paweł Stawarz Mar 02 '14 at 00:59
-
No, it should work without an network connection. – Tomasz Kasperczyk Mar 02 '14 at 01:00
-
[This](http://stackoverflow.com/a/1954479/1013628) should help you a little. – ibizaman Mar 02 '14 at 01:17
-
Oh, so I guess that it is harder than I thought. Thank you for the link ibizaman. – Tomasz Kasperczyk Mar 02 '14 at 01:22
1 Answers
0
If your intent is to have no additional files and you develop your program for Windows then you could persist your settings in the Windows Registry.
Here are some online resources:
-
I can't do that because as I said - I want to configure the application on the first pc and then run it with the same configuration on the second pc. – Tomasz Kasperczyk Mar 02 '14 at 17:10
-
@user3125731 I would not reccommend this, but you can do this by opening the executable file and writing to it, see here http://edn.embarcadero.com/article/27979 for more information on how to add custom data to an executable. – Mar 02 '14 at 17:27