No announcement yet.

Saving persistant data within Web/Email Executable

  • Filter
  • Time
  • Show
Clear All
new posts

  • Saving persistant data within Web/Email Executable


    Forgive me if this has been answered. I searched with as many keywords as I could, but did not find a suitable topic.

    I want to deploy a single executable that I can save user prefs at runtime. I know I can do this with a simple INI file in the Windows directory. Or I could use a database, of course. I've done both of these in the past.

    But this time, I want to keep the program "portable" enough that it can live on a thumbdrive (or similar) and not require any files outside the project's exe.

    I just created a test project that writes to an INI in the project's docs folder. But once I compile the project, the new entries don't stay saved in the INI after a re-launch (everything is back to the way it was when it was compiled).

    Thanks for any ideas and insight!

  • #2
    You cannot update the self extractor at runtime. If you need persistent data, you would save it in a file in the user's profile (Documents, or Application Data), in the source folder of the web executable, or in the registry (HKCU).



    • #3
      Thanks Ulrich. I was afraid that was going to be the answer.

      While I'm deciding of a new approach, is there a preferred way to store data without using a remote database? Perhaps JSON or XML vs the simple INI file?


      • #4
        You can do whatever works best for you. You can use CSV files, INI, XML, JSON, even a SQLite database, if you want. The amount of data involved, and the speed / computation required for exchanging data would tell you which approach might be the best.