Re: Virtualization
- From: "Kevin Provance" <Bill.McCarthy.Is.Stalking.TPASoft.com...@xxxxxxxxxxx>
- Date: Wed, 2 Sep 2009 10:52:13 -0400
Okay, here is what I do, after much trial and error, it seems to work out
just fine.
First, to determine data folder locations I am using the same APIs you
describe. One for the Common folder and one for User.
I try in most cases to let me application create data files as needed,
always placing them in the user folder, as each user (in the case of my
software) prefer their own settings and data, even when sharing the same
program. In cases where data files that have information contained in them
at install time, I install those files in the common data area. When my
application needs to retrieve that data, it firsts checks for that file in
the User area. If it does not exist, it checks the common area, where the
installer put it. Any and all saving from that point on goes to the User
area where the file will be read and written to from that point on.
The software, commonly installed can then read from "master" data files in
the common area and then save to the User area so that everyone starts with
the same data and changes remain User specific. Make any sense?
When using this method, it is important to install the program to
ProgramFiles (or {app} if you use Inno), install data files to the Common
App Data folder (including your own sub folders, which should be
%commonappdata%\company name\app name and finally when creating shortcuts in
the program menu, they should be the Common group and Common desktop for
desktop icons.
As for using the registry, I really do try to avoid it at all costs. In
cases where I must, I stick specifically to HKCU as HKLM will not be
writable (only readable).
I base my methods above on the MSFT authored article
(http://msdn.microsoft.com/en-us/library/aa480150.aspx) Developer Best
Practices and Guidelines for Applications in a Least Privileged Environment.
Also, since you wish to use the registry, I recommend this article
(http://support.microsoft.com/kb/256986) entitled Windows registry
information for advanced users
If I can further explain anything I was not clear on, or you need further
clarification, please post back and let me know. I use VB6SP6 with all the
various updates, and I use Inno for my setup packages.
The very last thing I would suggest from your OP is that you seem to want to
let your users go into their data files to make changes. With all due
respect, that is bad practice, especially if your end user has no idea what
they are doing. Don't ask them to change their license file by hand. Your
program should automate that process for your end user. Unless there is a
file in MyDocuments, all data files stored away and hard to locate for a
reason. End users should not be tampering with them.
Maybe Karl could write an extended article about all this. Or maybe I will
and he can print it <g>
- Kev
--
2025
If you do not believe in time travel,
your beliefs are about to be tempered.
http://www.facebook.com/group.php?gid=43606237254
"Jim Meyers" <jim.meyers@xxxxxxxx> wrote in message
news:%23k49BB8KKHA.5628@xxxxxxxxxxxxxxxxxxxxxxx
| Hello!
|
| I am looking for a folder under XP and higher that all users have read
| and write access to.
| I was using the CSIDL_COMMON_APPDATA & "\MyApp" directory all the time,
| but today a user told me that one of the files that was stored in there
| could also be found in
| C:\Users\<USERNAME>\AppData\Local\VirtualStore\ProgramData\
| This virtualization kills me.
| What is a better place, please?
|
| Thanks a lot for the help on this issue!
| Jim
.
- Follow-Ups:
- Re: Virtualization
- From: mayayana
- Re: Virtualization
- References:
- Virtualization
- From: Jim Meyers
- Virtualization
- Prev by Date: ifstream in VB6
- Next by Date: Re: Virtualization
- Previous by thread: Re: Virtualization
- Next by thread: Re: Virtualization
- Index(es):
Relevant Pages
|