0

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.

Tomasz Kasperczyk
  • 1,991
  • 3
  • 22
  • 43

1 Answers1

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:

Windows Registry (Wikipedia)

How to: Write Data to the Windows Registry (C++/CLI)

How to: Read Data from the Windows Registry (C++/CLI)

  • 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