• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6018
  • Last Modified:

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
0
Stef Merlijn
Asked:
Stef Merlijn
  • 5
  • 5
5 Solutions
 
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now