Help with Delphi app with vista manifest



I've got an old D4 app that I've been playing around with under Vista. I've been reading a lot about adding the appropriate embedded manifest information so that Vista will know the execution level my app needs. I think the embedded manifest is working but one part does not seem right. Here is what I have done:

I've created this manifest file called "XPVista.manifest"

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="MyApp"
type="win32"/>
<description>My Application</description>
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="*"/>
</dependentAssembly>
</dependency>
</assembly>


I created this resource file called TEST.RC (contains only 1 line):
1 24 "XPVista.manifest"

I used brcc32 to compile the TEST.RC into TEST.RES

I added {$R TEST.RES} to my project file right below the {$R *.RES} line.

I then compiled my app. When I look at the executable it now correctly shows the shield icon indicating that the application requires elevation. This is due to the "requireAdministrator" option in the manifest. When I dbl-click to run the application I get an error message:

C:\Proj\MyApp\MyApp.exe
The specified path does not exist.
Check the path and try again.

What I expected to get was the nice UAC elevation dialog asking if I wanted to allow the elevation. If I right-click and choose Run as Administrator then the app runs just fine.

Is there a problem with the manifest that I'm using or the way that I have embedded it into the app that is causing the elevation prompt to not work? I've see this "Path does not exist" error before with other apps (like RegEdit.exe for example) where the only way to run them is to choose Run as Administrator on the right-click menu.

Thanks for any advice!
--
Scott Slater

.



Relevant Pages

  • Re: Help with Delphi app with vista manifest
    ... think the embedded manifest is working but one part does not seem right. ... I then compiled my app. ... What I expected to get was the nice UAC elevation dialog asking if I wanted ...
    (borland.public.delphi.non-technical)
  • Manifest Files
    ... I'm fairly new to app security and manifests. ... confused - if the manifest file is embedded into the assembly, ... intended recipient, please inform the sender and delete all copies. ...
    (microsoft.public.dotnet.security)
  • Re: Vista registry programming
    ... Vista-like noises (it's easy...you just go to the manifest section of the MSDN, ... currently-shipping system even though its a new app). ... The root key of our registry tree had modified security to ... not only are the registry security ...
    (microsoft.public.vc.mfc)
  • Re: Some interesting things about XML...
    ... Each APRD Chain may contain a variable number of entries. ... > gdi.dll does some interesting things with .manifest files. ... > Microsoft has also programmed Internet Explorer to read the ... > same folder the app resides in, so if you had an app titled ...
    (alt.lang.asm)
  • Re: Manifest+MFC80.dll = neue DLL-Hölle?
    ... Meiner Meinung nach beseitigt gerade das Manifest das DLL Problem. ... dann startet die App nicht. ... dass die CRT aei der 8.0 verwendet. ...
    (microsoft.public.de.vc)