
Signature
David Wilkinson
Visual C++ MVP
Hello,
>> Can you please inform me about an alternative? I want to save some
>> settings
>> like the location where the program is used, the amount of articles to be
>> dispalyed on screen, etc. ...
>> These are not the same for every PC that is running the program.
> Normally such settings are per-user, and so should be saved in the HKCU
> registry. Any user can write to the HKCU registry.
>
> It is almost always a mistake for a program to write to HKLM. Only Setup
> programs should write to HKLM.
Then my question still stays: There are a few items that need to be set
after setup, like the location of the database, the location where the
program is running and a few other items.
These settings are all the same for all users on a particular location, but
can be different for every location.
Where can I put those settings?
They need only to be set once after the program is installed on every
computer.
Many thanks and greetings,
Michel
David Wilkinson - 22 Jul 2008 19:15 GMT
> Then my question still stays: There are a few items that need to be set
> after setup, like the location of the database, the location where the
[quoted text clipped - 4 lines]
> They need only to be set once after the program is installed on every
> computer.
Michel:
1. Why can the setup program not make these entries?
2. If not possible, would it be a disaster if each user had a copy of these
items in HKCU?
Why is your program different from any other?

Signature
David Wilkinson
Visual C++ MVP
David Lowndes - 22 Jul 2008 19:16 GMT
>Then my question still stays: There are a few items that need to be set
>after setup, like the location of the database, the location where the
>program is running and a few other items.
In that case you probably need to have a separate exe that's has just
that functionality. It will need to be marked to explicitly run
elevated so that (under Vista) it automatically prompts.
Dave
Mark Salsbery [MVP] - 22 Jul 2008 19:32 GMT
> Hello,
>
[quoted text clipped - 17 lines]
> but can be different for every location.
> Where can I put those settings?
The recommended place for this type of application data is in a folder
%ProgramData%\Company\Product\Version\
where %ProgramData% is obtained from the OS, e.g. using
SHGetKnownFolderPath(FOLDERID_ProgramData).
Your app's installer should create the %ProgramData%\Company\Product\Version
folder and give it the appropriate access permissions.
I personally use XML configuration files stored there.
Mark

Signature
Mark Salsbery
Microsoft MVP - Visual C++
> They need only to be set once after the program is installed on every
> computer.
>
> Many thanks and greetings,
>
> Michel