Run application only with full administrator-rights in Windows Vista

Hi,

How can I force Windows Vista to execute (run) my application as a user with full Administrator-rights?
Currently Vista will user a Virtual Store to allow user that don't have full Administrator-rights to perform  read/write actions on files in protected areas.
F.e.:
When a database is stored in folder "C:\Program files\MyAppFolder\", Vista will 'copy' the database to the virtual store and data-updates will be done there.
When the user does have full Administrator-rights, Vista will use the intended database in "C:\Program files\MyAppFolder\".
I've read something about a XML-manifest that would grant full Administrator-rights to a user for a certain application.

Can anybody please give me a detailed description on:
1. How to check if full administrator-rights is set for my application from within my Delphi-application
2. How to create the manifest for Vista
3. How to executed the manifest within my Delphi-application

Regards,
Stef
Stef MerlijnDeveloperAsked:
Who is Participating?
 
JohnjcesCommented:
1). You cannot set your programs rights as Administrator without a manifest. You Must have it compiled in and Vista will still ask the user for permission.

2). A quick search comes up with:

http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_22755023.html
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_22423950.html

The above will get a Vista manifest installed so that a program can run as adminsitrator, but Vista will still ask for permission.

3). See 2 above.

This should get you going!

John
0
 
Stef MerlijnDeveloperAuthor Commented:
Can you also tell me how Vista will act when a limited user starts this application?
Will Vista ask for a Administrator password or something of the kind?
0
 
JohnjcesCommented:
Yes it will. At least at the point the application wants to do something, write something to the HDD or registry or some other admin task.

Give it a try!

John

0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Stef MerlijnDeveloperAuthor Commented:
Another question.
Will it also ask for administrator access when I run this application in Windows XP (or will it skip the embedded manifest as it is for Vista only)?
Do I need to add something to only run the manifest when application is running on Vista?
0
 
JohnjcesCommented:
It should run just fine on XP. XP ignores that part of the manifest. If you compare an XP manifest and Vista manifest, they are very similar.

JJ
0
 
Stef MerlijnDeveloperAuthor Commented:
And another.
If the application is started without the full administrator-rights and the user allows the application to run as administrator (when excepting the prompt triggered by the mainfest). Will the user need to grant access every time he/she starts the application or will the "run as administrator"-flag be set and saved the first time the application is started?
0
 
JohnjcesCommented:
Vista will want it everytime.

Vista is a pain in the rear.

JJ
0
 
Stef MerlijnDeveloperAuthor Commented:
And last... (maybe)
Which files should be distributed to the client-pc with my application?
administrator.manifest
administrator.rc
administrator.res
0
 
JohnjcesCommented:
As long as you have followed the instructions on compiling the manifest as a resource, you do not have to redistribute anything.
0
 
Stef MerlijnDeveloperAuthor Commented:
Thank you very much for your help.
Maybe you also have an answer to my other question:
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_22871310.html

Regards,
Stef
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.