We all know Microsoft's party line. What Microsoft
decides is "OK" is not particularly relevant here. They
designed a product. They sell it. Now people writing
software need to decide the best way to deal with it.
Nonsense.
You are writing software that BUILDS ON TOP of Windows. You are REQUIRED to
follow the specifications of that system ("What Microsoft decides is 'OK'"),
whether you like it or not. If you find some way to do something that is
"out of spec" (such as writing to Program Files) that works (as it did in XP
when the user was admin), it is AT YOUR OWN PERIL that you perform such
behavior.
The fact that a non-compliant behavior may have worked before certainly does
not make the behavior OK, and definately doesn't justify you TRYING TO FORCE
IT TO WORK when Windows changes.
You do not "work around Windows" by subverting it! Software that does this
is called 'malware'.
You know perfectly well that Program Files has always
been where most software worked out of until recently.
Rediculous. "My Documents" and other special shell locations have been set
up for application's usage SINCE WINDOWS 98.
Only broken apps saved state to Program Files.
The current Windows filesystem security structure has been in place with
little modification since Windows 2000. It is now 2007. This isn't a big
secret - look on MSDN and there is MUCH DETAIL on each system location in
Windows, what goes there, who can access it, and how much access they have.
(After all, what point would there be to VB's App.Path
property if nothing there could be accessed?
The stuff there can be accessed. You just can't write to it. There are API's
to determine what access you can get to files; Use them
And very
few people other than corporate lackeys on workstations
run XP as anything other than admin.
Your point here is that "well, since most people are admin, why should I
worry about following the spec... I'll just do it this non-compliant way,
since it will work most of the time".
Again, the problem here is that your are NOT FOLLOWING SPEC, and if you
release code that doesn't follow spec you run the risk of Microsoft breaking
your program every time they release a hotfix, service pack, or new version.
Well, it finally happened ... you bet and lost ... now you have to deal with
it.
In Windows Vista, ALL non-admin programs are running in a limited account,
even if the user that started them is an admin.
Non-administrative applications that follow spec are not affected by this
change.
Administrative programs only need to be changed to prompt the user for
permission, and they will work fine.
Non-administrative applications that DO NOT follow spec MUST BE MODIFIED TO
CONFORM to the already well-published spec in order to run on the new OS.
It's not as simple as just "going along with the plan".
Of course it is. Your application must interface with Windows the way
Microsoft requires it to.
Even if you think that Microsoft's general plan makes
sense, it's only geared toward corporate users.
Home and small office users want functionality...they don't want
frivolous warnings...and they usually don't want settings
changing between users. So the challenge is to work
out the simplest way to seamlessly allow people to run
software that way, as unrestricted for all users.
Ignoring the fact that you are making a wide, sweeping claim about ALL USERS
which, besides being unsubstantiated, cannot possibly be true...
The reality of the situation is:
1) The people that only want to use ONE ACCOUNT, will only USE one account.
2) The people that want to use MORE THAN ONE account, will.
In *ALL* cases, your app WORKS CORRECTLY if it ONLY writes data to per-user
locations.
You have NO REASON to store data in Program Files.
I think that everyone wants to try to do that in a
standard way that makes it easy for users, but the
options in Vista for all-user-accessible software seem
to come down to either cutting the security in Program
Files or moving everything to All Users App Data. There
doesn't seem to be an option that's in accord with what
MS officially defines as "OK".
It's easy ... store data in per-user locations
.
In Windows, each user account is completely isolated from the next. One user
cannot mess with another user's or the system's stuff. Only ADMINS can do
that. Any program that wants to do this MUST be allowed to run by an admin,
or must be running as part of the operating system (like a windows service
does).
This is the way Windows is architected, and so your app MUST follow this
design pattern.
If your program has a legitimate need to be mucking around in Program Files,
then it is an administrative program, and must require admin permission from
the user before mucking around with those files.
Or, if the chunk of your program that is needing access to the program files
folder is really an extension to the OS, then it needs to be written as a
Windows Service.
The days of Windows ME where applications did whatever the heck they felt
like at the expense of stability, user control, and security are over.
Sorry
.
--
- JB
Microsoft MVP - Windows Shell/User
Windows Vista Support Faq
http://www.jimmah.com/vista/