Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Does Delphi 2007 compile some vista-manifest into exe?

388 views
Skip to first unread message

dk_sz

unread,
Sep 24, 2007, 3:50:32 PM9/24/07
to
Hi,

I would like to have Vista/UAC pop up errors
instead of silently redirecting file paths if user and/or
program tries to save a file in a no-access area.

Anyway guidance on how to best have this?


best regadrs
Thomas Schulz

Bob

unread,
Sep 24, 2007, 10:27:55 PM9/24/07
to
dk_sz wrote:

> I would like to have Vista/UAC pop up errors
> instead of silently redirecting file paths if user and/or
> program tries to save a file in a no-access area.

Try going into your Project Options and set the Application|Use Runtime
Themes. This will change the ShowMessage dialogs and MessageDlg will
show the Vista version. For the special vista task dialog you will
need to use the Vista Dialogs afaik.

Also, with this setting on, you will not get virtualized so write
attempts at HKLM will fail as well as writes to "Program Files". Not
sure if this is what you are looking for.

--

Henrik Bruhn

unread,
Sep 25, 2007, 10:13:41 AM9/25/07
to
dk_sz

> I would like to have Vista/UAC pop up errors
> instead of silently redirecting file paths if user and/or
> program tries to save a file in a no-access area.
Dusn't know how to do that.
But if you compile this resource into your application it will ask you for
administrator rights when starting up on Vista.
With administrator rights you have access to those folders.
You can also use this technique with Delphi 7 (and probably older).

<?xml version="1.0" encoding="utf-8" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="Vista UAC Compat.Application"
type="win32" />
<description>WindowsVistaReadiness Application</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

I put this into "vista.bin" and create "Vista.rc" with the only line "1 24
"Vista.bin"", compile this file into "vista.res" using brcc32.exe and
include the line "{$R vista.res}" in my project.

Regards Henrik


dk_sz

unread,
Sep 25, 2007, 3:48:24 PM9/25/07
to
> Try going into your Project Options and set the Application|Use Runtime

I though runtime themes was about being able to
switch mainifests placed in application directory
while program was running?

I must have read that wrong.


> Also, with this setting on, you will not get virtualized so write
> attempts at HKLM will fail as well as writes to "Program Files". Not
> sure if this is what you are looking for.

Close... never want virtualization! Ever! :-)
In case of administator-rights needed I want:
UAC dialog ask user and if "no"... Get error/fail access!

best regards
Thomas Schulz


dk_sz

unread,
Sep 25, 2007, 3:45:04 PM9/25/07
to
> But if you compile this resource into your application it will ask you for
> administrator rights when starting up on Vista.

Well, the program can run under limited accounts
(as tested on WinXP). I am more worried about subtle
bugs where files silently are stored the wrong places.
I do not have Vista myself yet so I am not 100% sure
of the implications, but generally I will prefer getting
error messages and WinXP'ish "limited user" behavior.


best regards
Thomas Schulz


Bob

unread,
Sep 25, 2007, 10:16:59 PM9/25/07
to
dk_sz wrote:

> Well, the program can run under limited accounts
> (as tested on WinXP). I am more worried about subtle
> bugs where files silently are stored the wrong places.

I can understand this. Its tough getting used to hunting down the
location of a file written by a non-UAC aware app. Add to that running
under Vista x64 which added another layer of "virtualization" for 32 vs
64 bit apps, its always a joy to try and find where files get stored.

--

TOndrej

unread,
Sep 26, 2007, 6:01:28 AM9/26/07
to
dk_sz wrote:
>> But if you compile this resource into your application it will ask
>> you for administrator rights when starting up on Vista.
>
> Well, the program can run under limited accounts
> (as tested on WinXP). I am more worried about subtle
> bugs where files silently are stored the wrong places.

Then I believe you should use <requestedExecutionLevel level="asInvoker"/>
in your manifest.
This will cause the application not to be virtualized and still run as the
user who launched it.

If I understand it correctly, virtualization is a backward-compatibility
feature used with older applications which come without a
requestedExecutionLevel manifest.
Here's a help file with more information about Vista UAC:
http://download.microsoft.com/download/d/9/b/d9beb875-bc1d-4338-a655-251f4f353b2e/top10wave.exe

HTH
TOndrej


0 new messages