views:

211

answers:

1

if you compile a program in D2010 a manifest .res file is automatically generated. is it included in your program by default? or you have to include it yourself?if yes what level of privilage is given to you? my program modifies a registery key would it be able to do so with out any modifications to .res file?if no what modifications i need to do?
a side question: is there a component/expert(prefably free) that can generate/include .res file in my delphi 7 and delphi 2007 projects automatically just like delphi 2010?
edit: forgot to mention i do not have win7 or vista nor have i ever used them
edit2:i have included a manifest file just in case following this tutorial but the tutorial only talks about windows vista and not 7 would the .xml(manifest) file in this tutorial make my app capable of dealing with win7 UAC too
edit3 if i include my own manifest file and delphi is including it by default as well that will make 2 manifest files(1 with admin previlages and 2nd without) would this cause any problems/unpredictable behaviour

+5  A: 

The manifest generated by delphi gives your process the lowest privileges (that is the default by the way).

You have to modify the manifest file in order for it to ASK for permission to be run under administrative rights (Called elevation).

Your application with the standard privileges should read/write to HKEY_CURRENT_USER without elevation.

Accessing %programfiles% and HKEY_LOCAL_MACHINE requires elevation. (Not so sure about the other registry hives)

This is a PDF that will help you ALOT with what you're up to.

http://pascalfonteneau.developpez.com/articles/delphi/vista/uac/VistaUACandDelphi.pdf

Aldo
thanks aldo,see my edit2
Omair Iqbal
That will also work for Seven, yes.
Aldo
thanks again,now kindly see edit3 :-)
Omair Iqbal
I think you should disable run-time themes (or remove XPMan references ) but I'm not 100% sure, really. You can check by disabling Delphi's manifest, embed your own and check if the application is properly themed
Aldo
For the third edit, you should disable run-time theme support in Project Options, and provide a manifest yourself as a resource which contains both the required privileges and run-time theme. Beside that, I remember there was an IDE expert for Delphi 2009 which would allow you to edit the generated manifest for your project. Unfortunately I cannot remember its name now.
vcldeveloper
@vcldeveloper:are you talking about "Project/Options/Application/Enable runtime themes" checkbox? and i know nothing how to add runtime themes to your manifest can you point to a tutorial?
Omair Iqbal
vcldeveloper
@vcldeveloper: thanks
Omair Iqbal