What tips to follow to be sure an application is compatible under limited/guess account?

Hi all,

I would know what limitations do we have to follow to be sure our application is compatible under a Guest and Limited account on XP as well as Vista.

for example, can we write settings to HKEY_LOCAL_MACHINE/Software ?

do we have right to install something in windows directory? what are the limitation? I think it's ok to drop a file to temporary folder,

if for example I want to show a message or something the first time my application run on a computer, if I can't write to HKEY_LOCAL_MACHINE, means I have to write to local user, but then, it will be shown 4 times if there is 4 users who open it on their own session,

so where to write settings to be able to use them from any account and write to it too from any account.


so, what I have to follow to be sure my program will be 100% functional/compatible under limited/guess account (and this on XP as well as Vista),

Note that I don't want asking permission or asking elevation to user.

500 points for this one

thx a lot in advance
Marc582Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
>>can we write settings to HKEY_LOCAL_MACHINE/Software ?

That depends. For information you want to share across user accounts, you can, but I'd rather only do that if absolutely necessary. When you create your own subkey for that purpose, that is OK.

>>so, what I have to follow to be sure my program will be 100%
>>functional/compatible under limited/guess account

The only bullet-proof way to find that out is to test it. Yet there are some caveats to keep in mind from the beginning:

- Installation: If your setup requires to place data in system32 or anywhere below %WINDIR%, you might encounter trouble (especially on Vista)
- Storage: Do not rely on the idea that you can store data wherever you want, use the appropriate APIs to find the respective locations.

See also http://msdn2.microsoft.com/en-us/library/bb384608.aspx ("How User Account Control (UAC) Affects Your Application") and http://msdn2.microsoft.com/en-us/library/aa480150.aspx ("Developer Best Practices and Guidelines for Applications in a Least Privileged Environment") in particular.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JohnjcesCommented:
First, the only way you will do what you want under Windows Vista is to turn off the User Access Control on your users computers and then ensure all users run under an administrators account under Vista.

Simply put, Vista enforces all access and tries to protect the user from him or herself.

XP is not so strict, but as a limited user, what you are wanting simply will not work unless the user is an administrator.

To answer your questions as if running under Vista should better answer your Qs as to XP.

Q. for example, can we write settings to HKEY_LOCAL_MACHINE/Software
A. No. You must do so as an Admin or increase privileges.

Q. do we have right to install something in windows directory?
A. No. You must do so as an Admin or increase privileges.

Vista puts stuff in virtual folders and virtuial places in the registry under user account settings.

In order to get to be workable under vista and XP you will need an XP/Vista manifest.

Do an EE search for Vista manifest. I have answered a few as well as others on how to get a manifest compiled into your application.

ANY registry writing to HKLM as well as othe rplaces needs approval and admin user account privileges.

The simple answer to your question is that unless you disable all security in Vista and XP or make a limited user and administrator, you simply will not be able to do what you want to do. Period.

Sorry about the bad news.

John
0
Marc582Author Commented:
ok so to share information between account (admin as well as standard one) using the registry is not possible?

0
JohnjcesCommented:
I believe a good place for you to start would be the following URL...

http://msdn2.microsoft.com/en-us/library/aa965884.aspx

This explains Vista's Registry virtualization.

In my apps that run on all OSes, I have to run special routines just for Vista.

John
0
JohnjcesCommented:
Registry virtualization is disabled for the following:

* Keys and subkeys of HKEY_LOCAL_MACHINE\Software\Classes, HKEY_LOCAL_MACHINE\Software\Microsoft\Windows, and HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT.

You can read and write to those registry locations as a user/administrator etc.

Anyway, if you can make your apps Vista aware, they will run fine on XP.

Anymore you have to target the highest veision of OS and work down from there.

John
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.